wireguard vpn and wireguard vpn router wireguard

WireGuard explained: what it is and how it works

Adrian Maverick · · 8 min read

WireGuard is a VPN protocol: the set of rules a VPN app uses to build an encrypted tunnel between your device and a server. It is known for being small, fast and simple, and many VPN apps now offer it.

WireGuard is not a VPN service on its own. It is the engine. The company or person running the server still decides where it is, what it keeps and how your keys are handled. Here is how it works, what it does well and what it leaves to the app around it.

WireGuard in one paragraph

WireGuard's official site describes it as "an extremely simple yet fast and modern VPN that utilizes state-of-the-art cryptography." It was created by Jason A. Donenfeld, and its design was published as an academic paper at the NDSS security conference in 2017. It wraps your internet traffic in encrypted packets and sends them over UDP to the VPN server, which unwraps them and passes them on. It runs on Windows, macOS, BSD, iOS and Android, as well as Linux, where it started. It is open source.

If the idea of a tunnel itself is new, our explainer on what a VPN tunnel is starts one step earlier.

How WireGuard works when you tap connect

You never see most of this, but it explains why WireGuard behaves the way it does.

1. Your device and the server know each other by key

Each side has a key pair, a private key it keeps and a public key it shares. WireGuard's site compares this to SSH keys: you exchange short public keys and WireGuard handles the rest. In a VPN app, the app does this exchange for you when you sign in.

WireGuard calls its core idea cryptokey routing. Each public key is tied to the tunnel addresses it is allowed to use. If a packet arrives that decrypts with the wrong key, or claims an address that key isn't allowed, it is dropped.

2. One quick handshake sets up the session

Before any traffic flows, the two sides do a handshake that takes one round trip: one message out, one message back. That keeps connecting quick. The handshake is based on the Noise protocol framework.

3. Your traffic is encrypted with fixed, modern cryptography

WireGuard uses one short list of algorithms, published on its protocol page:

Job What WireGuard uses
Agreeing on keys Curve25519
Encrypting traffic ChaCha20, authenticated with Poly1305
Hashing BLAKE2s
Key derivation HKDF

There is no menu of ciphers to choose from, so there is nothing to misconfigure and no weaker option to fall back to.

4. Keys keep changing

WireGuard repeats the handshake every couple of minutes to create fresh session keys. The whitepaper sets this at 120 seconds, and old keys are wiped if no new ones are agreed. This is called forward secrecy: if one session key ever leaked, it would not unlock traffic from earlier sessions.

5. It stays quiet

The whitepaper has a section titled "Silence is a Virtue." A WireGuard server does not reply to packets that don't authenticate, which makes it "invisible to illegitimate peers and network scanners." When neither side is sending anything, the connection is silent too.

Why people like WireGuard

It is small. The whitepaper says WireGuard can be implemented for Linux in less than 4,000 lines of code, not counting the cryptography itself. The site contrasts that with older VPN software whose code is so large that reviewing it is "an overwhelming task even for large teams of security experts." Less code means less to get wrong and more people able to check it.

It handles network changes. WireGuard supports roaming. When your phone moves from home wifi to mobile data, your device's address changes, and the server simply starts replying to the new address once it receives authenticated traffic from it. You usually don't notice the switch.

It is designed to be fast. Its site calls it high performance and says it suits devices from smartphones to backbone routers. That is why it shows up in phone apps, and why "VPN router WireGuard" and "WireGuard for gaming" are common searches. Your actual speed still depends on the server's distance and load, which our post on whether a VPN affects ping goes into.

What WireGuard does not do on its own

WireGuard is open about its trade-offs. Its known limitations page lists them, and three matter for everyday users.

It doesn't hide that it is WireGuard. The page says WireGuard "does not focus on obfuscation," and that disguising traffic should happen in a layer above it. It also "explicitly does not support tunneling over TCP." This is why some hotel, school or office networks that block VPN traffic can stop a plain WireGuard connection. VPN apps handle this with a separate stealth or obfuscation mode, which our post on what a stealth VPN is explains. Using a VPN on any network should follow local law and that network's rules.

It is not post-quantum by default. Curve25519 could be broken by a large future quantum computer, which matters for traffic recorded today. The same page says WireGuard "is not, by default, post-quantum secure," and that the best approach is to run a post-quantum handshake on top and put the result into WireGuard's optional pre-shared key slot. Our post on whether WireGuard is quantum-safe covers how that works and how to check your own tunnel.

It doesn't decide what the provider keeps. The protocol encrypts the path between you and the server. What the server operator logs, stores or shares is a policy question, not a protocol one. Our guide to whether your VPN can see your browsing history covers what to look for.

Should you choose WireGuard in your VPN app?

For most people, yes, when it is offered. It connects quickly, copes well with switching networks, and its fixed set of modern algorithms leaves little to get wrong. If you are on a network that blocks it, switch on the app's stealth mode if it has one rather than giving up on the VPN.

If you're weighing it against the older option, our WireGuard vs OpenVPN comparison covers when OpenVPN still makes sense. For a short definition you can bookmark, see the WireGuard glossary entry.

Frequently asked questions

Is WireGuard a VPN?

WireGuard is a VPN protocol, the part that builds the encrypted tunnel. A VPN service adds the servers, the app and the account around it. Many VPN apps use WireGuard under the hood. For the bigger picture, see what a VPN is.

Is WireGuard safe?

It uses well-studied modern cryptography, its handshake gives forward secrecy, and its code is small enough to review. Its main gap is that it is not post-quantum by default, which a VPN provider can address by adding a post-quantum key to each session.

Is WireGuard free?

The protocol and its official tools are open source and free to use. A VPN service built on WireGuard may still charge for its servers and app.

Why does hotel wifi block WireGuard?

Some networks block or throttle VPN traffic, and plain WireGuard does not try to disguise itself. A VPN app's stealth or obfuscation mode helps you connect on networks that block VPNs.

Can I use WireGuard on a router?

Some routers offer WireGuard, which puts every device on your network through the tunnel. Whether yours does, and how to set it up, depends on the router's maker, so follow its own instructions.

Secria VPN and WireGuard

Secria VPN is built on WireGuard with an ML-KEM-1024 post-quantum key added to every session, on by default, on every plan. If you want to try it without paying, Secria VPN Free works on iPhone, iPad, Mac and Android with a free Secria account, no card needed, with free servers in Frankfurt and Dallas, one device at a time. Free includes stealth mode for networks that block VPNs, a kill switch and DNS blocking that helps block ads and trackers, and servers run in RAM only: "Keys, configs and connection state are never written to disk." No activity logs: we do not record browsing, DNS queries or traffic contents. Paid plans add every location, Multi-Hop, split tunneling and 5 devices. See Secria VPN.

Secria fact-checks every post against primary sources. Spotted something wrong or out of date? Email hq@secria.me and we will correct it.