SSH gets three hybrid post-quantum key exchanges in RFC 10042

In short

3 hybrid key-exchange methods defined; 32 / 48 bytes fixed length of the classical secret (32 for Curve25519 and P-256, 48 for P-384); 32,768 bytes payload every SSH implementation must handle, with 35,000 bytes total per packet

Why could someone decrypt SSH sessions they recorded?

SSH's current key exchange uses elliptic-curve Diffie-Hellman (ECDH), whose security relies on certain discrete-logarithm problems being too hard to solve. The RFC says that if "sufficiently large quantum computers become available", those problems would no longer be infeasible. It adds that such computers are "not available today", but an adversary could record an encrypted SSH session now and decrypt it later. It calls this a "harvest now, decrypt later" attack.

Our plain-English reading: the long-term risk is to the session key agreed during the handshake, because anyone who captured the traffic can attack it at leisure. That is why the fix goes into the key exchange.

What is new: two exchanges, one key

A key-encapsulation mechanism (KEM) is the post-quantum counterpart of a Diffie-Hellman exchange. The RFC describes it as three steps: KeyGen makes a public and a secret key, Encaps uses the public key to produce a ciphertext and a shared secret, and Decaps uses the secret key to recover the same secret from the ciphertext. The KEM used is ML-KEM, standardised in 2024 as FIPS 203 in three sizes (512, 768 and 1024). RFC 10042 uses 768 and 1024.

In the hybrid, the client sends one message that holds an ML-KEM public key and an ECDH public key joined together. The server replies with an ML-KEM ciphertext and its own ECDH public key. Both sides then hold two secrets, K_PQ from ML-KEM and K_CL from ECDH. The server must check the length of the client's message and the ML-KEM public key, and the client must check the length of the reply. If a check fails, the connection is dropped with a key-exchange-failed disconnect.

Each connection must use fresh ECDH and ML-KEM key pairs, and implementations must not reuse randomness when making ML-KEM ciphertexts.

How does SSH combine the two secrets into one key?

The session secret is the hash of both secrets side by side: K = HASH(K_PQ || K_CL), where || means concatenation. An attacker would have to learn both parts. The security proofs the RFC cites are for such hybrids; it says the version here can be shown IND-CPA secure if the hash acts as a key-derivation function, and IND-CCA2 secure only if the hash is treated as a random oracle, "a stronger assumption", especially for SHA-2.

The RFC says this is "similar, but not the same (for efficiency)" as TLS 1.3 in RFC 9954. There, the two secrets are concatenated and fed into the key schedule. In SSH they are concatenated and hashed first, before SSH's existing key derivation.

A detail with a security reason: SSH traditionally encoded the ECDH secret as an integer (an "mpint"), whose length can vary. RFC 10042 re-encodes it as a fixed-length, big-endian byte array, 32 bytes for Curve25519 and secp256r1 and 48 bytes for secp384r1. The RFC says variable-length encodings can leak information through timing and cites the Lucky Thirteen and Raccoon attacks as examples.

The authors weighed other combiners in Appendix A, including HMAC-based and HKDF-based options, and chose the plain hash. They say proper extract-and-expand key derivation would be a good move for SSH but "should be a separate effort". The RFC also notes that X25519 is generally easier to implement without side channels than the NIST curves, while NIST curves are sometimes preferred for regulatory compliance. Appendix B says the combiner "appears to be FIPS-approved although it is not specifically called out" in NIST SP 800-227.

Message size

The ML-KEM keys and ciphertexts are larger than elliptic-curve keys. Section 3 says SSH implementations must support payloads up to 32,768 bytes and 35,000 bytes in total per packet. The RFC defines no method that would exceed these limits, so it adds no new behaviour for oversized packets. (We did not look for the sizes of the hybrid messages; the RFC does not state them.)

Terms in plain English

Where things stand

RFC 10042 is Informational. IANA has registered the three method names. The RFC says its message abstraction, key derivation and hash input align with RFC 9941, which defines an SSH exchange built on a different post-quantum KEM. We did not look at which SSH software supports the new methods, and we found no later primary source that changes this account. The RFC and the RFC Editor page give only "August 2026", so this story uses the start of the month.

Sources

Sources

Related stories

More from Wi-Fi Wizards

All stories from Wi-Fi Wizards