Sulat.com / Writing on AIThursday, December 3, 2026
Enter →
Networks/3 December 2026

WireGuard’s creator is investigating a v2

Jason Donenfeld has told the WireGuard mailing list that a post-quantum v2 is under investigation and that the pre-shared key slot covers the gap. I tested how that slot behaves.

WireGuard logo medallion with a brass key entering a keyhole slot, glass tunnel and lattice behind
Illustration: Sulat, featuring the WireGuard logo

At a glance

  • Jason Donenfeld told the WireGuard mailing list the project is aware of the AI cryptography news and has already begun investigating a WireGuard v2. He gave no design and no date.
  • His stop-gap is WireGuard's 256-bit pre-shared key, which puts the tunnel's security on symmetric ChaCha20 rather than any asymmetric primitive.
  • In my test on a Linux VM, mismatched or one-sided pre-shared keys gave no handshake, and a key changed on a running tunnel only took effect at the next handshake.
  • A pre-shared key added no bytes to WireGuard's 148-byte and 92-byte handshake packets, and one ML-KEM-768 public key is 1,184 bytes, eight times the handshake start.
  • Mullvad and NordVPN already feed post-quantum key exchanges into the pre-shared key slot, and Rosenpass does the same as a separate open-source tool.

Jason Donenfeld, who created WireGuard, has told the project’s mailing list that WireGuard “is aware of” the recent AI cryptography news and “is actively charting a path forward”. He says he has “already begun investigating updating the protocol for a WireGuard v2”. He gave no design and no date. What he did offer is a fix that works today, the 256-bit pre-shared key option that’s already in WireGuard.

This piece covers what the post says, how the pre-shared key slot works, what I ran on a Linux VM to see how it behaves, why a v2 is a harder job than a version bump, what VPN providers already do, and where it sits next to the NSA advisory and Anthropic’s lattice papers. It follows my earlier coverage of the NSA advisory, Anthropic’s lattice papers and the AI factoring rumours.

What Donenfeld wrote

The post is titled “Post Quantum WireGuard, WireGuard v2, ongoing AI discoveries, and so forth”. It opens with “the recent chatter” about “mathematical advances via AI that might impact cryptographic security”. His only link is the NSA’s press release. He doesn’t name Anthropic, a paper or an algorithm.

The post has three parts. The stop-gap comes first. “WireGuard has a 256-bit pre-shared key option,” he writes. “If you can actually pre-share a key over a secure offline means, the security of the WireGuard protocol comes down to breaking that 256-bit ChaCha20 key, which isn’t going to happen, rather than any asymmetric primitive.”

Next come people who can’t hand over a key offline. They can “run a variety of PQ key exchanges”, or several combined, “through an established WireGuard tunnel, and then pop the result into the pre-shared key slot”. He adds that post-quantum “has come to implicitly stand in for ‘primitives that are not yet broken by AI'”, and that he believes “some VPN providers are already doing this”.

Then v2. He says it “is not an invitation to ‘let’s all design it in a mailing list thread'”, and that WireGuard is “designed around ‘versioned crypto'”, so the version can be incremented when primitives change. On the hard part, he’s frank:

“I should be frank though – it is certainly challenging (though hopefully not impossible) to come up with something really elegant that preserves all the properties we know and love about WireGuard, using the current crop of PQ crypto primitives. ECC was really in an ergonomic sweet spot, which we’ll have to move on from.”

Jason A. Donenfeld, WireGuard mailing list

He closes with “Cryptanalytic progress moves forward, and so will WireGuard.” He doesn’t say that Curve25519, the curve WireGuard uses today, is broken. He writes: “When things are broken (well, hopefully before things are broken), we’ll roll out new software”.

How the pre-shared key slot works

WireGuard’s handshake is built on Noise_IKpsk2 with Curve25519 for the key exchange, ChaCha20-Poly1305 for encryption and BLAKE2s for hashing. The protocol page says WireGuard “also supports an optional pre-shared key that is mixed into the public key cryptography”, and that when it isn’t in use the value “is assumed to be an all-zero string of 32 bytes”. The slot is always there. Leaving it empty means filling it with zeros.

The wg(8) man page describes PresharedKey as “an additional layer of symmetric-key cryptography to be mixed into the already existing public-key cryptography, for post-quantum resistance”, and wg genpsk makes one. It’s set for each peer. That’s the defence against the harvest-now, decrypt-later threat the NSA’s press release describes: someone records your traffic today and breaks the key exchange later, but still doesn’t hold the pre-shared key.

Four steps: quantum-safe key swap, shared secret, PSK slot, new handshake mixes it into the keys
The slot takes any 32-byte secret both ends hold. Illustration: Sulat.

What I ran

I wanted to see what the slot does when the key is right, wrong or changed. The VM is a 4-vCPU Intel Xeon at 2.10 GHz with 15 GiB of memory and a 252 GB virtual disk, running Ubuntu 24.04.5 on Linux 6.18.44. Its kernel has no WireGuard module, so I used the userspace implementation, wireguard-go 0.0.20230223, with wireguard-tools 1.0.20210914, both from Ubuntu’s packages. Two network namespaces were joined by a virtual Ethernet pair, with one WireGuard interface in each. Every number below is from that setup, not from the kernel module or a real network.

Code
wg genpsk > psk1
ip netns exec a wg set wga peer $PUB_B allowed-ips 10.9.0.2/32 endpoint 10.0.0.2:51820 preshared-key psk1
ip netns exec b wg set wgb peer $PUB_A allowed-ips 10.9.0.1/32 endpoint 10.0.0.1:51820 preshared-key psk1
ip netns exec a ping -c 3 10.9.0.2

