Library · |post-quantum⟩ The quantum-safe fix

Choosing post-quantum algorithms

Which algorithm and parameter set for which job, the cost in bytes and speed, certificates and PKI, tokens, HSMs and constrained devices.

NIST has published three post-quantum standards, with a fourth in preparation. The harder question for an architect is which of them goes where. Each algorithm has its own size, speed and maturity profile, and each protocol imposes its own limits. A choice that is right for a TLS handshake can be wrong for a smart card or a JWT in an HTTP header.

This article gives a default for each common use case, explains how to pick a parameter set, and spells out what the choice costs. It assumes you know the names. The NIST post-quantum standards introduces them if you do not.

A decision table by use case

The table gives a sensible default for each use case as of mid-2026, with the main constraint. Defaults are starting points. Your regulator, your vendors and your data lifetime may move you towards the larger sets.

Default algorithm choices by use case
Use caseDefault choiceMain constraint or caveat
TLS (key exchange)Hybrid X25519MLKEM768TLS 1.3 only; larger hellos. Widely deployed.[7]
SSHmlkem768x25519-sha256OpenSSH 9.9 or later; default from 10.0. Host and user keys stay classical for now.
VPN (IPsec)IKEv2 with an added ML-KEM exchange (RFC 9370)Both gateways must support it; check vendor firmware.
Internal PKI and mutual TLSML-DSA-65 certificates, in a private CA you controlEvery client and server library must parse and verify them. Test first.
Public web certificatesKeep ECDSA or RSA for now; use hybrid key exchangePublicly trusted CAs do not issue post-quantum certificates yet.
Code and firmware signingLMS or XMSS (SP 800-208); ML-DSA-87 for CNSA 2.0Stateful schemes need careful state management. Long device lifetimes make this urgent.
Document signing and timestampsML-DSA-65; SLH-DSA where very long validity mattersVerifier support in readers and signing platforms varies.
Tokens and JWTShort-lived tokens: stay with current algorithms and shorten lifetimes; ML-DSA when JOSE and COSE standards settleML-DSA signatures are 2.4 KB or more. Header limits matter.
Data at restAES-256Symmetric encryption needs no new algorithm; Grover's algorithm leaves 256-bit keys comfortable.
Key wrappingAES-256 key wrap; ML-KEM-768 or 1024 where public-key wrapping is requiredDepends on KMS and HSM support.
Payments and HSMsAsk the vendor; start with firmware and algorithm roadmapsValidation status and host command support vary by model.

The rows with the loosest answers show where the ecosystem is still catching up. They matter most for planning, because the hardest part of those migrations is waiting for others.

Choosing parameter sets

Each NIST algorithm has several parameter sets that trade size and speed against a security margin. NIST classifies them by category: 1, 3 and 5 are defined by comparison with the work needed to break AES-128, AES-192 and AES-256, and ML-DSA-44 sits at category 2. ML-KEM comes in three sizes: ML-KEM-512 (category 1), ML-KEM-768 (category 3) and ML-KEM-1024 (category 5).[1] ML-DSA has ML-DSA-44, -65 and -87 at categories 2, 3 and 5.[2]

For commercial work, category 3 is the common default: ML-KEM-768 and ML-DSA-65. That is what browsers, OpenSSL and OpenSSH use for hybrids. It leaves a comfortable margin over the best known attacks, and the sizes are manageable. Category 1 is acceptable where bandwidth is very tight and the data is short-lived. Category 5 suits long-lived secrets and mandated environments.

CNSA 2.0, the NSA's suite for national security systems, specifies ML-KEM-1024 and ML-DSA-87, LMS and XMSS for firmware and software signing, AES-256 and SHA-384 or SHA-512.[5] It does not allow category 3. If you supply the US national security community, or want to follow its choices, plan for the larger sets from the start. Moving from 768 to 1024 later is a code change in most libraries, but sizes and buffers then change too.

The cost in bytes and speed

Bytes, from the FIPS standards and common encodings. Bars use a logarithmic scale. FN-DSA is not yet a final standard.
AlgorithmUseSignature / ciphertextSize
X25519key exchange32
Ed25519signature64
ECDSA P-256signature64
RSA-2048both256
ML-KEM-512key exchange768
ML-KEM-768key exchange1,088
ML-KEM-1024key exchange1,568
FN-DSA-512signature666
ML-DSA-44signature2,420
ML-DSA-65signature3,309
ML-DSA-87signature4,627
SLH-DSA-128ssignature7,856
SLH-DSA-128fsignature17,088
Try it: compare classical and post-quantum key, ciphertext and signature sizes side by side.

The sizes below come from the standards.[1][2][3] Compare them with the classical values at the bottom.

Public key and ciphertext or signature sizes (bytes)
SchemeNIST categoryPublic keyCiphertext or signature
ML-KEM-76831,1841,088 (ciphertext)
ML-KEM-102451,5681,568 (ciphertext)
ML-DSA-4421,3122,420
ML-DSA-6531,9523,309
ML-DSA-8752,5924,627
SLH-DSA-SHA2-128s1327,856
SLH-DSA-SHA2-128f13217,088
SLH-DSA-SHA2-256s56429,792
FN-DSA-512 (Falcon-512)1897about 666 on average
RSA-2048classical, about 112-bit256256
ECDSA P-256classical, about 128-bit64about 64 to 72
X25519 / Ed25519classical, about 128-bit3232 / 64

FN-DSA, based on Falcon, is the smallest lattice signature, but it is in preparation as FIPS 206 and not yet a published standard. It also needs careful floating-point arithmetic for signing. Treat it as a later option.

On speed, the lattice schemes are fast. ML-KEM and ML-DSA operations are in the same broad range as elliptic-curve operations on current servers, and ML-KEM key exchange is competitive with X25519. RSA-2048 signing is slower than ML-DSA signing. SLH-DSA is the exception: signing is far slower than ML-DSA, and the “f” variants trade larger signatures for faster signing. For most systems, bandwidth and memory matter more than CPU time. High-volume signers, such as a signing service that issues millions of tokens a day, should benchmark on their own hardware before sizing a fleet.

Hash-based schemes have an unusual profile. Their security rests on hash functions only, which makes them the most conservative choice, and that is why CNSA 2.0 asks for LMS and XMSS in firmware signing.[4] The stateful schemes in SP 800-208 are efficient but require the signer never to reuse a one-time key, which means careful state handling in the HSM. Hash-based signatures covers this in detail.

Certificates and chain sizes

A TLS server sends a certificate chain, and the handshake adds a signature over the transcript. With elliptic curves the signature material is a few hundred bytes. With ML-DSA it grows to kilobytes.

A simple count shows the effect. A chain with a leaf certificate and one intermediate has two public keys and three signatures: the CA's signature on the leaf, the root's signature on the intermediate, and the server's own signature in the handshake. With ECDSA P-256 that is about 320 bytes of key and signature material. With ML-DSA-44 it is roughly 9,900 bytes (two 1,312-byte keys and three 2,420-byte signatures), and with ML-DSA-65 at least 13,800 bytes (two 1,952-byte keys and three 3,309-byte signatures). These are lower bounds, because real certificates carry names, extensions and, on the public web, certificate transparency proofs as well.

Larger chains increase handshake time on slow links, can exceed initial congestion windows, and raise memory use in embedded clients. In a private PKI you control the clients, can shorten chains and can test. That is why internal PKI and mutual TLS are the natural first place to adopt ML-DSA, and ML-DSA in X.509 is standardised in the IETF LAMPS working group.[9] Public web certificates are different. Publicly trusted CAs do not issue post-quantum certificates yet, and browsers are exploring other approaches, so for now the public web gets its protection from hybrid key exchange alone.

Practical steps for a private PKI: keep chains short, avoid unneeded intermediates, test every TLS library and appliance that must verify the certificates, and plan a dual-running period in which both classical and post-quantum chains are valid. Do not remove your classical roots until every dependent system has been tested.

Tokens: JOSE and COSE

JWTs are carried in HTTP headers and cookies. Web servers and proxies often limit a header to 8 KB or less. A JWT signed with ML-DSA-65 has a 3,309-byte signature that becomes about 4.4 KB after base64url encoding, before any claims. Tokens with several signed parts, or ones sent on every request, can exceed limits quickly.

The IETF is writing ML-DSA identifiers for JOSE and COSE.[8] As of mid-2026 they are drafts, and RS256, ES256 and PS256 remain the deployed algorithms. The QSC knowledge base marks this area as standard-pending.

Three ways to reduce the problem while you wait. Shorten token lifetimes, because a forged token is useful only while it is valid. Use opaque reference tokens that the resource server looks up, which moves size out of the request. And keep the algorithm in configuration so that you can switch when the standard is final. HMAC-signed tokens (HS256) are not affected by Shor's algorithm, though they require shared secrets, which suits some internal architectures.

HSMs and smart cards

Hardware sets the pace for many banks. A hardware security module (HSM) has fixed firmware, a validated cryptographic boundary and, often, a long service life. Support for ML-KEM and ML-DSA depends on the model and firmware version. Several vendors ship them in recent firmware, but the QSC knowledge base records HSM support as “check with vendor”, because status differs by model.

Questions to put to an HSM vendor: which post-quantum algorithms and parameter sets are in released firmware; whether the key can be generated and used inside the module; whether the algorithms are covered by a FIPS 140-3 validation; whether a firmware upgrade is a change to the validated module; what the host API looks like; and whether the performance sheets list the new algorithms.

Smart cards and secure elements have the tightest limits. Small RAM, short command buffers and slow processors make multi-kilobyte keys and signatures awkward. Many card programmes will rely on symmetric cryptography, on hash-based signatures, or on a later generation of chips. Payment cards and PIN processing use symmetric algorithms such as AES for much of their security, which Grover's algorithm weakens but does not break at 128 bits and above. The parts to examine closely are key establishment, issuer certificate chains and the signed data in offline authentication.

FIPS 140-3 and validation

FIPS 140-3 is the US standard for cryptographic modules, and the Cryptographic Module Validation Program (CMVP) validates products against it.[10] Many regulated buyers require validated modules. Two separate things matter here. An algorithm can be tested for correct implementation, and a whole module can be validated, with its boundary, roles and self-tests.

Standards published in August 2024 take time to reach validated products. A library that implements ML-KEM correctly is not a validated module until a lab has tested it and NIST has listed the certificate. Check the validation entry for the version you will run. Open prototyping libraries such as liboqs say plainly that they are for research and prototyping, and are not FIPS-validated.[11] Plan for a period in which your policy asks for a validated module and none exists for the algorithm you need. Decide in advance who may approve a documented exception.

Libraries and runtimes, as of mid-2026

The table summarises the QSC knowledge base as of October 2026. Confidence labels come from there. Where it says verify, check the vendor's documentation for your exact release. The live version is on the readiness tracker.

Post-quantum support in libraries and runtimes
Library or runtimeML-KEM and ML-DSATLS hybrid key exchangeConfidence
OpenSSLML-KEM, ML-DSA and SLH-DSA from 3.5.0X25519MLKEM768 in the default key shares from 3.5High
Java (OpenJDK)ML-KEM (JEP 496) and ML-DSA (JEP 497) from JDK 24Reported for a later JDK (JEP 527); verifyMedium
Gocrypto/mlkem from 1.24; ML-DSA not in the standard library at reviewDefault in crypto/tls from 1.24High
Python (pyca/cryptography)ML-KEM and ML-DSA in recent releases; needs a PQC-capable OpenSSLVia the ssl module on OpenSSL 3.5 or laterHigh
.NETML-KEM, ML-DSA and SLH-DSA types in .NET 10; needs OpenSSL 3.5 or later on Linux or a recent Windows CNGDepends on the operating system's TLS stack; verifyMedium
Bouncy Castle (Java)FIPS 203, 204 and 205 names from 1.79Not a TLS stack in this tableMedium
BoringSSL, AWS-LC, rustlsAvailable; verify ML-DSAAvailableMedium
Node.jsVendor-check; pure-JS alternatives existWhen the bundled OpenSSL is 3.5 or laterLow
liboqs (Open Quantum Safe)Preview; for prototyping, not FIPS-validatedVia oqs-provider for experimentsHigh

