Information securityNetworks

WireGuard v2: the open source VPN gets ready for post-quantum cryptography and AI

WireGuard v2: the open source VPN gets ready for post-quantum cryptography and AI

Jason Donenfeld has confirmed that he has started looking into WireGuard v2. In the meantime, anyone running the current version can already do something.

On 2 December Jason Donenfeld, the creator of WireGuard, sent a fairly short message to the project's mailing list. It says three things in essence: the project is following what is happening in cryptography, an extra layer of protection is already available, and a second version of the protocol is being studied.

If you run VPNs it is worth reading slowly, because the most useful part is the one you can apply right away.

What happened

On the same day the NSA urged the operators and vendors of US national security systems to speed up their move to post-quantum cryptography immediately. The underlying fear is an old one: a powerful enough quantum computer could break the asymmetric algorithms we use every day to exchange keys.

This time there is a second reason, and it is the one Donenfeld puts at the centre of his email: mathematical advances made with artificial intelligence. Some AI labs have told the US government about discoveries that affect the security of part of the cryptography in use. According to a joint statement by the NSA, CISA and the Office of the National Cyber Director there is no "immediate and widespread threat", but it is time to get moving.

Then there is an awkward detail. A few days earlier Anthropic had disclosed a result that partly weakens the maths behind ML-KEM and ML-DSA, two of the post-quantum standards everyone is migrating to. It is not a practical attack, and the advice is still to carry on with the transition. Donenfeld jokes about it: "post-quantum", he writes, has now come to stand for "not yet broken by AI".

The pre-shared key that is already there

WireGuard uses the Curve25519 elliptic curve to exchange keys. That is the part exposed to a future quantum attack, and the project's documentation says so openly: by default, WireGuard is not post-quantum secure.

The protocol has long accepted an optional 256-bit pre-shared key (PSK), though, which is mixed into the asymmetric exchange. If the two sides have shared it by secure, offline means, anyone trying to decrypt the traffic would also have to break a 256-bit symmetric ChaCha20 key. Which, in Donenfeld's words, "isn't going to happen".

In practice you generate a key with wg genpsk and put it under PresharedKey in the [Peer] section, identical on both ends of the tunnel. A few things to watch:

  • use a different key for each pair of peers, not a single one for the whole network;
  • set it on both ends, otherwise the tunnel will stop coming up;
  • sending it by email or chat throws away much of the benefit;
  • it protects traffic from that moment on, not what someone may already have recorded.

That last point matters more than it seems. Someone collecting encrypted traffic today in the hope of reading it in ten years does not need a quantum computer now. If what goes through your VPN has to stay confidential for a long time, waiting has a cost.

When you cannot hand the key over in person

With three offices it takes an afternoon. With hundreds of clients it is a different job altogether.

For those cases Donenfeld suggests using an established WireGuard tunnel to run a post-quantum key exchange inside it, or even several of them combined, and putting the result into the pre-shared key slot. He believes some VPN providers are already doing this.

Combining several algorithms is sensible caution, especially after this week's news: if one turned out to be weak, the others would still be standing.

In the same thread Karolin Varner pointed out that there is also Rosenpass, an open source project that takes exactly this route. The advice is to use the stable release, because the development branch has had some issues lately.

What we know about WireGuard v2

Not much, for now. Donenfeld writes that he has already begun investigating an update to the protocol, and makes it clear that this is not an invitation to design it together in a mailing list thread. There are no specifications and no dates.

The direction can be guessed from the way WireGuard is built, though. Other protocols let client and server negotiate algorithms from a long list, with all the complications and configuration mistakes that follow. WireGuard chose a fixed set, tied to the version. When something breaks, or better still just before it does, you move to the next version.

The hard part will be doing it without losing what made WireGuard so popular: little code, simple configuration and excellent performance. Elliptic curves were an almost ideal compromise, with small keys and fast computation. Today's post-quantum algorithms have much bulkier keys and messages, and fitting everything into such a compact exchange is no small feat. Donenfeld himself calls it challenging, "though hopefully not impossible".

What to do now

There is no reason to switch off your VPNs, and nobody has announced that WireGuard has been broken. I would do three things: list the active tunnels, noting which ones carry data that must stay confidential for years, then add a pre-shared key starting with those, and finally keep an eye on updates, because the move to v2 will have to be planned on every device, routers included.

That may be the most delicate point. A Linux server is updated in minutes, a network appliance stuck on five year old firmware is not. Anyone buying devices today that are meant to last should ask the vendor how long they will be updated.

Cryptography has never been a choice you make once and for all. WireGuard planned for that from the start, and now we will see how well the idea holds up in practice.

Sources

Geschrieben von Claudio