Library · |post-quantum⟩ The quantum-safe fix

Hybrid key exchange in TLS, SSH and VPNs

Why classical and post-quantum key exchange are combined, how X25519MLKEM768 works, what is already deployed, and how to test it.

Key exchange is the part of a connection that has to be fixed first. An attacker who records encrypted traffic today can store it and decrypt it later if the key exchange falls to a quantum computer. Signatures are different. A forged signature has to be made while the session is live, so signature migration can follow once the hardware exists.

The industry answer for key exchange is a hybrid, and it is already in production at scale. If your staff open a bank portal in a current browser, the connection very probably uses one. This article explains what a hybrid is, why it exists, what it costs on the wire, where it is deployed, and how to check your own systems.

Why combine two key exchanges

ML-KEM, standardised by NIST as FIPS 203 in August 2024, is new.[1] It has had a decade of public scrutiny as Kyber, and no known quantum or classical attack. Even so, the cryptographic record contains cautionary tales. SIKE reached the fourth round of the NIST process and was broken on a laptop in about an hour in 2022.[7] A scheme can look sound for years and then fall to a new idea.

X25519 has the opposite profile. It has been analysed for nearly two decades and is trusted against every classical attacker, but a large quantum computer running Shor's algorithm would break it. Each algorithm covers the other's weak point.

A hybrid computes both exchanges, then combines the two shared secrets so that the session key stays secret if either exchange holds. Against a classical attacker today, the security rests on X25519 at least. Against a future quantum attacker, it rests on ML-KEM. If someone finds a flaw in ML-KEM's lattice assumptions, X25519 still protects against everyone who lacks a quantum computer. The design costs some bytes and a little computation, and it removes the need to bet on a single new scheme.

Some governments take a different line. The NSA's CNSA 2.0 suite names ML-KEM-1024 on its own rather than a hybrid.[8] Europe's security agencies have generally preferred hybrids during the transition. Both positions are rational given different threat models, and both are visible in products. Most commercial deployments, including all the browser traffic, use the hybrid.

How TLS 1.3 key shares work

In TLS 1.3 the client does not wait to be told which key exchange to use. It guesses, and sends its public value for the guess in the first message. Each public value is called a key share and is labelled with a named group, a two-byte identifier. The ClientHello also lists every group the client supports, in preference order.

The server picks a group, and if it holds a matching key share it replies with its own public value in the ServerHello. Both sides derive the same shared secret and feed it into the TLS 1.3 key schedule, a chain of HKDF extract and expand steps that produces the handshake and traffic keys. If the server supports a group the client listed but did not send a share for, it sends a HelloRetryRequest and the client tries again. That costs a round trip.

With classic elliptic-curve Diffie–Hellman the key share is 32 bytes for X25519. With a key-encapsulation mechanism (KEM) such as ML-KEM, the roles differ slightly. The client generates a key pair and sends the public encapsulation key. The server uses it to produce a random secret and a ciphertext, and returns the ciphertext. The client decapsulates the ciphertext with its private key and recovers the same secret. From the point of view of TLS, the encapsulation key sits in the client's key share and the ciphertext sits in the server's key share. The protocol shape does not change.

What X25519MLKEM768 does

X25519MLKEM768 is a named group with the IANA codepoint 0x11EC, specified in an IETF draft from the TLS working group.[2] It simply concatenates the two exchanges inside one key share.

  • The client key share is the ML-KEM-768 encapsulation key (1,184 bytes) followed by the X25519 public key (32 bytes), 1,216 bytes in all.[1][2]
  • The server key share is the ML-KEM-768 ciphertext (1,088 bytes) followed by its X25519 public key (32 bytes), 1,120 bytes in all.
  • The shared secret is the 32-byte ML-KEM secret concatenated with the 32-byte X25519 secret, 64 bytes, and this goes into the TLS 1.3 key schedule where a plain Diffie–Hellman result would normally go.

