Skip to main content

WireGuard builds secure private connections between devices by combining several cryptographic building blocks, called primitives.

To build a WireGuard tunnel, each device needs a key pair (a private key it keeps secret, and a public key it can send to others) based on the Curve25519 primitive.

To keep the explanation simple, each device takes the other one’s public key, mixes it with its own private key, adds specific maths to the mix, and shakes vigorously to create the actual tunnel keys.

Keeping its own private key actually private is crucial to the security of the tunnel. If a spy could work out a private key from a public one, they could enter the tunnel and see what is sent through it.

The NSA’s December 2 advisory tells operators of national security systems to flag every elliptic curve except P-384 and P-521, which would include Curve25519. Cryptography engineer Filippo Valsorda reads this as a sign it may be breakable with ordinary computers, well before large quantum computers exist. In any case, there is a strong push in the security community to move towards post-quantum algorithms wherever data transits.

To make up for Curve25519’s potential weakness, WireGuard needs to replace the key-pair algorithm with a post-quantum alternative.

But WireGuard hardcodes which primitives it uses, and devices can’t choose different ones. Just swapping Curve25519 for a post-quantum algorithm wouldn’t work: post-quantum algorithms work differently and use much larger keys, which are hard to fit in WireGuard’s small handshake packets.

The fix is a proper new version of the protocol, which its creator Jason Donenfeld has announced is in the works.

In the meantime, you can add a pre-shared key on your tunnels to make them resistant to a Curve25519 break, by following WireGuard’s docs.

Join the discussion