skip to content

A security review asks whether SSH sessions recorded today could be decrypted by a future quantum computer; what does OpenSSH 10.x's mlkem768x25519-sha256 default change?

level: seniorimportance: should knowfreq 16%

answer

  1. recording now, breaking later
  2. confidentiality comes from key agreement
  3. two secrets hashed together
  4. signatures carry no retroactive risk
  5. which peers fall back

basics

~20 s

Since OpenSSH 10.0 the default key exchange, mlkem768x25519-sha256, hashes an ML-KEM-768 secret with an X25519 one, so breaking X25519 later no longer decrypts a recording. Sessions still negotiating classical ECDH or DH remain 'store now, decrypt later' targets.

solid answer

~50 s

Recorded SSH traffic can be decrypted later only by recovering its session keys, which come from the key exchange, so the review is really asking which key exchange each session negotiated. OpenSSH has offered a post-quantum hybrid by default since 9.0 (`sntrup761x25519-sha512`), added `mlkem768x25519-sha256` in 9.9 and made it the default in 10.0. The hybrid computes its shared secret as a hash of the ML-KEM and X25519 secrets, so it is no weaker than `curve25519-sha256` even if ML-KEM were broken. Host-key and user signatures are a slower problem: breaking them later does not expose past traffic. The gap is peers that cannot negotiate a hybrid, which fall back to classical ECDH or Diffie-Hellman; since 10.1 the client warns about exactly those sessions (`WarnWeakCrypto`). The answer to the review is an inventory of which peers negotiate what, and a plan per peer.

go deeper

for a junior

Recall that recorded SSH traffic could be decrypted later if its key exchange is broken, and that current OpenSSH uses a post-quantum hybrid by default.

for a middle

Explain how the hybrid combines ML-KEM-768 and X25519 into one shared secret, and why both peers must support it for a session to use it.

for a senior

Turn the review into an inventory: use the 10.1 warning to find classical sessions, fix servers that trimmed their lists, and record accepted risk per legacy device.

for a principal

Separate the urgent key-exchange migration from the slower signature migration, and decide which data flows justify replacing devices that cannot negotiate a hybrid.