The draft puts the ML-KEM part first in both shares and in the secret. Implementers need to get that order right, and interoperability tests with other libraries are the usual way to catch mistakes. The earlier experimental group, X25519Kyber768, used the opposite order and a pre-standard version of Kyber, so the two are not compatible. Chrome replaced the experimental group with X25519MLKEM768 in version 131, released in November 2024.

The key schedule hashes the concatenated secret, so no one needs a special combiner. The result is safe if at least one of the two component secrets is unpredictable to the attacker, which is the property a hybrid needs. The ML-KEM-768 parameter set sits at NIST category 3, and the security margin of the ML-KEM part is therefore well above the 128-bit classical level of X25519.

X25519

classical secret · falls on Q-day

ML-KEM-768

post-quantum secret · newer mathematics

key derivation

both secrets mixed with a hash

session key

still secret

Hybrid key exchange: an attacker must break both the classical and the post-quantum exchange.

Try it: follow the two exchanges, see the secrets joined, and watch the key derivation produce one session key.

What it costs on the wire

The extra bytes are the main cost. A typical TLS 1.3 ClientHello from a browser is a few hundred bytes plus any extensions. Adding a 1,216-byte hybrid key share makes it larger than the roughly 1,500-byte limit of a standard Ethernet packet. The ClientHello will usually now span two TCP segments, or in QUIC, more than one Initial packet. The server's reply grows by about 1.1 KB.

Computation is not the concern. ML-KEM key generation, encapsulation and decapsulation are fast, in the same broad range as elliptic-curve operations on current hardware. Handshake latency changes mainly because of the extra packets, and for most users the difference is small.

Key share sizes for common TLS 1.3 groups (bytes)
GroupClient shareServer shareBasis
X255193232Classical elliptic curve
ML-KEM-768 alone1,1841,088FIPS 203, category 3
X25519MLKEM7681,2161,120ML-KEM-768 share plus X25519 share
ML-KEM-1024 alone1,5681,568FIPS 203, category 5

The larger hello creates three practical problems.

Middleboxes that expect one packet

Some firewalls, intrusion-prevention systems, TLS inspection proxies and load balancers parse the ClientHello from the first packet only. When the hello is split, they either drop it or stall the connection. Years of unusually small hellos taught some vendors that this was safe. Reports of this kind of failure appeared when Chrome first enabled a hybrid group, and they have fallen as vendors patched, but old appliances remain in many enterprises.

Unknown groups

A device that sees a group it does not know may reject the handshake instead of ignoring it. Servers are supposed to skip unknown groups. Not all do. Where a server cannot cope, a client that supports fallback retries without the hybrid group, and the connection works but is no longer quantum-resistant. That silent downgrade is the reason to measure what your clients actually negotiate and not what they could negotiate.

Fixed-size buffers and logging

Fingerprinting tools, web application firewalls and logging pipelines sometimes assume hellos fit inside a fixed buffer. Larger hellos can truncate those records, and security teams may lose fields they rely on for detection.

What is deployed as of mid-2026

The QSC knowledge base tracks these items with an as-of date; see the readiness tracker for the current view. The picture as of mid-2026 is as follows.

Hybrid key exchange support, as of mid-2026
ProductSupportNotes
ChromeX25519MLKEM768 by defaultSince version 131, November 2024; replaced X25519Kyber768
Firefox, CloudflareX25519MLKEM768Current releases; Cloudflare offers it to visitors and to origins.
OpenSSLDefault key share from 3.5.0April 2025; also ML-KEM, ML-DSA and SLH-DSA primitives
GoDefault in crypto/tls from 1.24February 2025; crypto/mlkem package
OpenSSHmlkem768x25519-sha256 from 9.9, default from 10.0sntrup761x25519-sha512 default since 9.0 (April 2022)
BoringSSL, AWS-LC, rustlsAvailableMedium confidence in the QSC knowledge base; verify your build
JavaML-KEM API in JDK 24TLS hybrid groups arrive in a later JDK; verify the release you run

These sources are the projects' own documentation.[3][5][4][9] The practical consequence is that a modern browser talking to a server on OpenSSL 3.5 or a recent CDN negotiates a hybrid without anyone configuring anything. Servers on older OpenSSL, older Java stacks, and many appliances do not yet offer it, so clients quietly fall back to X25519 alone.

