SSH ECDSA keys (ecdsa-sha2-nistp256/384/521)
ECDSA host or user keys for SSH authentication on NIST curves.
Why it's at risk
ECDSA keys are broken by Shor's algorithm. As with all SSH keys, the immediate priority is the key exchange (use mlkem768x25519-sha256); for keys, Ed25519 is the better classical choice today. Post-quantum SSH keys are new: the hybrid ssh-mldsa44-ed25519 was experimental in OpenSSH 10.4 and enabled in 10.6, and needs recent OpenSSH on both ends.
Move to
- Bestmlkem768x25519-sha256 (SSH key exchange)OpenSSH's hybrid ML-KEM-768 + X25519 key exchange, available since OpenSSH 9.9 and the default since OpenSSH 10.0.
- OrSSH Ed25519 keysEd25519 host or user keys, the modern default for SSH authentication.
- Orssh-mldsa44-ed25519 (hybrid SSH keys)OpenSSH's hybrid ML-DSA-44 + Ed25519 signature for user and host keys, the first post-quantum SSH key type.
- Used for
- Signature
- Family
- SSH key (elliptic curve)
- Classical security
- 128 bits
- Against a quantum computer
- Broken
- Standards
- RFC 5656
Migration guides
Concrete code changes to move off SSH ECDSA keys (ecdsa-sha2-nistp256/384/521). Pick your stack.
OpenSSH · configOpenSSH: make sure every connection uses mlkem768x25519-sha256, then plan PQ keysProduction-ready
Why
SSH sessions carry shell commands, secrets and file transfers, and recorded sessions could be decrypted later. OpenSSH added the hybrid key exchange mlkem768x25519-sha256 (ML-KEM-768 + X25519, now RFC 10042) in 9.9 and made it the default in 10.0 (April 2025). Since 10.1, the ssh client warns when a connection negotiates a key exchange that is not post-quantum (WarnWeakCrypto, on by default), and OpenSSH 10.6 extended that option to sshd. Earlier, OpenSSH 9.0–9.9 defaulted to the hybrid sntrup761x25519-sha512, which is also post-quantum.
Authentication keys (ssh-ed25519, ECDSA, RSA) are a second, less urgent step: signatures are checked live and cannot be "harvested". OpenSSH 10.4 added experimental hybrid ssh-mldsa44-ed25519 keys and 10.6 enabled the algorithm under its final name.
Steps
-
Check versions on clients, servers, bastions and CI runners:
ssh -V(servers usually ship the same OpenSSH package; check with your package manager). -
See what a connection negotiates:
bash ssh -v user@host exit 2>&1 | grep "kex: algorithm" # debug1: kex: algorithm: mlkem768x25519-sha256 -
Remove old hardening that pins
KexAlgorithmsto classical algorithms, or put the hybrids first (serversshd_configand client~/.ssh/config//etc/ssh/ssh_config). -
Upgrade servers that cannot negotiate a PQ kex (older than 9.0) or network appliances with embedded SSH; ask vendors for timelines.
-
Later: when your whole fleet runs a release that supports it, trial
ssh-keygen -t mldsa44-ed25519keys for users and hosts.
Before
# /etc/ssh/sshd_config (old hardening guide)
KexAlgorithms curve25519-sha256,ecdh-sha2-nistp256,diffie-hellman-group16-sha512After
# /etc/ssh/sshd_config
# Simplest on OpenSSH 10+: delete the KexAlgorithms line to use the PQ-first defaults.
# If you must pin a list, put the hybrids first:
KexAlgorithms mlkem768x25519-sha256,sntrup761x25519-sha512,curve25519-sha256,ecdh-sha2-nistp256Apply with sshd -t && systemctl reload sshd (service name varies: ssh on Debian/Ubuntu).
Gotchas
- Both ends must support it. A 10.x client talking to an old server falls back to classical kex (and warns on 10.1+). Fix the server.
sntrup761x25519-sha512is still post-quantum; it is fine wheremlkem768x25519-sha256is unavailable. Some distributions use the@openssh.comsuffixed name.- Libraries and appliances (Go
x/crypto/ssh, Paramiko, libssh, JSch, network gear) have their own support status; check before relying on defaults. - DSA is gone: OpenSSH 10.0 removed DSA keys entirely. RSA keys still work with
rsa-sha2-256/512; the SHA-1ssh-rsasignature algorithm has been off by default since 8.8. - PQ user/host keys are new.
ssh-mldsa44-ed25519needs recent OpenSSH on both ends; keys made with the earlier experimental@openssh.comvariant must be regenerated.
Verify
ssh -v user@host exit 2>&1 | grep -E "kex: algorithm|WARNING"
ssh -Q kex | grep -E "mlkem|sntrup" # what your client supports
nmap --script ssh2-enum-algos -p 22 host # what a server offers