openssl post quantum openssl post quantum cryptography openssl 3.5 ml-kem

OpenSSL post-quantum: ML-KEM, ML-DSA and SLH-DSA in 3.5

Adrian Maverick · · 8 min read

OpenSSL added post-quantum cryptography in version 3.5.0, released April 8, 2025: ML-KEM for key exchange, and ML-DSA and SLH-DSA for signatures, all built in with no extra provider. The same release made the hybrid group X25519MLKEM768 the first choice in OpenSSL's default TLS 1.3 group list, so two OpenSSL 3.5 endpoints use post-quantum key exchange without any configuration.

Below: which versions have it, what changed by default, how to test a server with s_client -groups, and the key commands for ML-DSA, ML-KEM and SLH-DSA. Every command comes from the OpenSSL 3.5 manual pages, and we ran each one today.

Which OpenSSL versions are post-quantum

Any supported OpenSSL release has it. The OpenSSL downloads page lists three supported branches today:

Branch Latest release End of life
4.1 4.1.1 November 23, 2027
4.0 4.0.4 May 14, 2027
3.5 (LTS) 3.5.10 April 8, 2030

The page adds that "All versions not listed above are out of support." That includes 3.0, which Debian 12 and Ubuntu 24.04 still ship and which has no ML-KEM. Check yours:

openssl version
openssl list -kem-algorithms

If the second command lists ML-KEM-768, you have it. On macOS, /usr/bin/openssl on the Mac we tested was LibreSSL 3.3.6, not OpenSSL, so install a current OpenSSL for these tests.

What the main server distributions ship, from their package sites today:

Distribution OpenSSL
Debian 13 (trixie) 3.5.9
Ubuntu 26.04 LTS 3.5.5
Debian 12 (bookworm) 3.0.22
Ubuntu 24.04 LTS 3.0.13

What OpenSSL 3.5 added

The 3.5 release notes list "Support for PQC algorithms (ML-KEM, ML-DSA and SLH-DSA)." From the manual pages:

Algorithm Standard What it does Variants in OpenSSL
ML-KEM FIPS 203 Key encapsulation (key exchange) ML-KEM-512, ML-KEM-768, ML-KEM-1024
ML-DSA FIPS 204 Signatures ML-DSA-44, ML-DSA-65, ML-DSA-87
SLH-DSA FIPS 205 Hash-based signatures 12 sets: SHA2 or SHAKE, 128/192/256, s (small) or f (fast)

ML-KEM and ML-DSA keys are implemented in both the default and FIPS providers, per their manual pages.

For TLS, OpenSSL 3.5 added three hybrid groups that pair a classical curve with ML-KEM, and the pure ML-KEM groups also appear in its TLS 1.3 list:

TLS group IANA code Key exchange message size
X25519MLKEM768 4588 roughly 1,200 bytes
SecP256r1MLKEM768 4587 roughly 1,200 bytes
SecP384r1MLKEM1024 4589 close to 1,700 bytes

The sizes are from OpenSSL's group list documentation, which says the hybrids offer "CPU performance comparable to the associated ECDH group." SecP384r1MLKEM1024 is the exception: "substantially more CPU-intensive." Of the three, IANA marks only X25519MLKEM768 as Recommended.

The default TLS groups changed

This is the change most people get without noticing. OpenSSL's SSL_CONF_cmd page says: "Starting with OpenSSL 3.5, the hybrid algorithm X25519MLKEM768 is first in this default list." The release notes add that clients now send key shares for both X25519MLKEM768 and X25519 by default.

So an OpenSSL 3.5 client talking to an OpenSSL 3.5 server negotiates X25519MLKEM768 unless someone has pinned a group list. To see every group your build supports:

openssl list -tls1_3 -tls-groups

On our build the ML-KEM groups appear only in the TLS 1.3 list, not with -tls1_2. Post-quantum key exchange needs TLS 1.3.

How to test a server with s_client -groups

openssl s_client -connect example.com:443 -servername example.com -groups X25519MLKEM768 -brief </dev/null

Why this works: the docs say "the first group listed will also be used for the key_share sent by a client." With one group listed, the client offers nothing else, so the server either accepts the hybrid or fails. Against a server with support, our test printed:

Negotiated TLS1.3 group: X25519MLKEM768

Without support, the handshake failed with ssl/tls alert handshake failure and SSL alert number 40.

Two variations worth knowing:

  • Test the ML-KEM-1024 hybrid with -groups SecP384r1MLKEM1024. Support for one hybrid does not mean support for the others. In our test, a large CDN accepted X25519MLKEM768 and refused SecP384r1MLKEM1024.
  • Test what real clients get by dropping -groups. OpenSSL then sends its default key shares and the server picks.

The same check works on mail and other TLS services with -starttls. For browser checks, curl, and a loop for a whole host list, see how to check if a website uses post-quantum encryption. To turn it on for your own web server, see how to enable post-quantum TLS in nginx.

How to generate ML-DSA keys and sign

From the genpkey and pkeyutl manual pages:

