[ blog » 2026 ]Switching to Post-Quantum Crypo (by Philipp Gesang, location: Munich)
2026-12-03

It’s probably because of quantum!

--- Terry Pratchett

In light of the escalating cryptocalypse and vagueries from the likes of NSA, the LLM people, and more credible folks, I went to investigate what options there were to move this recently upgraded server to hybrid classical/post-quantum encryption.

The barrage of crypto announcements chipped away at the status quo to the extent that we’re back to sharing curated sets of cipher suites on the Internet like during the RC4 fallout. Just that instead of published evidence we’re acting on secretive doomposting of self-important CEOs and linguistically castrated press releases by US government agencies.

SSH

This is single most important service to secure on any machine. In true OpenBSD style OpenSSH’s PQ support has excellent docs. The hybrid scheme is called mlkem768x25519-sha256 there. This is already the default key exchange in 10.x, however the host keys are still Ed25519 and RSA only as [support for Dilithium / ML-DSA is experimental.]( but the 10.6 on Fedora 45 supports it:

⌜✓⌝ 23:15:28 phg@phi-gamma ▶ ssh -Q key |grep mldsa
ssh-mldsa44-ed25519
ssh-mldsa44-ed25519-cert
⌜✓⌝ 23:17:07 phg@phi-gamma ▶ sshd -T | grep -i '^kexalgorithms'
KexAlgorithms mlkem768x25519-sha256,mlkem768nistp256-sha256,mlkem1024nistp384-sha384,curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512

(It’s still fairly recent though, the 10.3 on my home router doesn’t yet have ML-DSA at all. u ML-DSA 87/p384 is still in draft state.)

To generate a key on the client:

$ ssh-keygen -t ssh-mldsa44-ed25519

Sigh:

⌜✓⌝ 23:23:26 root@phi-gamma ~ √ lal -Sr /etc/ssh/ssh_host_*
-rw-r--r--. 1 root root  100 2026-11-16 20:29 /etc/ssh/ssh_host_ed25519_key.pub
-rw-r--r--. 1 root root  180 2026-11-16 20:29 /etc/ssh/ssh_host_ecdsa_key.pub
-rw-------. 1 root root  411 2026-11-16 20:29 /etc/ssh/ssh_host_ed25519_key
-rw-------. 1 root root  513 2026-11-16 20:29 /etc/ssh/ssh_host_ecdsa_key
-rw-r--r--. 1 root root  572 2026-11-16 20:29 /etc/ssh/ssh_host_rsa_key.pub
-rw-r--r--. 1 root root 1868 2026-12-03 23:23 /etc/ssh/ssh_host_mldsa44_ed25519_key.pub
-rw-------. 1 root root 2602 2026-11-16 20:29 /etc/ssh/ssh_host_rsa_key
-rw-------. 1 root root 3982 2026-12-03 23:23 /etc/ssh/ssh_host_mldsa44_ed25519_key

Granted they’re not pqRSA, but these keys definitely aren’t the smallest.

Despite the universal support it didn’t prove easy getting this to work. After enforcing a mlkem768x25519-sha256, sshd refused to let in anyone even with ML-KEM key. (I even locked myself out of the machine temporarily after losing an existing shell session during the experiments.)

The trick to making ML-DSA work is this line in the server config:

PubkeyAcceptedAlgorithms +ssh-mldsa44-ed25519

which enables the experimental ML-DSA support. Make sure it precedes any other PubkeyAcceptedAlgorithms settings! On Fedora it was conflicting with a setting injected by a file in the dropin directory /etc/ssh/sshd_config.d which pulled in some crypto policy settings; sshd would respect the new setting only after moving up its load precedence before that file.

With this setting in place it would finally let me log in:

debug1: Will attempt key: /home/phg/.ssh/id_mldsa44_ed25519 MLDSA44-ED25519 SHA256:EeCbFJtbklFycxqiCXgFuL68zHNktifH0C3O28HdMSc explicit agent
debug1: Offering public key: /home/phg/.ssh/id_mldsa44_ed25519 MLDSA44-ED25519 SHA256:EeCbFJtbklFycxqiCXgFuL68zHNktifH0C3O28HdMSc explicit agent
debug1: Server accepts key: /home/phg/.ssh/id_mldsa44_ed25519 MLDSA44-ED25519 SHA256:EeCbFJtbklFycxqiCXgFuL68zHNktifH0C3O28HdMSc explicit agent

Wireguard

Being a single-algorithm protocol by design, the security of Wireguard’s key exchange will fall with that of Ed25519. NSA and Cloudflare hint at the security margin of 256 bit EC being too low.

Jason, Wireguard’s creator, acknowledged the tough spot the protocol might be in in a post on the list. Until Wireguard receives an update with PQ key exchange support it is recommended to add a pre-shared key to the asymmetric Ed25519 key. The trick is to distribute that PSK over a quantum-safe method like the OpenSSH we set up above.

TLS

Let’s Encrypt, everyone’s favorite CA, are working with the IETF to getting Merkle Tree Certificates standardized. There is no way of obtaining an ML-DSA cert just yet.

Earlier this year LE announced they’d enter a beta phase for MTC by the end of 2026, preparing a full adoption during 2027. Today’s announcement (linked above) now puts a more precise rollout date on this: February 2027. The shortened lifetime of only 64 days is gonna spice it up some more.

Miscellaneous

This doesn’t apply to this machine in particular, just a few things I realized while researching the above: