Back to Networking Knowledge Hub

NetBird Is Getting Built-in Post-Quantum Key Exchange

NetBird is adding a hybrid X25519 + ML-KEM-1024 key exchange that fills the WireGuard preshared key, making tunnels resistant to harvest now, decrypt later.

On December 2, 2026, three US agencies published a joint statement on recent advances in cryptographic capabilities. It says the transition to post-quantum cryptography is being accelerated.

Reading between the lines, the statement suggests that recent AI models may have made progress on some of the hard math problems that algorithms like RSA and elliptic curves depend on. These algorithms protect most encrypted traffic on the internet today, and they were chosen because those problems were considered practically unsolvable without a quantum computer.

Even if nothing is broken today, encrypted traffic can be recorded and stored, then decrypted years later once the cryptography fails. Moving to post-quantum cryptography, which uses math designed to resist these attacks, closes that window early.

In response, we are accelerating our work as well. We are adding built-in post-quantum key exchange to NetBird, based on ML-KEM, the post-quantum key exchange that NIST standardized as FIPS 203. The work is in pull request #7098 in our public repository.

The PR is still open and undergoing an external audit, and it is not merged yet.

How a key exchange works

Two peers cannot send data to each other until they agree on a key. This process is called a key exchange. Each peer has a key pair: a secret private key and a public key that they can share.

The two peers send each other their public keys. Then, they each compute the shared secret by combining their private key with the other peer's public key. They end up with the same secret without having to send it. This secret is used to encrypt traffic between the two peers.

Computing the secret from only the public keys means solving a hard math problem. It was designed so that the problem is very hard for computers today and would take a thousand years or more to solve.

WireGuard by itself doesn't use post-quantum cryptography for key exchange. It uses Curve25519, an elliptic curve. Such a problem could be solved far faster with a quantum computer large enough to do it.

What a post-quantum key exchange protects

If the current algorithms used to encrypt data are broken in the future, tunnel traffic recorded today can be decrypted, which is the harvest now, decrypt later risk.

To address this, WireGuard has an optional preshared key that can be used with tunnel encryption to make it post-quantum resistant. A post-quantum key exchange fills that preshared key with a secret that stays safe. A static preshared key is not enough on its own: if it is ever broken, traffic stored today can still be decrypted later, so the key has to keep changing.

Preshared keys in NetBird today

Preshared keys are nothing new, NetBird supports them already. You can set one when connecting a peer:

After that, only peers with the same key can communicate.

The problem is that you have to manually set the key on every client and then go and change the key if you want to change it. The new key exchange is the automated version of this. Each pair of peers will have its own key, which will rotate without you having to do any of the work.

What is already post-quantum today

The new key exchange is for the WireGuard tunnels between peers. The TLS connections to the management, signal, relay, and reverse proxy services are a separate layer.

These services are built with Go, and Go's TLS stack uses the hybrid X25519 + ML-KEM-768 key exchange by default since Go 1.24. So the protection arrived with the Go version each NetBird release was built with:

NetBird releaseBuilt withPost-quantum key exchange in TLS
Up to v0.29.1Go 1.21None
v0.29.2 to v0.60.0 (Sep 2024 to Nov 2025)Go 1.23Pre-standard Kyber draft only
v0.60.3 and later (Nov 2025)Go 1.24ML-KEM
v0.78.0 and later (Sep 2026)Go 1.26ML-KEM, plus the two newer variants

Two things to keep in mind. The key exchange is only as strong as the older side of a connection: a client built before NetBird v0.60.3 offers at most the pre-standard Kyber draft, so its TLS connections fall back accordingly. And in self-hosted deployments where a reverse proxy terminates TLS in front of these services, the proxy decides the key exchange, not NetBird.

So recorded client-to-server traffic has been protected against harvest now, decrypt later for a while. The tunnels that carry your actual data between peers are the missing piece, and that is what the new key exchange adds.

How the new key exchange works

Peers exchange a hybrid key. It means the key will stay safe as long as one of the two stays safe. The hybrid key uses both X25519 (classical) and ML-KEM-1024 (post-quantum).

The exchange is done on Signal offer and answer messages that peers use to start a connection. These messages are already authenticated, so a new channel is not needed to exchange the first key.

Both shared secrets are passed through HKDF-SHA256. Then the resulting key is used as a WireGuard preshared key. This key is only for two peers, for that one exchange, and cannot be used for another pair.

The key is ready before the first WireGuard handshake. Afterward, keys are rotated over the tunnel itself in line with the WireGuard rekey. If the tunnel is idle, it stops rotating, so it can stay idle.

One exchange is about 2.3 KB on the wire.

Opt-in, with a strict mode

Once the feature is released, it will be opt-in and in the experimental mode. You can turn it on with this environment variable:

In the non-strict mode, a tunnel starts classically first, and then switches to the post-quantum key when it is ready. If a peer does not support the key exchange, it is still connected via classical tunnel.

In strict mode, there is another environment variable, , and it blocks all traffic to a peer until the post-quantum key is in place.

Do note that these variables are not a documented setting yet. Documentation will follow once the feature stops being opt-in.

Standards and compliance

ML-KEM is the NIST standard for post-quantum key exchange. It was published as FIPS 203. The algorithms for key derivation and signing are HKDF-SHA256 and HMAC-SHA256, respectively. Both are NIST-approved.

We already have support for post-quantum cryptography in the form of Rosenpass. However, Rosenpass uses algorithms that are not yet finalized by NIST, so the new exchange is closer to standards. Rosenpass support in NetBird is deprecated since v0.82.0, and it keeps working, but the new exchange is planned as its replacement, and the two cannot run at the same time.

While NIS2 doesn't require specific algorithms, having the post-quantum cryptography standardized helps to show state of the art security.

Open source

The implementation will be open source, just like the rest of NetBird, developed in public.

We are fully committed to open source and believe security features need to be open source too.

We always welcome comments in Discord, Reddit, or GitHub.

Start self-hosting NetBird today.