openssl genpkey -algorithm ML-DSA-65 -out mldsa65.pem
openssl pkey -in mldsa65.pem -pubout -out mldsa65_pub.pem
openssl pkeyutl -sign -in file.txt -inkey mldsa65.pem -out sig
openssl pkeyutl -verify -in file.txt -pubin -inkey mldsa65_pub.pem -sigfile sig

The last line printed "Signature Verified Successfully" in our test, and the ML-DSA-65 signature was 3,309 bytes. Swap in ML-DSA-44 or ML-DSA-87 for the other levels. Per the ML-DSA manual page, public keys are 1,312, 1,952 or 2,592 bytes, and the three levels map to security categories 2, 3 and 5.

ML-DSA signs the raw message with no hashing step first. The pkeyutl page also documents -pkeyopt context-string:example if your protocol uses a context string; use the same one to verify.

Seed format. By default OpenSSL keeps the 32-byte seed in the private key file. If another tool needs the expanded FIPS 204 key instead, the manual gives:

openssl genpkey -provparam ml-dsa.retain_seed=no -algorithm ml-dsa-65 -out priv-only.pem

ML-KEM and SLH-DSA commands

ML-KEM key pair, then encapsulate with the public key and decapsulate with the private key:

openssl genpkey -algorithm ML-KEM-768 -out mlkem768.pem
openssl pkey -in mlkem768.pem -pubout -out mlkem768_pub.pem
openssl pkeyutl -encap -inkey mlkem768_pub.pem -pubin -out ciphertext -secret shared_secret.bin
openssl pkeyutl -decap -inkey mlkem768.pem -in ciphertext -secret decapsulated_secret.bin

The two secret files matched in our test. Use ML-KEM-1024 for the highest level.

SLH-DSA, from the pkeyutl page:

openssl genpkey -algorithm SLH-DSA-SHA2-128s -out slh-dsa.pem
openssl pkeyutl -sign -in file.txt -inkey slh-dsa.pem -out sig

How to stop sending the X25519MLKEM768 key share

People search for "openssl disable x25519mlkem768" because of one documented side effect. OpenSSL's docs say the larger ClientHello "may no longer fit in a single TCP segment," and "firewall software may erroneously disrupt the TLS handshake."

The docs give the fix: prepend ?X25519MLKEM768: to the default list, without a *. The group then stays supported, but the client stops predicting its key share, and only servers that specifically prefer it will ask for it:

openssl s_client -connect example.com:443 -groups '?X25519MLKEM768:DEFAULT'

To remove the group entirely, the - prefix drops it: DEFAULT:-X25519MLKEM768. In our test against a server that prefers the hybrid, the first string still ended in X25519MLKEM768, after the server asked for it, and the second fell back to Peer Temp Key: X25519, 253 bits. The same strings work wherever OpenSSL takes a Groups setting. Treat this as a workaround for a broken middlebox. Fixing the middlebox keeps you protected.

Gotchas

  • Patch within the branch. OpenSSL 3.5.6 fixed CVE-2026-2673, which lost the group tuple structure when DEFAULT was used in a server-side group list.
  • Apps can bundle their own OpenSSL. A language runtime or a static binary may not use the system library. Check each one.
  • Certificates are a separate step. ML-KEM in the handshake protects against harvest now, decrypt later. Your RSA or ECDSA certificate still authenticates the server.

Frequently asked questions

Does OpenSSL 3.0 support ML-KEM?

No. ML-KEM, ML-DSA and SLH-DSA arrived in 3.5.0. OpenSSL's downloads page also lists 3.0 as out of support.

What does OpenSSL use by default for post-quantum TLS?

X25519MLKEM768, which combines X25519 with ML-KEM-768. It is first in the default TLS 1.3 group list from 3.5.

Can OpenSSL do ML-KEM-1024 in TLS?

Yes. OpenSSL 3.5 includes SecP384r1MLKEM1024 and a pure MLKEM1024 group. The server and client both have to support the group you pick, so test before you rely on it.

Do I need oqs-provider for post-quantum in OpenSSL?

No, not for ML-KEM, ML-DSA or SLH-DSA on 3.5 or later. The manual pages say ML-KEM and ML-DSA are implemented in the default provider, genpkey lists them as built-in algorithm names, and the SLH-DSA commands above need no extra provider.

Is ML-KEM still safe after the Anthropic lattice papers?

Yes. Anthropic's own repository says the attack is not practical for ML-KEM's parameter sets. Our post on whether ML-KEM is broken has the details.

Where Secria fits

If mail is next on your list, Secria is a private workspace with Mail, Calendar, Drive and Pages, plus Secria VPN, in one account. Secria Mail uses ML-KEM-1024 with X25519 on every plan, the highest ML-KEM level in a hybrid, and Secria VPN adds an ML-KEM-1024 key to WireGuard on every connection. For teams of 3 or more it runs on your own domain. See how Secria encrypts your data.

For the deadlines driving all this, read the December 2026 post-quantum joint statement or our explainer on what post-quantum encryption is.

Secria fact-checks every post against primary sources. Spotted something wrong or out of date? Email hq@secria.me and we will correct it.