WireGuard v2 Research Begins as Pre-Shared Keys Offer a Post-Quantum Option Today
The article's text, from Joho no Todai's page.
WireGuard has begun looking at new cryptographic designs in light of progress in AI-assisted mathematics. Its current protocol can strengthen traffic protection with a 256-bit pre-shared key and can work alongside external post-quantum key exchange.
WireGuard v2 research gets underway
On December 2 (UTC), WireGuard developer Jason A. Donenfeld said on the developer mailing list that research toward WireGuard v2 had begun.
He said the project was aware that advances in AI-assisted mathematics could affect the security of cryptography.
On December 2, U.S. time, the National Security Agency (NSA) recommended accelerating adoption of post-quantum cryptography for owners and operators of national security systems and their product and service providers. Donenfeld cited that recommendation at the end of the post.
The NSA said encrypted information was already being collected for possible decryption later. For communications that need to stay secret for a long time, waiting until the cryptography is broken carries risks.
A 256-bit pre-shared key in the current protocol
The current WireGuard protocol uses elliptic-curve Diffie–Hellman (ECDH) with Curve25519 to establish keys between peers, ChaCha20 to encrypt traffic, Poly1305 to authenticate it, and BLAKE2s for hashing.
The handshake and traffic encryption use different cryptographic algorithms. WireGuard establishes symmetric keys for sending and receiving data when peers connect and rotates those keys periodically.
The feature Donenfeld pointed to in the current version is a 256-bit pre-shared key (PSK). WireGuard can mix a secret shared by both peers ahead of time into its public-key handshake. WireGuard’s default configuration is not post-quantum, and the pre-shared key is configured as needed.
Donenfeld recommends distributing pre-shared keys through a secure offline channel. If a key is generated with unpredictable randomness and remains secret, it provides an additional secret to protect traffic even if the asymmetric cryptography is compromised.
Under the current protocol, the initiator’s long-term static public key is encrypted before the responder incorporates the pre-shared key into key derivation. The additional protection strengthens traffic confidentiality, while concealment of the static public key in the first handshake message still depends on conventional cryptography.
Using a pre-shared key therefore requires a plan for getting it safely to the other peer and managing it securely.
Adding an external post-quantum key exchange
If sharing the secret offline with a remote peer is impractical, Donenfeld also describes performing a post-quantum key exchange over an established WireGuard tunnel and configuring the resulting secret as the pre-shared key. He also considers combining multiple key exchange methods.
In 2023, VPN provider Mullvad announced stable support for quantum-resistant WireGuard tunnels. Its desktop app established a WireGuard connection, performed a post-quantum key exchange, and switched to a new connection that used the resulting secret as a pre-shared key.
In a December 4 reply to Donenfeld (UTC), another developer pointed to Rosenpass, existing software that adds post-quantum key exchange using WireGuard’s pre-shared keys. The reply recommended using the stable release because of an issue with the development version.
The existing pre-shared key feature lets users combine WireGuard with post-quantum key exchange before the protocol itself changes. They can strengthen traffic protection without waiting for v2. The added protection applies to traffic on connections that incorporate the pre-shared key. Earlier traffic keeps the encryption it originally used.
Can WireGuard retain its ease of use with new cryptography?
WireGuard ties its cryptographic choices to the protocol version. Donenfeld pointed to the benefit of being able to update the version and distribute new software when new cryptography is needed. Ideally, that can happen before the existing algorithms are broken.
The challenge, he said, is retaining WireGuard’s characteristics with the post-quantum technology available today. Elliptic-curve cryptography worked particularly well from a usability standpoint. The post announced the start of research toward a protocol update and did not specify algorithms, a protocol design, or a release date.
WireGuard today automates everything from the handshake to key rotation. If new cryptography can fit into that same workflow, users may be able to keep using it without having to relearn the process each time the algorithms change.
The ability to keep strengthening cryptography over time also has value. The hope for WireGuard v2 is that it can do so while remaining as straightforward for users as it is today.