For each case I removed and re-added the peer on both sides so the next packet had to start a fresh handshake, then sent three pings and read wg show for a recorded handshake. The keys were never printed.

PSK test results: none and matching keys connect; different keys and one-sided key give no handshake
Both ends must agree on the PSK, or there’s no handshake. Illustration: Sulat.
CasePings answeredHandshake recorded
No PSK on either side3 of 3Yes
Same PSK on both sides3 of 3Yes
Different PSKs on each side0 of 3No
PSK on one side only0 of 3No
PSK changed on one side of a running tunnel3 of 3Existing session kept
One run per case, two network namespaces on one VM.

Plan around the last row. Changing a PSK on a live tunnel didn’t touch the session already running, so traffic kept flowing. The new value only matters at the next handshake, and the protocol page says handshakes happen “every few minutes”. A half-finished roll-out, with one end updated and the other not, breaks the tunnel at the next rekey, not at the moment you type the command.

Then I checked what a PSK costs. I captured the handshake on the virtual link with tcpdump. The initiation was 148 bytes and the response 92 bytes, with and without a PSK, which fits the protocol page: the zero value is already mixed in when you don’t set one. For throughput I ran iperf3 through the tunnel for eight seconds, three times in each state and twice over. Without a PSK it ranged from 1,108 to 1,173 Mbit/s, and with one from 1,082 to 1,127 Mbit/s. In a smoke test of five runs each, the first ping, which includes the handshake, took 5 ms on average without a PSK and 6 ms with one.

WireGuard handshake sizes 148 and 92 bytes and about 1.1 Gbit/s, unchanged by a preshared key
The handshake is the same size with a PSK as without one. Illustration: Sulat.

I didn’t run a post-quantum key exchange into the slot. The VM’s OpenSSL is 3.0.13, which has no ML-KEM, so I tested the slot that Mullvad and NordVPN feed, not their exchange.

Why a v2 is harder than a version bump

WireGuard’s whole handshake is two small UDP packets, 148 bytes out and 92 bytes back, as my capture showed. Post-quantum key material is much bigger. FIPS 203 puts an ML-KEM-768 public key at 1,184 bytes and its ciphertext at 1,088 bytes. One public key is eight times WireGuard’s entire handshake start. In my TLS test for the NSA piece, a hybrid X25519 and ML-KEM-768 ClientHello was 1,446 bytes against 212 for X25519 alone.

ItemBytesSource
WireGuard handshake initiation148My capture
WireGuard handshake response92My capture
ML-KEM-768 public key1,184FIPS 203
ML-KEM-768 ciphertext1,088FIPS 203
A v2 handshake carrying post-quantum keys can’t stay this small.

There’s a second problem. The Noise IK pattern WireGuard uses leans on Diffie-Hellman between the two sides’ static keys, and a key encapsulation mechanism has no such operation. A 2020 research paper on post-quantum WireGuard replaced the Diffie-Hellman steps with key encapsulation only. That arithmetic and design background is mine, not Donenfeld’s. His own summary is shorter: ECC sat in an “ergonomic sweet spot” and the project has to move on from it.

What providers already do

Mullvad’s quantum-resistant tunnels use “post-quantum secure key encapsulation mechanisms for exchanging a pre-shared key for WireGuard”, with Classic McEliece and ML-KEM as the algorithms. Its January 2025 post made the feature the default on all desktop platforms and left mobile for later.

NordVPN does the same inside NordLynx. NordVPN’s Briedis told TechRadar: “Initially, we establish a standard WireGuard session and within this session, we perform a protocol-defined pre-shared key (PSK) exchange using ML-KEM.” Rosenpass is a separate open-source project that runs in parallel to WireGuard and injects its post-quantum shared secret into the pre-shared key interface, changing it about every two minutes.

Mullvad’s pairing of a code-based algorithm with a lattice one lines up with the advice from the Cryptography Incident Review Group, which I covered in the lattice piece: build hybrids on different mathematics.

Where this sits

Donenfeld’s post came the same day the NSA told national security system owners to speed up their move to post-quantum cryptography, and days after Anthropic’s lattice papers. Neither of those is about WireGuard’s current key exchange. Filippo Valsorda, in his reading of the advisory, argues that 256-bit elliptic curves, with Curve25519 and X25519 named, are “likely broken or significantly weaker than we thought”. That’s his interpretation and the NSA hasn’t said it. X25519 is WireGuard’s key exchange today, and Donenfeld’s post doesn’t say whether he shares Valsorda’s reading.

The post does settle the order of work. The stop-gap is available now and costs nothing on the wire. The replacement has no design yet, and its author has asked people not to design it on a mailing list.

What to do now

  1. If you run your own WireGuard peers and care about traffic recorded today, generate a PSK for each peer with wg genpsk and set it on both ends. Give each pair its own. A PSK shared across several peers lets any holder read another peer’s recorded traffic once the key exchange falls, which is my reading of how the slot works.
  2. Hand the PSK over offline, as Donenfeld describes, rather than sending it across the network.
  3. Update both ends together. A changed PSK on a live tunnel only bites at the next handshake, and a mismatch means no handshake at all.
  4. If you can’t pre-share keys, use a provider that already runs a post-quantum exchange into the slot, or run a tool such as Rosenpass beside WireGuard.
  5. Expect v2 to arrive as a software update on every peer, as Donenfeld describes, and keep the ability to update them. There’s no timeline.

Sources: WireGuard mailing list post; WireGuard protocol page; wg(8); NIST FIPS 203; Post-Quantum WireGuard paper; Mullvad; TechRadar on NordVPN; ArchWiki on Rosenpass; Filippo Valsorda.