1. Check your connection
You can check whether your SSH connection is ✅ post-quantum with one command:
ssh -v -p <port> user@<server> exit 2>&1 | grep 'kex: algorithm'
If you see this, you're good:
debug1: kex: algorithm: mlkem768x25519-sha256
2. What the name means
mlkem768x25519-sha256 reads in four parts:
| Part | Meaning |
|---|---|
mlkem |
ML-KEM, the post-quantum method (NIST FIPS 203) |
768 |
The size (parameter set) of ML-KEM |
x25519 |
The classic elliptic-curve method |
sha256 |
The hash function that mixes both results into one secret |
It is a hybrid key exchange. An attacker has to break both ML-KEM and X25519 to recover the session key.
3. Why it matters now
Large quantum computers able to break X25519 are not here yet, but encrypted traffic can be recorded today and decrypted years later. This is known as “store now, decrypt later”.
If your SSH sessions carry anything that must stay secret for a long time, the key exchange is the part to fix first.
4. If you see something else
| You see | What it means |
|---|---|
mlkem768x25519-sha256 |
✅ Post-quantum (default since OpenSSH 10.0) |
sntrup761x25519-sha512 |
✅ Also post-quantum (an older hybrid method) |
sntrup761x25519-sha512@openssh.com |
✅ Same method, under its earlier name |
curve25519-sha256 |
❌ Classic only |
ecdh-sha2-* or diffie-hellman-* |
❌ Classic only |
Since OpenSSH 10.1, the client also warns you when a connection uses a key exchange that is not post-quantum.
5. How to make it post-quantum
If not, ask your clanker to make it post-quantum safe! Or do it by hand.
Step 1 — Check both ends
The client and the server must both support the algorithm. Run this on each one:
ssh -V
ssh -Q kex | grep -E 'mlkem|sntrup'
mlkem768x25519-sha256 needs OpenSSH 9.9 or newer.
Step 2 — Upgrade OpenSSH
Updating the OpenSSH package is usually all it takes, because current versions prefer post-quantum key exchange by default.
Step 3 — Look for an old override
A hardening guide followed years ago may have pinned KexAlgorithms to a classic-only list.
# On the server
sudo sshd -T | grep -i '^kexalgorithms'
# On the client
ssh -G user@<server> | grep -i '^kexalgorithms'
Remove the old line, or put the post-quantum method first. The ^ keeps the other defaults and moves this one to the head of the list:
KexAlgorithms ^mlkem768x25519-sha256
Step 4 — Validate and reload the server
sudo sshd -t
sudo systemctl reload sshd # the service is called "ssh" on Debian and Ubuntu
Keep your current session open until a new one connects successfully.
Step 5 — Verify
Run the command from section 1 again.
6. What this does not cover
This check is only about the key exchange, which protects the confidentiality of the session. Your host keys and user keys (Ed25519, ECDSA, RSA) are signatures, and they are a separate matter.
Signatures are not exposed to “store now, decrypt later”, but they will need replacing before capable quantum computers arrive. Recent OpenSSH releases have started adding a hybrid post-quantum signature type, ssh-mldsa44-ed25519.
Summary
| Item | Reality |
|---|---|
| How to check | ssh -v and look for the kex: algorithm line |
| What you want to see | mlkem768x25519-sha256 |
| Also acceptable | sntrup761x25519-sha512 |
| Usual fix | Upgrade OpenSSH on both ends and remove old KexAlgorithms |
| Not covered by this | Host and user key signatures |
Sources
- OpenSSH: Post-Quantum Cryptography — OpenSSH project. Which key exchange methods are post-quantum, the defaults and the warning.
- OpenSSH release notes — OpenSSH project. Version history for the algorithms mentioned here.
- FIPS 203: Module-Lattice-Based Key-Encapsulation Mechanism Standard — NIST (August 2024). The ML-KEM specification.