SSH

SSH moved earlier than TLS. OpenSSH 9.0, released in April 2022, made sntrup761x25519-sha512 its default key exchange. That algorithm pairs X25519 with Streamlined NTRU Prime, a lattice scheme that was not selected by NIST. OpenSSH 9.9 added mlkem768x25519-sha256 in September 2024, and OpenSSH 10.0 made it the default in April 2025.[4]

Construction is similar to TLS: an X25519 exchange and an ML-KEM-768 exchange, with both secrets hashed together into the key. Because most SSH key exchanges are negotiated between a client and a server both running OpenSSH, deployment is easier. The practical question is which versions your estate runs. Jump hosts, network devices, mainframe SSH daemons and file-transfer products often run old or vendor-specific implementations that offer only classical algorithms.

Two limits matter. First, only key exchange is protected. Host keys and user keys are still RSA, ECDSA or Ed25519, so an attacker with a quantum computer could impersonate a server in the future, though not decrypt old recordings. Second, a server that lists a hybrid algorithm does not force clients to use it. Check what is configured and what is chosen.

IKEv2 and VPNs

IPsec VPNs use IKEv2 to agree keys. RFC 9370, published in May 2023, extends IKEv2 so that two peers can run additional key exchanges after the first one, and mix the results into the keys.[6] The classical Diffie–Hellman exchange stays and a post-quantum exchange such as ML-KEM is added, which is a hybrid in a different shape. The standard supports several additional exchanges, and it relies on an intermediate IKE exchange so that large key shares do not hit fragmentation problems in the first messages.

For many banks the VPN estate is where the first migration decision lies. Gateway vendors have to ship the feature, and both ends of every tunnel must support it. CNSA 2.0 gives traditional networking equipment, including VPNs and routers, an earlier timeline than most other categories: support and prefer by 2026, use exclusively by 2030.[8] If you buy network equipment, ask vendors what they support today and which RFC they implement.

Where a gateway cannot be upgraded yet, a pre-shared key mixed into IKEv2 or WireGuard adds a symmetric layer that a quantum computer does not break. It is operationally heavier because every pair of peers needs a secret, but it can be a bridge for a small number of high-value tunnels.

How to test your own endpoints

Start with what a server will negotiate. With OpenSSL 3.5 or later on your workstation, ask for the hybrid group only:

Ask a server for the hybrid group
openssl s_client -connect host.example.com:443 -groups X25519MLKEM768 </dev/null

If the handshake completes, the output reports the negotiated group, and the server supports the hybrid. If it fails with a handshake error, the server either lacks the group or a device in the path dislikes it. Repeat with -groups X25519 to tell the two cases apart. A success on X25519 only and a failure on the hybrid points to a server or a middlebox.

For SSH, list what your local client supports, then probe a host:

SSH key exchange algorithms
ssh -Q kex | grep -E 'mlkem|sntrup'
ssh -v user@host.example.com 2>&1 | grep -i 'kex: algorithm'

On the server side, enable the hybrid in nginx by listing it first and keeping a classical fallback. This needs nginx built against OpenSSL 3.5 or later:

nginx
ssl_protocols TLSv1.3 TLSv1.2;
ssl_ecdh_curve X25519MLKEM768:X25519;

To check many endpoints at once from inside your network, qsc scan --target host:443 performs a live handshake probe and reports the negotiated group, the protocol version and the certificate chain. ssh://host works the same way for SSH. The probe is read-only and the results can go into the CBOM output, so the same data supports the inventory and the migration plan. qsc fix proposes safe configuration patches for common TLS and SSH servers.

