Meet Modi
Back to Blog
·9 min

I made a post-quantum SSH key. GitHub never answered it

A post-quantum SSH key is one ssh-keygen command in OpenSSH 10.6. GitHub, GitLab, Bitbucket, Codeberg and sourcehut can't use it, and GitHub just hangs.

By Meet Modi
SSHOpenSSHPost-quantum cryptographyML-DSASecurity

I offered GitHub an SSH key it didn't recognise and waited. An Ed25519 key it didn't recognise got "Permission denied" in 0.1 seconds. The post-quantum one got nothing. Not a refusal, not an error. The connection sat there until my 30 second timeout killed it, twice in a row, and once more at 60 seconds.

That key was a post-quantum SSH key, ssh-mldsa44-ed25519, the type OpenSSH 10.6 turned on by default in October. Making one is a single ssh-keygen command. Using one is a different story. On December 2 the NSA published an advisory that lists SSH among the things to inventory and EdDSA among the algorithms to flag. Filippo Valsorda's reading of it ends with: update OpenSSH to 10.6 and rotate to these keys. So I built 10.6p2, made the keys, ran a server with them, and pointed them at five git hosts.

What the NSA advisory says about SSH keys

The press release is short. It tells owners of National Security Systems to "immediately accelerate the transition to post-quantum cryptography", and gives one new reason: "Frontier SI companies have engaged with the U.S. government to responsibly disclose recent discoveries that impact the security of some cryptographic systems currently in use." It does not say which systems or which companies.

The advisory behind it, PP-26-4956, is seven pages of steps. Step one is an inventory that names "TLS, IPsec, SSH, PKI/certificates, code signing, Wi-Fi, and identity credentials", and asks you to look for algorithms not approved in CNSA 2.0 or CNSA 1.0, "e.g., DSA, elliptic curves other than P-384 or P-521 for ECDH or ECDSA, EdDSA". The appendix lists what is approved. For signatures, CNSA 2.0 means ML-DSA-87. CNSA 1.0 means ECDSA on P-384 or RSA with at least 3072 bits.

Here is the part worth reading slowly. EdDSA was never in CNSA 1.0. So the advisory listing it as "not approved" is not new information about Ed25519. Filippo reads more into it: that the way the list is drawn hints P-256 and Curve25519 may be weaker than believed. That is his inference from the wording, and he says so. Nobody has published an attack. GitHub's SSH changelog from September, written before any of this, still says "All Ed25519 and ECDSA keys we support are strong, secure, and will continue to work for the indefinite future."

So the honest version for a normal developer: nothing says your Ed25519 key is broken today. The advice is to be ready to move. Which raises the obvious question of what you would move to.

How to generate a post-quantum SSH key

You need OpenSSH 10.6 or later. Version 10.3 had an experimental version named ssh-mldsa44-ed25519@openssh.com, and the 10.6 release notes say keys from that one "must be regenerated and/or removed". My runner had Ubuntu's 10.2, so I built 10.6p2 from the release tarball after checking its SHA256 against the one in the release notes. On 2 cores it took 30 seconds.

$ ssh -V
OpenSSH_10.6p2, OpenSSL 3.5.5 27 Jan 2026
$ ssh-keygen -t mldsa44-ed25519
Generating public/private mldsa44-ed25519 key pair.
Enter file in which to save the key (~/.ssh/id_mldsa44_ed25519):

# sizes next to the keys you already have
id_ed25519.pub          pub=  94 bytes  priv= 399 bytes  256 (ED25519)
id_ecdsa.pub (P-384)    pub= 216 bytes  priv= 610 bytes  384 (ECDSA)
id_rsa.pub (3072)       pub= 562 bytes  priv=2590 bytes  3072 (RSA)
id_mldsa44_ed25519.pub  pub=1870 bytes  priv=3982 bytes  512 (MLDSA44-ED25519)

The public key line is 1,870 characters, twenty times an Ed25519 one, because the ML-DSA-44 public key alone is 1,312 bytes. The draft that defines the format puts each signature at 2,484 bytes. ssh-keygen reports it as "512" bits, which is just the two 256s added together and means nothing about strength. Generating it took no measurable time.

The hybrid part matters. A signature is valid only if both the ML-DSA-44 half and the Ed25519 half check out. If ML-DSA turns out to have a flaw, you still have Ed25519. If Ed25519 falls to a quantum computer or to whatever the advisory is hinting at, you still have ML-DSA.

I tried it on my own server first

I ran sshd 10.6p2 on localhost with two host keys, Ed25519 and ML-DSA, and put all four user keys in authorized_keys. Logging in with the ML-DSA user key from a 10.6 client just worked:

debug1: kex: algorithm: mlkem768x25519-sha256
debug1: kex: host key algorithm: ssh-ed25519
debug1: Server accepts key: user_mldsa44-ed25519 MLDSA44-ED25519 SHA256:43cY... explicit
Authenticated to 127.0.0.1 ([127.0.0.1]:2222) using "publickey".

