Post-Quantum Cryptography 8 min read

Post-Quantum SSH Is Half On by Default. I Tested the Other Half.

Jim Walker

Jim Walker

General Manager, Service Delivery

Post-Quantum SSH Is Half On by Default. I Tested the Other Half.

Upgrade OpenSSH and you get post-quantum key exchange without lifting a finger. You do not get post-quantum authentication. That half sits at the bottom of the defaults list, and it stays off until someone turns it on.

Earlier this month I built a two-VM lab at home and ran an SSH session where every asymmetric piece of the handshake was post-quantum (hybrid): the key exchange, the server host key and the user key. The server allowed nothing else. No classical fallback, no quietly negotiating down if the client couldn't keep up.

Then I captured it on the wire and threw classical clients at it to make sure it actually said no.

The Setup

Two Ubuntu 24.04 VMs, one client and one server. First problem: Ubuntu 24.04 ships OpenSSH 9.6p1, which has no ML-KEM and no ML-DSA at all. So if your Linux fleet is sitting on a current LTS distro build, post-quantum SSH isn't a config change for you yet. It's a version problem first.

I built OpenSSH 10.6p2 from source (the latest release at the time, signed November 4) and verified the tarball's GPG signature against Damien Miller's key before building anything. It installed under /opt and ran as a second sshd on port 2222, right beside the stock sshd on port 22, which I left alone.

The stock 9.6p1 build next to 10.6p2: only the 10.6p2 build lists ML-KEM and ML-DSA
The stock 9.6p1 build next to 10.6p2: only the 10.6p2 build lists ML-KEM and ML-DSA

One detail worth knowing: the box has OpenSSL 3.0.13, but the ML-KEM and ML-DSA code doesn't come from OpenSSL. It comes from the libcrux implementation that OpenSSH bundles. If your crypto story assumes everything routes through the system OpenSSL, that assumption doesn't hold here.

The server config came down to four lines that matter:

  • KexAlgorithms mlkem768x25519-sha256
  • HostKeyAlgorithms ssh-mldsa44-ed25519
  • PubkeyAcceptedAlgorithms ssh-mldsa44-ed25519
  • Ciphers aes256-gcm@openssh.com

Public key auth only, no passwords, no keyboard-interactive. Both the host key and the user key were generated with ssh-keygen -t mldsa44-ed25519. The client pinned the same four settings on the command line.

The PQC-only sshd config and its effective values (sshd -T)
The PQC-only sshd config and its effective values (sshd -T)