Common pitfalls

  • TLS 1.2 stays classical. The hybrid group exists only in TLS 1.3. Servers and appliances that still negotiate TLS 1.2 for older clients give those clients no post-quantum protection.
  • Termination hides the truth. If a load balancer or CDN terminates TLS, the client sees the edge, and the hop from the edge to your origin is a separate connection with its own key exchange. Test both hops.
  • Inspection proxies. A proxy that decrypts and re-encrypts traffic negotiates its own session on each side. Its capabilities decide what is protected, whatever the browser supports.
  • Library versions hide in containers. An application may run on a base image with an older OpenSSL than the host. Scan images as well as hosts.
  • Pinned fingerprints change. Systems that match on a hash of the ClientHello will see new values. Update the rules.
  • Authentication is still classical. A hybrid handshake with an RSA or ECDSA certificate protects confidentiality only. Plan for the certificate side separately.
  • Silent fallback. Measure the negotiated group in real traffic, not only in a lab test.

Hybrid and composite signatures

Signatures are less urgent but they follow the same logic, and the IETF is still defining the details. Two approaches are under discussion. A composite signature combines a classical and a post-quantum algorithm into one signature and one key, and a verifier accepts only if both parts verify. A dual or alternative certificate approach carries the second key and signature as extensions in a normal certificate, so old software ignores them and new software can check both.

The IETF LAMPS working group is working on both, and ML-DSA for X.509 is standardised there, while the composite documents are drafts.[10] Treat any composite format you see in a product today as subject to change. For key exchange the standardisation picture is simpler, because the hybrid group is already widespread. For signatures, many organisations will choose a pure ML-DSA certificate in a private PKI, where they control both ends, and wait for the public web to settle.

What to do now

  1. Measure. Run qsc scan --target against your internet-facing hosts, then your internal load balancers and gateways. Note which negotiate X25519MLKEM768 and which do not.
  2. Upgrade the easy ones. Servers on OpenSSL 3.5 or later, Go 1.24 or later and OpenSSH 10.0 or later negotiate hybrids with default settings. Container base images are often the quickest fix.
  3. Find the blockers. For each endpoint that fails, find out whether the cause is the server, a middlebox or a vendor product. Record an owner and a target date. Use the readiness tracker to see which vendors have shipped support.
  4. Keep a baseline. Save a scan with --baseline, then re-scan after each change with --fail-on in CI so a regression to classical-only fails a build.
  5. Plan the certificate side. Decide which internal PKIs can adopt ML-DSA first, and ask vendors about composite certificate roadmaps.

Related reading: Harvest now, decrypt later explains why key exchange comes first. Choosing post-quantum algorithms covers parameter sets and certificates. The NIST post-quantum standards describes ML-KEM itself, and the migration playbook shows where this step fits in the programme.

Sources

  1. NIST. FIPS 203: Module-Lattice-Based Key-Encapsulation Mechanism Standard. 2024-08-13. https://csrc.nist.gov/pubs/fips/203/final
  2. IETF TLS Working Group. Post-quantum hybrid ECDHE-MLKEM key agreement for TLSv1.3 (draft-ietf-tls-ecdhe-mlkem). Internet-Draft, in progress. https://datatracker.ietf.org/doc/draft-ietf-tls-ecdhe-mlkem/
  3. OpenSSL Project. OpenSSL 3.5 release notes. April 2025. https://openssl-library.org/news/openssl-3.5-notes/
  4. OpenSSH Project. OpenSSH release notes (9.0, 9.9 and 10.0). https://www.openssh.com/releasenotes.html
  5. The Go Project. Go 1.24 release notes. February 2025. https://go.dev/doc/go1.24
  6. IETF. RFC 9370: Multiple Key Exchanges in the Internet Key Exchange Protocol Version 2 (IKEv2). May 2023.
  7. Castryck and Decru. An efficient key recovery attack on SIDH (SIKE). July 2022. https://eprint.iacr.org/2022/975
  8. NSA. Announcing the Commercial National Security Algorithm Suite 2.0. September 2022. https://media.defense.gov/2022/Sep/07/2003071834/-1/-1/0/CSA_CNSA_2.0_ALGORITHMS_.PDF
  9. Cloudflare. Post-quantum cryptography at Cloudflare. https://developers.cloudflare.com/ssl/post-quantum-cryptography/
  10. IETF. IETF LAMPS working group documents (ML-DSA in X.509, composite signature drafts). https://datatracker.ietf.org/wg/lamps/documents/