← Back to section · Open Source Projects
OpenSSH's Post-Quantum Hybrid Key Exchange: From sntrup761 to ML-KEM
OpenSSH was among the first mainstream programs to enable post-quantum key exchange by default: sntrup761 hybrids in 9.0 (2022), an ML-KEM hybrid from 10.0, and an explicit warning when a peer has no PQC support.
Why SSH Is Ground Zero for “Store Now, Decrypt Later”
SSH sessions carry administrative traffic: server passwords, session contents, tunnelled data. If a session is recorded today, an attacker with a cryptographically relevant quantum computer can decrypt it years later — the textbook “store now, decrypt later” scenario. OpenSSH therefore moved earlier than most mainstream software, and its answer was not to wait for standards to settle but to ship hybrid key exchange first.
Two Defaults, One Logic
| Release | Year | Default key exchange | Rationale |
|---|---|---|---|
| OpenSSH 9.0 | 2022 | sntrup761x25519-sha512 |
Hybrid of NTRU Prime and X25519; ML-KEM was not yet standardized, so a well-reviewed candidate filled the slot |
| OpenSSH 10.0 | 2025 | mlkem768x25519-sha256 |
After FIPS 203, the default moved to standardized ML-KEM-768 combined with X25519 |
The logic is transparent: use a thoroughly scrutinized candidate as a placeholder while the standard is pending, then transition smoothly to ML-KEM once it lands. Both are hybrids — the session key is derived from the shared secrets of a classical elliptic-curve exchange and a post-quantum KEM together. The classical leg defends against today’s attackers, the post-quantum leg against tomorrow’s quantum computer, and breaking either one alone is not enough.
The Famous Warning
From OpenSSH 10.0, when a client connects to a server that only offers classical key exchange, it prints:
** WARNING: connection is not using a post-quantum key exchange algorithm.
** This session may be vulnerable to "store now, decrypt later" attacks.
** The server may need to be upgraded. See https://openssh.com/pq.html
The warning is deliberately designed as migration pressure. It does not block the connection — compatibility wins — but it puts the risk on the terminal at every login, where server administrators cannot pretend it does not exist. The correct response on seeing it is to upgrade the server, not to find a way to silence the message.
Why Hybrid, and Why It Worked as a Strategy
OpenSSH’s approach is worth studying beyond SSH itself, because it solved the deployer’s dilemma: nobody wants to bet the security of a critical protocol on a single new algorithm, yet waiting for complete certainty means years of recorded traffic exposed to later decryption. The hybrid construction dissolves the dilemma — the new algorithm only has to not make things worse, because the classical exchange remains in the derivation; and if the classical half falls to a quantum computer, the post-quantum half still protects the session. The sntrup761 episode validated the strategy end-to-end: when ML-KEM was standardized, OpenSSH could swap the post-quantum leg without any protocol redesign, and the installed base followed through routine version upgrades. Protocol designers in other domains now cite this as the template for algorithm transitions under uncertainty.
Configuration: Inspect and Pin
List what the client supports and what the server effectively offers:
ssh -Q kex # all kex algorithms the client supports
sshd -T | grep -i kexalgorithms # effective server configuration
To pin the server to post-quantum hybrids only (do this after confirming all your clients support them), set in /etc/ssh/sshd_config:
KexAlgorithms mlkem768x25519-sha256,sntrup761x25519-sha512
The same constraint can be applied per host on the client side, in ~/.ssh/config:
Host bastion.example.com
KexAlgorithms mlkem768x25519-sha256
To verify what a given connection actually negotiated, look for the kex: algorithm: line in ssh -v debug output. One scoping note: host keys and user signature keys in SSH are still classical today. That is an authentication question, not a confidentiality one — it is not exposed to store-now-decrypt-later, so it can migrate on a different schedule. Key exchange is the item that should be fully hybrid now.
A Rollout Checklist for Operators
For teams administering fleets of servers, the practical sequence is:
- Inventory versions. Collect the OpenSSH version on every server and jump host. Anything at 9.0 or later can already do a hybrid exchange; 10.0 or later gets the ML-KEM default and the warning system.
- Start with jump hosts and bastions. These carry the most sensitive sessions and are few in number — upgrade them first, and let the client warning tell you which downstream servers still negotiate classical-only exchanges.
- Keep a fallback during transition. Leave
sntrup761x25519-sha512enabled alongside the ML-KEM hybrid until you have confirmed every client in the estate supports the newer default; only then consider pinning the list. - Treat warnings as tickets. When an administrator reports the post-quantum warning, that is a free audit finding: a named server, a named upgrade. Track them to zero rather than training staff to ignore them.
None of this requires new infrastructure or licences — which is precisely why SSH is the easiest “first wave” item on most organizations’ post-quantum lists.
Reading the Algorithm Name: The Construction Is in the String
The name mlkem768x25519-sha256 is itself a construction diagram: ML-KEM-768 provides the post-quantum part, X25519 the classical elliptic-curve part, and the trailing SHA-256 is the hash used to combine the two shared secrets into the session key. sntrup761x25519-sha512 reads the same way, with the post-quantum leg swapped for NTRU Prime’s sntrup761 and the combiner hash for SHA-512. This naming style continues SSH’s long-standing algorithm-naming tradition: the name is both the identifier exchanged during negotiation and an implicit contract between implementers.
Knowing how to read the names pays off in troubleshooting: from a peer’s offered list you can tell exactly which leg is missing. A legacy client offering only curve25519-sha256 lacks the entire post-quantum part; a peer that supports sntrup761 but not mlkem768 is most likely an OpenSSH stuck in the 9.x series or a third-party implementation that has not caught up. People who memorize negotiation lists as opaque configuration strings usually discover, at their first cross-implementation debugging session, that they never actually understood them.
Version Numbers Lie: The Backport Reality
In enterprise environments, the easiest mistake when asking “does this server support PQC?” is to look only at the OpenSSH version number. Mainstream Linux distributions traditionally backport new features onto older version branches: under a stability promise, they may merge post-quantum key-exchange support in without changing the version string — or, conversely, disable it in a particular distribution build for certification-boundary reasons. The same version number does not imply the same algorithm list, and a lagging version number does not imply absence of support.
The only reliable method is measurement: sshd -T on the server for the effective configuration, ssh -Q kex on the client for the local list, and the negotiated kex: algorithm: line in ssh -v output for ground truth on a real connection. Interoperability also has to account for non-OpenSSH implementations — commercial SSH clients and the SSH servers embedded in appliances and network gear follow at uneven pace, and some still offer classical algorithms only. Before pinning KexAlgorithms, inventorying those peers that will never upgrade themselves is the operator’s standard homework; pin too early, and the first thing to break is usually the most inconspicuous device.
Beyond Key Exchange: Authentication Runs on a Different Clock
Key exchange is not the only place SSH uses asymmetric cryptography: host keys decide whether you are talking to the right server, and user keys decide whether the server accepts you. Both sides still rely on classical algorithms — Ed25519, ECDSA, RSA — today; using post-quantum signatures such as ML-DSA for SSH host and user keys remains at the protocol-discussion and experimentation stage, is not OpenSSH’s default behaviour, and the certificate ecosystem has not caught up either.
That is not an oversight but a difference in risk ordering. Forging an authentication signature presupposes an attacker who already has a cryptographically relevant quantum computer at the moment the connection happens, whereas recorded-decryption targets sessions that have already occurred — traffic captured today retains its value a decade from now. Key-exchange threats are retroactive; authentication threats are not. The community’s sequencing follows: move every connection’s key exchange to hybrid now, and migrate authentication once the signature schemes and certificate ecosystem mature. For operators the implication is direct: do not postpone the key-exchange upgrade because “the host keys aren’t PQC yet” — the two run on different clocks by design.
Worth a footnote: the warning itself ships with a configuration escape hatch. For peers that genuinely cannot be upgraded, exceptions can be scoped per-host in the client configuration rather than disabling the check globally. Writing exceptions into configuration, on the record, is far healthier than letting administrators grow numb to the warning in their terminals — half the mechanism’s value lies in the risk it surfaces, and the other half in forcing exceptions to become explicit decisions.
References
- OpenSSH post-quantum cryptography page. https://www.openssh.com/pq.html
- OpenSSH 9.0 release notes. https://www.openssh.com/txt/release-9.0
- OpenSSH 10.0 release notes. https://www.openssh.com/txt/release-10.0
- NIST, FIPS 203, 2024-08-13. https://doi.org/10.6028/NIST.FIPS.203
Tags: OpenSSHML-KEMhybrid key exchangeSSH