(AES-256-GCM isn't a post-quantum algorithm, by the way. Symmetric ciphers hold up by key size, so 256-bit is the move. The asymmetric pieces are the ones that need replacing.)

What Changed on the Wire

The session connected. The client log, the server's DEBUG3 log and the packet capture all agreed on the algorithms, and the host key fingerprint the client saw matched the key on the server.

Client ssh -vv output: ML-KEM key exchange, ML-DSA host key, ML-DSA user key accepted
Client ssh -vv output: ML-KEM key exchange, ML-DSA host key, ML-DSA user key accepted

The packet capture is where it gets concrete. Here is every public-key piece of the handshake, classical next to post-quantum, in bytes on the wire:

SSH handshake sizes, classical vs. hybrid post-quantum
SSH handshake sizes, classical vs. hybrid post-quantum

166 B

classical server handshake reply (X25519 + Ed25519)

5,002 B

hybrid post-quantum server reply, measured on the wire

30x

overall growth in the server's handshake reply

38x

growth in the client key share (32 to 1,216 bytes)

The post-quantum numbers come straight from the capture. The classical numbers use the same SSH wire encoding for X25519 and Ed25519, so it's an apples-to-apples comparison.

The growth is almost entirely the post-quantum half. An ML-KEM-768 encapsulation key alone is 1,184 bytes, and the ciphertext coming back is 1,088. An ML-DSA-44 public key is 1,312 bytes and a signature is 2,420. The classical half riding along (32 bytes for X25519, 32 for an Ed25519 key, 64 for an Ed25519 signature) is a rounding error.

The capture only shows the server's side of authentication. Your user key and its signature are the same sizes as the host key rows, but they travel after encryption starts, so you won't see them on the wire, but you still pay for them.

None of that is a problem for a single SSH session. Thirty times bigger is still about 5 KB. But if you run anything that inspects, logs or makes assumptions about handshake sizes, it's worth a look.

Case in point: Wireshark 4.2.2 decoded the session, printed the correct method name, then flagged "Invalid key length: 1216/1120" and labeled the message a Diffie-Hellman key exchange. It just doesn't know ML-KEM sizes yet. Your tooling may be more confused by post-quantum than your crypto is.

tshark decode of the same session, including the "invalid key length" warnings
tshark decode of the same session, including the "invalid key length" warnings

Trying to Break It

A successful connection only proves half the point. The other half is proving nothing classical gets in. So I ran negative controls against the PQC-only server:

  • Client forced to curve25519-sha256: refused, no matching key exchange method.
  • Client forced to an ssh-ed25519 host key: ML-KEM key exchange succeeded, then refused with no matching host key type.
  • Classical Ed25519 user key: made it through ML-KEM key exchange and the ML-DSA host key, then Permission denied.
  • Stock Ubuntu 9.6p1 client: refused, no matching key exchange method.
  • OpenSSH 10.6p2 client with no overrides at all: connected, on ML-KEM and ML-DSA.
Negative controls against the PQC-only sshd
Negative controls against the PQC-only sshd

That last one matters more than it looks. I didn't tell the client anything. The server offered only post-quantum algorithms and a capable client simply followed. Lock down the server side and the clients that can keep up will go along with it. The ones that can't get a clear error instead of a silent downgrade.

The Part That Should Change Your Plan

Here is the finding I'd put in front of anyone running a PQC migration.

In OpenSSH 10.6p2, ML-KEM is first in the default KexAlgorithms list. ssh-mldsa44-ed25519 is last in both HostKeyAlgorithms and PubkeyAcceptedAlgorithms. So a default client talking to a default server gets post-quantum key exchange and an Ed25519 host key. Half and half.

Don't get me wrong, that ordering makes sense. Key exchange is the harvest-now-decrypt-later exposure: someone records the session today and decrypts it later. Authentication is a different problem. Forging a signature only helps an attacker at the moment of connection, so it is less urgent. OpenSSH fixed the urgent half first.

But "we upgraded OpenSSH" is not the same as "our SSH is post-quantum," and I'd expect those two statements to get blurred in a lot of status reports. Every host key and every authorized_keys entry is still classical until someone deliberately generates a new key, deploys it and changes the config. That's a key management project, not a patch.

Honest Limits

This was a lab, not a fleet. Things I did not prove:

  • Hybrid, not pure post-quantum. Every PQ algorithm is paired with a classical one (X25519, Ed25519), so the session holds as long as either half holds. That's the design OpenSSH ships, and I think it's the right one for now.
  • Same version on both ends only. No PuTTY, no Windows OpenSSH, no libssh. My Raspberry Pi runs OpenSSH 10.0p2, which advertises mlkem768x25519-sha256 and sntrup761x25519-sha512 but not ssh-mldsa44-ed25519. So it could do PQ key exchange with this server but not the ML-DSA host or user key. I checked that by listing algorithms, not by running a session.
  • Trust on first use. The client accepted the test host key on first connect. I didn't test the Ed25519 half of the composite key separately.
  • Not covered: performance, an interoperability matrix, long-running sessions and certificate-based SSH.

That Pi is the real-world preview. Mixed versions across a fleet means some machines can do half, some can do all of it and some can do none. Turn on ML-DSA-only before the clients are ready and you've built yourself an outage.

What I'd Actually Do With This

  1. 1 Find out what OpenSSH versions you're running. Distro version, not upstream. If it's 9.x, you have no post-quantum SSH at all, and the fix is a version decision before it's a config decision.
  2. 2 Take the key exchange win. Once you're on a version that supports it, ML-KEM key exchange is the default. Confirm it's actually negotiating (ssh -vv tells you) and that nobody pinned an older list in a hardened config somewhere.
  3. 3 Treat ML-DSA host and user keys as their own project. Inventory where host keys and authorized_keys files live, find out which clients can handle composite keys and plan the rotation. This is the part that won't happen on its own.
  4. 4 Test what gets refused, not just what connects. A PQC-only config that quietly accepts a classical client is worse than no PQC config, because it tells you something that isn't true.
  5. 5 Check your monitoring tools. If Wireshark mislabels it, assume something else in your stack might too.

Where This Goes Next

Next up is clients beyond OpenSSH and certificate-based SSH, which is where most larger environments actually live.

Upgrading OpenSSH turns on half of post-quantum SSH. The other half is a config change and a key rotation, and nobody is going to do it for you.

Originally published on LinkedIn.

Read the original on LinkedIn

Ready to close your governance gap?

Talk to the Olympus team about extending Zero Trust to every identity in your environment — human and non-human.