## Why recorded traffic depends on the key exchange An SSH session's confidentiality rests on symmetric keys that both sides derive from the **key exchange**. Anyone can record the encrypted packets today. If they can later recompute the shared secret from the recorded exchange, they can derive the session keys and read everything, including passwords typed into the session and files copied over it. Classical key agreement, finite-field Diffie-Hellman and elliptic-curve Diffie-Hellman such as X25519, rests on problems that a large enough quantum computer is believed to solve efficiently. Such a machine does not exist yet, but recording is cheap and patient. That is the **"store now, decrypt later"** (or "harvest now, decrypt later") threat: traffic sent today is at risk unless its key exchange is post-quantum. ## What the hybrid does `mlkem768x25519-sha256` runs two key agreements in one exchange: - **ML-KEM-768**, the module-lattice key encapsulation mechanism standardised by NIST, which is believed to resist quantum attack; - **X25519**, the classical elliptic-curve exchange behind `curve25519-sha256`, OpenSSH's previous preferred method. The client sends both its ML-KEM public key and its X25519 public value in one `SSH_MSG_KEX_HYBRID_INIT`; the server answers with an ML-KEM ciphertext and its X25519 value in `SSH_MSG_KEX_HYBRID_REPLY`. The shared secret is `K = HASH(K_PQ || K_CL)`, the hash of the two secrets concatenated (the method is specified in an Internet-Draft, not yet an RFC). The consequence is the property the review cares about: 1. To recover K, an attacker must break **both** components. 2. If ML-KEM turned out to be weak, the session is still as strong as `curve25519-sha256`. 3. If X25519 falls to a quantum computer, ML-KEM still protects the recording. ## How OpenSSH's defaults moved | OpenSSH release | Change | |---|---| | 9.0 | `sntrup761x25519-sha512`, a hybrid with Streamlined NTRU Prime, becomes the default | | 9.9 | `mlkem768x25519-sha256` added | | 10.0 | `mlkem768x25519-sha256` becomes the default; OpenSSH describes it as considerably faster than the previous default | | 10.1 | client warns when a connection negotiates a key exchange that is not post-quantum | Both client and server in 10.5 put `mlkem768x25519-sha256` first, then the `sntrup761x25519-sha512` names, then `curve25519-sha256`. A session gets a hybrid only when **both** ends support one; otherwise negotiation quietly settles on a classical method. Two practical consequences follow. A server running OpenSSH 9.0 to 9.8 still negotiates `sntrup761x25519-sha512` with a 10.5 client: that session is post-quantum too and raises no warning, so it is not part of the gap. And because the client's order decides, an older client that prefers `curve25519-sha256` gets a classical session even from a 10.5 server that offers the hybrid; upgrading or reconfiguring clients matters as much as upgrading servers. ## Why signatures are a different problem Host keys (and user keys) sign the handshake; they do not protect its secrecy. A quantum computer that later forges an RSA, ECDSA or Ed25519 signature cannot go back and decrypt a recording, because the signature only proved who was talking at the time. OpenSSH's own guidance says the urgency for signatures is to retire classical keys *before* such a computer exists, not to rush today. Replacing RSA host keys with Ed25519 is good hygiene but does nothing for recorded traffic. ## Answering the review 1. **Inventory what is negotiated.** A 10.1 or later client prints a warning on every non-post-quantum session (`WARNING: connection is not using a post-quantum key exchange algorithm.`), which turns the client fleet into a detector for servers that need attention. 2. **Fix the servers that can be fixed.** Anything running OpenSSH 9.0 or later can negotiate a hybrid; if one does not, check whether its `KexAlgorithms` were trimmed so far that the hybrids were removed. 3. **Name the ones that cannot.** Network devices and old appliances may only speak classical methods. For each, either upgrade or record an accepted risk. 4. **Silence warnings selectively.** `WarnWeakCrypto no-pq-kex` inside a `Match host` or `Host` block for one known device, never fleet-wide, so new regressions still show up. 5. **Weigh what flows over each session.** A session that carries long-lived secrets matters more than one that restarts a service. The honest summary for the reviewer: sessions between current OpenSSH peers already use a key exchange designed to keep today's recordings unreadable by a future quantum computer; the exposure sits in specific older peers, and the client now tells you which.

  • If ML-KEM were badly broken tomorrow, what would sessions using mlkem768x25519-sha256 lose?
    Only the post-quantum margin. The shared secret hashes the ML-KEM and X25519 secrets together, so an attacker must break both; with ML-KEM gone the session is still as strong as `curve25519-sha256` against today's computers. That is why every post-quantum key exchange OpenSSH implements is a hybrid rather than a post-quantum method on its own.
  • Does switching every host key to Ed25519 protect traffic recorded today?
    No. Host-key signatures authenticate the handshake at the time it happens; breaking them later lets an attacker impersonate a server from then on but not decrypt old recordings. Recorded traffic is protected only by a post-quantum key exchange.
  • Why not turn WarnWeakCrypto off everywhere once the known legacy devices are listed?
    Because the warning is the cheapest detector you have. A server whose `KexAlgorithms` gets trimmed, or a new appliance that only speaks classical methods, would go unnoticed. OpenSSH's guidance is to disable it selectively per host with `no-pq-kex`.

  • Post-quantum key exchange only matters once a quantum computer exists.
  • Using Ed25519 host keys makes SSH sessions quantum-safe.
  • The hybrid is weaker than curve25519-sha256 because ML-KEM is new.
  • A session gets the hybrid as soon as the client is upgraded, whatever the server runs.
  • The 10.1 post-quantum warning means the server has been compromised.

Assumes OpenSSH 10.5; the hybrid default mlkem768x25519-sha256 dates from 10.0 (sntrup761x25519-sha512 was the default from 9.0), and the non-post-quantum warning from 10.1.