WireGuard creator starts exploring a post-quantum v2 of the VPN protocol
WireGuard creator Jason Donenfeld says he has begun investigating WireGuard v2, a new version of the VPN protocol built for post-quantum cryptography. In a post to the WireGuard mailing list on December 2, he gave no release date and no choice of algorithms. Until v2 arrives, he suggests a built-in option for those worried about the new findings: a 256-bit pre-shared key. Anyone who runs their own WireGuard server can turn it on today.
What Donenfeld wrote about WireGuard v2
The post responds to the "recent chatter" about AI-driven math advances that might affect cryptographic security, and links to the NSA advisory urging a fast move to post-quantum algorithms. That same week, US agencies and Britain's NCSC said a new discovery affects some encryption in use today. Donenfeld wrote that the project "is aware of this, and is actively charting a path forward".
- Status: he has "already begun investigating" a protocol update for v2. He stressed that the post is not an invitation to design it in a mailing list thread.
- Versioned crypto: WireGuard does not negotiate algorithms. Each protocol version fixes one set, so when a primitive needs replacing, the version number goes up and new software ships.
- The hard part: keeping WireGuard's simplicity with today's post-quantum primitives is "certainly challenging (though hopefully not impossible)". "ECC was really in an ergonomic sweet spot, which we'll have to move on from," he wrote.
Why a pre-shared key protects WireGuard now
A WireGuard handshake agrees on keys using Curve25519, an elliptic-curve algorithm. That is the part a quantum computer, or a new mathematical attack, would target. The optional pre-shared key is mixed into the same key derivation. The wg manual describes it as "an additional layer of symmetric-key cryptography" added "for post-quantum resistance".
If the key is shared through a secure offline channel, Donenfeld wrote, the security of the protocol "comes down to breaking that 256-bit ChaCha20 key, which isn't going to happen, rather than any asymmetric primitive". So even if Curve25519 were broken, recorded traffic would stay unreadable. The condition matters: a key sent by email or messenger is only as safe as the encryption of that channel.
How to turn on the pre-shared key on your server
Each server and client pair needs its own key, and both sides must have the same one. On a server set up as in our guide to WireGuard on a VPS, it takes a few minutes:
- On the server, generate a key with
wg genpsk > client1.pskand restrict the file withchmod 600 client1.psk, or delete it once the key is in both configs. - In the server config, add the line
PresharedKey =followed by the key under that client's[Peer]section. - Add the same line under
[Peer]in the client config, the section that describes the server. - Move the client config offline, for example by scanning a QR code in person or with a USB stick.
- Restart the interface on both sides. Alternatively, apply the key on the running server without a restart:
wg set wg0 peer CLIENT_PUBLIC_KEY preshared-key ./client1.psk. - Check with
wg: the peer should show "preshared key: (hidden)".
If only one side has the key, the handshake fails and the tunnel will not come up, so update both configs before reconnecting.
What about commercial VPN apps?
With a commercial VPN you cannot set your own pre-shared key on the provider's servers. For that case Donenfeld describes a second method: run one or more post-quantum key exchanges through an already established WireGuard tunnel, then put the result into the pre-shared key slot. "I believe some VPN providers are already doing this," he wrote. Mullvad, for example, has a "Quantum-resistant tunnel" setting in its app, and its help page lists Classic McEliece and ML-KEM-1024 as the algorithms used to negotiate the pre-shared key. Other providers have added similar options, as we covered in our piece on post-quantum encryption in VPN standards. Look for such a switch in your VPN app's WireGuard settings.