Look at the second line, though. The server had an ML-DSA host key and the client verified the server with Ed25519 anyway. In 10.6's default lists, ssh-mldsa44-ed25519 is last of the ten plain key types, for host keys and for user keys, after ECDSA and RSA. I let the client learn the ML-DSA host key with UpdateHostKeys, which worked ("Learned new hostkey: MLDSA44-ED25519"), and on the next login it still picked Ed25519. Only putting it first by hand changed that:

$ ssh -o HostKeyAlgorithms=^ssh-mldsa44-ed25519 -p 2222 127.0.0.1
debug1: kex: host key algorithm: ssh-mldsa44-ed25519
Authenticated to 127.0.0.1 ([127.0.0.1]:2222) using "publickey".

My guess is that the last-place order is deliberate: turn it on so it can be used, without changing what anyone negotiates by default. Ubuntu's stock 10.2 client could still log in to this server with Ed25519. Handed the new private key, it said Load key "user_mldsa44-ed25519": unknown or unsupported key type, and its ssh-keygen called the public key "not a public key file".

Speed is not a reason to wait. Twenty local logins took 114 ms each with Ed25519, ECDSA P-384, RSA 3072 and ML-DSA alike. Whatever the signature costs, it is lost in the rest of the connection.

Does GitHub support post-quantum SSH keys?

No, and this is where it goes wrong. An SSH server tells the client which public key types it accepts, in an extension called server-sig-algs. Here is what five git hosts sent on December 2:

github.com     ssh-ed25519, ecdsa-sha2-nistp256/384/521, rsa-sha2-512/256, ssh-rsa (+ sk, certs)
gitlab.com     ssh-ed25519, ecdsa-..., rsa-..., ssh-rsa, ssh-dss, ssh-mldsa-44, ssh-mldsa-65, ssh-mldsa-87
bitbucket.org  ssh-ed25519, ecdsa-..., rsa-..., ssh-rsa, ssh-dss
codeberg.org   ssh-ed25519, ecdsa-..., rsa-sha2-512/256      (OpenSSH_10.0p2)
git.sr.ht      ssh-ed25519, ecdsa-..., rsa-sha2-512/256      (OpenSSH_10.3)

Nobody lists ssh-mldsa44-ed25519. GitLab is the interesting one: it lists ssh-mldsa-44, -65 and -87, which are plain ML-DSA from a different draft, with no Ed25519 half. OpenSSH 10.6 cannot generate those. So the one host advertising post-quantum keys wants a kind no mainstream client makes, and the client that makes post-quantum keys makes a kind no host advertises. I didn't find a GitLab announcement for it, so treat it as what the server says, not a feature. None of the five offered an ssh-mldsa44-ed25519 host key either. (10.6 can't ask for GitLab's plain ML-DSA kind, so I couldn't check those.)

Then I offered each one my unregistered ML-DSA key. Four of them said no:

gitlab.com       0.2s  git@gitlab.com: Permission denied (publickey).
bitbucket.org    0.1s  git@bitbucket.org: Permission denied (publickey).
codeberg.org     1.0s  git@codeberg.org: Permission denied (publickey).
git.sr.ht        0.8s  git@git.sr.ht: Permission denied (publickey,keyboard-interactive).
github.com      30.0s  <no reply, killed by timeout>

The debug log for GitHub ends at "Offering public key: ... MLDSA44-ED25519" and nothing comes back. A refusal would let the client move on to the next key. Silence doesn't. I can't see GitHub's side, so I don't know why. What I can show is what it does to a normal setup.

The catch: your agent's key order

The SSH client offers keys one at a time: the keys in your ssh-agent first, in the order you added them, then the default files. I added the ML-DSA key to a 10.6 agent, then the Ed25519 key, and ran ssh against GitHub:

debug1: Will attempt key: test-mldsa44-ed25519 MLDSA44-ED25519 SHA256:43cY... agent
debug1: Will attempt key: test-ed25519 ED25519 SHA256:+g5i... agent
debug1: Offering public key: test-mldsa44-ed25519 MLDSA44-ED25519 SHA256:43cY... agent
(nothing for 30 seconds, then the timeout; the Ed25519 key is never offered)

My keys aren't registered on GitHub, so I can't show the case where the Ed25519 key would have logged in. But it never got the chance. If you generate the new key, ssh-add it, and your agent offers it first, git push to GitHub stops working and doesn't tell you why. Add it after your Ed25519 key and the Ed25519 one is tried first, which is the order I saw when I reversed them. The default file list is safe by accident: ~/.ssh/id_mldsa44_ed25519 comes last of six, after id_ed25519.

The fix is to say which key goes where in ~/.ssh/config, which is a good habit anyway:

# ~/.ssh/config
Host github.com gitlab.com bitbucket.org
    IdentityFile ~/.ssh/id_ed25519
    IdentitiesOnly yes

