← Back to section · Digital Security
Post-Quantum Key Exchange in SSH: How Hybrid Designs Defeat Harvest-Now-Decrypt-Later
Starting from the harvest-now-decrypt-later threat model, this article dissects the construction logic of the sntrup761x25519 and mlkem768x25519 hybrid key exchanges: why key exchange migrates before authentication, and the two-way insurance semantics of hybrid designs.
A Difference in Time: Why Key Exchange Moves First
Any discussion of SSH’s post-quantum migration has to start by separating two very different kinds of time risk. Key exchange protects sessions that have already happened: an attacker can record complete SSH handshakes and encrypted traffic off the network today, warehouse them, and decrypt them years later once a sufficiently powerful quantum computer exists — harvest now, decrypt later. This attack requires no quantum capability today at all; it only requires cheap storage and data whose confidentiality horizon is long enough.
Authentication faces the opposite risk: forging a signature requires the attacker to break the signature algorithm at the moment the connection happens. Yesterday’s connections cannot be retroactively forged by tomorrow’s quantum computer — the session is over, and the historical fact of authentication cannot be rewritten. The migration order is therefore naturally asymmetric: key exchange is a debt owed to time — don’t repay it today and you repay it with interest tomorrow; authentication migration matters just as much, but its window is bounded by “when quantum computers actually work.”
That is exactly the logic behind OpenSSH’s evolution: key exchange first — and it has already been swapped twice.
Two Generations of Defaults: From NTRU Prime to ML-KEM
OpenSSH 9.0 (2022) changed the default key exchange to sntrup761x25519-sha512@openssh.com. It is a hybrid: on one side, Streamlined NTRU Prime (parameter set 761), a lattice-based key encapsulation mechanism; on the other, classical X25519 elliptic-curve Diffie–Hellman. NTRU Prime was chosen because it does not rely on ring structure, is conservatively designed, and had an independent history of academic scrutiny outside the NIST process — before the ML-KEM standard was finalised, it was the lowest-risk option available.
OpenSSH 10.0 (2025) moved the default again, to mlkem768x25519-sha256: the post-quantum component became ML-KEM-768, standardised as NIST FIPS 203, while the classical component remained X25519. sntrup761 was not removed and can still be selected explicitly; the change of default reflects the standardisation landscape settling, not a problem with the older algorithm.
Two details deserve attention. First, both defaults kept X25519 — the hybrid is deliberate, not a case of “haven’t gotten around to removing the classical part.” Second, the @openssh.com suffix marks these as OpenSSH vendor extensions: hybrid key exchange still has no unified cross-implementation standard name at the SSH protocol layer, so interoperability between implementations (OpenSSH, various libraries, other servers) depends on each implementing the same construction.
The Internal Logic of Hybrid Construction
A hybrid key exchange is not complicated to run: both sides execute two key exchanges in parallel, each yielding a shared secret, and then feed both secrets together into the session-key derivation via a hash function. SSH’s exchange hash already folds key-exchange output into the session identifier computation; the hybrid construction simply puts both components into that chain.
The security semantics change accordingly: the session key is as strong as the stronger of the two components. To decrypt a recorded session, an attacker must break both X25519 (requiring a quantum computer or a breakthrough in elliptic-curve cryptanalysis) and the post-quantum KEM (requiring a breakthrough in lattice cryptanalysis). This is a two-way hedge:
- If quantum computers mature, the classical component fails but the post-quantum component still seals the session;
- If a post-quantum algorithm turns out to have a classical weakness (there is precedent: candidate algorithms have been felled by classical attacks mid-standardisation), the classical component still stands.
In other words, the hybrid design admits a fact: we have no absolute confidence in the long-term security of either side, so we make the attacker win both.
The Practical Boundaries of Migration
Three things hybrid key exchange cannot do, and they need separate attention. First, it only protects sessions that actually negotiate it: if the peer is too old and negotiation silently falls back to a purely classical algorithm, the protection does not exist — which is why version inventory and algorithm-list governance remain part of the migration, not optional extras. Second, it provides nothing beyond its scope: if host keys or long-term user authentication keys are stolen, the impersonation risk is unrelated to key exchange. Third, recorded risk cannot be retroactively eliminated: traffic from past sessions established with purely classical algorithms, if recorded, gains nothing from upgrading now — which is precisely why every year of delay in key-exchange migration adds a year of unprotected backlog.
Seen at the system level, SSH’s post-quantum story offers a template for other protocols: sort migration targets by “time risk” first, hedge old and new algorithms against each other with hybrid constructions, and accept interoperability fragmentation as a transitional cost. TLS hybrid key exchange and post-quantum pre-shared keys in various VPNs are different implementations of the same logic.
Negotiation and Downgrade: Protection Exists Only When Negotiation Succeeds
Hybrid key exchange has an easily overlooked precondition: it must first win the handshake negotiation. SSH key exchange takes each side’s algorithm list and picks the first common entry. If the peer is old enough that its list contains no hybrid algorithm, the connection silently falls back to a purely classical one — no error, the connection establishes as usual, only the harvest-now-decrypt-later protection is absent. This means migration completeness cannot be measured by “we upgraded our side”; it must be measured by “what actually got negotiated.”
The system-level response has three steps. First, inventory your peers: which machines yours connect to as clients, which connect to yours as servers, what the version distribution looks like, and which are stuck in an era without hybrid algorithms. Second, tighten the list on the side you control: for links with long confidentiality horizons and high value, make hybrid algorithms the only permitted key exchange — better that an old peer cannot connect than that it silently downgrades. A failed connection is loud; a downgrade is silent, and the former is far safer than the latter. Third, fold negotiation results into routine checks: server logs and client debug output both show the algorithm name finally negotiated; periodically sampling the actual share of hybrid negotiations gives migration progress a real number, instead of the illusion that “all the versions are upgraded.”
This also explains why OpenSSH made the new algorithm the default rather than offering a switch: defaults decide where negotiation starts, the overwhelming majority of connections never configure algorithms explicitly, and changing the default changes the actual negotiation outcome of the whole ecosystem. In the end, migration engineering is not a contest of who understands algorithms — it is a contest of who does the three small things well: defaults, lists, and checks.
References
- OpenSSH 9.0 release notes (sntrup761x25519 enabled by default, 2022) — https://www.openssh.com/releasenotes.html
- OpenSSH 10.0 release notes (default changed to mlkem768x25519, 2025) — https://www.openssh.com/releasenotes.html
- NIST FIPS 203: the ML-KEM standard — https://csrc.nist.gov/pubs/fips/203/final
- RFC 4253: The SSH Transport Layer Protocol (key exchange and the exchange hash) — https://www.rfc-editor.org/rfc/rfc4253
Tags: SSHPost-QuantumKey ExchangeHybrid Cryptography