Low-confidence rows are reported, not verified, so treat them as pointers. The JDK 24 entries come from the OpenJDK enhancement proposals.[12] Use liboqs to prototype interoperability, to try larger parameter sets, and to build test servers that your clients can talk to, but do not ship it as the production cryptographic library for a regulated service.

What to do now

  1. Inventory by use case. Run qsc scan over code, configuration, certificates and endpoints, and export the CBOM. Group the findings by the rows of the decision table above.
  2. Set defaults. Adopt ML-KEM-768 in a hybrid and ML-DSA-65 as your commercial baseline. Write down who decides when a system needs the category 5 sets.
  3. Start where you control both ends. Internal service-to-service TLS and private PKI are the safest places to learn.
  4. Test sizes. Check header limits, buffers, certificate-chain handling and smart-card commands against the numbers in this article.
  5. Send vendors the questions. HSMs, network equipment and payment platforms are the long poles. NIST’s draft transition guidance proposes that quantum-vulnerable public-key algorithms be deprecated after 2030 and disallowed after 2035, which leaves a hardware refresh cycle or two.[6]
  6. Prove progress. Re-scan with --baseline after each change and keep the diff as evidence.

Related reading: Hybrid key exchange in TLS, SSH and VPNs, The NIST post-quantum standards, Hash-based signatures and The post-quantum migration playbook.

Sources

  1. NIST. FIPS 203: Module-Lattice-Based Key-Encapsulation Mechanism Standard. 2024-08-13. https://csrc.nist.gov/pubs/fips/203/final
  2. NIST. FIPS 204: Module-Lattice-Based Digital Signature Standard. 2024-08-13. https://csrc.nist.gov/pubs/fips/204/final
  3. NIST. FIPS 205: Stateless Hash-Based Digital Signature Standard. 2024-08-13. https://csrc.nist.gov/pubs/fips/205/final
  4. NIST. NIST SP 800-208: Recommendation for Stateful Hash-Based Signature Schemes. October 2020. https://csrc.nist.gov/pubs/sp/800/208/final
  5. NSA. Announcing the Commercial National Security Algorithm Suite 2.0. September 2022. https://media.defense.gov/2022/Sep/07/2003071834/-1/-1/0/CSA_CNSA_2.0_ALGORITHMS_.PDF
  6. NIST. NIST IR 8547 (initial public draft): Transition to Post-Quantum Cryptography Standards. 2024-11-12. https://csrc.nist.gov/pubs/ir/8547/ipd
  7. IETF TLS Working Group. Post-quantum hybrid ECDHE-MLKEM key agreement for TLSv1.3 (draft-ietf-tls-ecdhe-mlkem). Internet-Draft, in progress. https://datatracker.ietf.org/doc/draft-ietf-tls-ecdhe-mlkem/
  8. IETF COSE Working Group. ML-DSA for JOSE and COSE (draft-ietf-cose-dilithium). Internet-Draft, in progress. https://datatracker.ietf.org/doc/draft-ietf-cose-dilithium/
  9. IETF. IETF LAMPS working group documents (ML-DSA in X.509). https://datatracker.ietf.org/wg/lamps/documents/
  10. NIST. Cryptographic Module Validation Program. https://csrc.nist.gov/projects/cryptographic-module-validation-program
  11. Open Quantum Safe. Open Quantum Safe project (liboqs, oqs-provider). https://openquantumsafe.org/
  12. OpenJDK. JEP 496: Quantum-Resistant Module-Lattice-Based Key Encapsulation Mechanism. https://openjdk.org/jeps/496