Host *.internal.example
    IdentityFile ~/.ssh/id_mldsa44_ed25519
    IdentitiesOnly yes
    HostKeyAlgorithms ^ssh-mldsa44-ed25519

What SSH key type should you use in 2026?

For git hosts: Ed25519 still, because it is the best thing all five accept, and none of them accept anything post-quantum you can make. For servers you run, where both ends can be 10.6: an ML-DSA hybrid key alongside your Ed25519 one, with the config above, costs you nothing I could measure. For anyone who has to tick a CNSA box, note that ML-DSA-44 is not ML-DSA-87. The composite draft also defines ssh-mldsa87-p384, which is the CNSA-shaped one, but 10.6p2 doesn't implement it. Until something does, the advisory's own interim answer is ECDSA P-384 or RSA 3072, and both work everywhere today.

Keys are only half of SSH, and the other half is already done for most people. All five hosts negotiated mlkem768x25519-sha256 for key exchange (Azure DevOps, which I checked too, did not), which is the part that protects against harvest now, decrypt later. I went through where GitHub's SSH and HTTPS differ on that last week, and what Anthropic's lattice papers mean for ML-KEM the week before.

What I'd wait on

  • GitHub, GitLab or Bitbucket saying which ML-DSA key type they will accept. Right now the one host that lists any picked a different type from the only client that generates one.
  • ssh-mldsa87-p384 in a release, if you need CNSA 2.0 sizes.
  • The format settling. The composite draft is still a draft, and 10.6 already broke compatibility with 10.3's keys once.
  • Any detail at all on what the "recent discoveries" are. Until then, rotating away from Ed25519 in a panic means rotating to something your git host can't use.

Is Ed25519 quantum safe?

No. Like all elliptic curve signatures, Ed25519 would fall to a large enough quantum computer running Shor's algorithm, and none exists today. The NSA advisory of December 2, 2026 lists EdDSA as not approved for national security systems, but EdDSA never was, and it publishes no new attack on Ed25519. GitHub still recommended it in September 2026.

How do I generate a post-quantum SSH key?

Install OpenSSH 10.6 or later and run ssh-keygen -t mldsa44-ed25519. It writes ~/.ssh/id_mldsa44_ed25519, a hybrid of ML-DSA-44 and Ed25519. The public key line is about 1,870 characters. Older clients such as 10.2 refuse to load it, and keys made with 10.3's experimental version have to be generated again.

Does GitHub support post-quantum SSH keys?

No, as of December 2, 2026. GitHub's server does not list any ML-DSA type, and when offered an ssh-mldsa44-ed25519 key it stopped responding rather than refusing it. GitHub does use post-quantum key exchange, mlkem768x25519-sha256, so the connection itself is protected. Only the key that proves who you are is still classical.

Does GitLab support ML-DSA SSH keys?

GitLab's server advertises ssh-mldsa-44, ssh-mldsa-65 and ssh-mldsa-87, which are plain ML-DSA keys. It does not advertise OpenSSH's hybrid ssh-mldsa44-ed25519, and OpenSSH 10.6 cannot generate plain ML-DSA keys. I found no GitLab announcement, so check its documentation before planning around it.

What SSH key type should I use in 2026?

Ed25519 for anything involving a git host, because GitHub, GitLab, Bitbucket, Codeberg and sourcehut all accept it and none accept a post-quantum key OpenSSH can make. Add an ssh-mldsa44-ed25519 key for servers you control that run OpenSSH 10.6. If you need CNSA compliance, use ECDSA P-384 or RSA 3072 for now.

Why does my SSH connection to GitHub hang after adding a new key?

If the new key is an ssh-mldsa44-ed25519 key and your ssh-agent offers it first, GitHub stops answering instead of rejecting it, so the client never moves on to your working key. Set IdentityFile ~/.ssh/id_ed25519 and IdentitiesOnly yes for github.com in ~/.ssh/config, or add the new key to the agent after the old one.

Is ssh-mldsa44-ed25519 CNSA 2.0 compliant?

No. CNSA 2.0 requires ML-DSA-87 for signatures, and this key uses ML-DSA-44, the smallest parameter set. The same IETF draft defines ssh-mldsa87-p384, which pairs ML-DSA-87 with ECDSA P-384, but OpenSSH 10.6p2 does not implement it. The NSA's interim options are ECDSA P-384 or RSA with at least 3072 bits.

  1. Immediate Actions to Push Toward Post-Quantum (PP-26-4956), NSA
  2. NSA Advises Immediate Transition to Post-Quantum Cryptography to Protect National Security Systems, NSA
  3. OpenSSH release notes (10.3, 10.6, 10.6p2), OpenSSH
  4. Post-Quantum Composite Signatures in SSH (draft-ietf-sshm-composite-sigs), IETF
  5. Security improvements for SSH, GitHub
  6. What to Make of the NSA Advisory, Filippo Valsorda

More Posts