Skip to content

Post-quantum cryptography: what ML-KEM and ML-DSA change for an app

18 Nov 2026

·

8 minute read

For most web applications, post-quantum cryptography arrives in two parts with very different effort. Key exchange is already moving without you: when we tested 15 well-known sites on 14 November 2026, 12 negotiated a post-quantum hybrid key exchange, including this one, which we never configured for it. Signatures are the harder part, and the reason is size, not speed. In our measurements ML-KEM ran about as fast as the X25519 key exchange it supplements, while its keys were more than 30 times larger, and an ML-DSA signature can be too big for places where application code has quietly assumed small signatures, such as a token stored in a cookie.

What ML-KEM and ML-DSA replace

NIST published the first two general-purpose post-quantum standards on 13 August 2024. FIPS 203 specifies ML-KEM, a key-encapsulation mechanism: the job two parties do at the start of a connection to agree on a shared secret, which elliptic-curve Diffie-Hellman (X25519) or RSA key transport does today. FIPS 204 specifies ML-DSA, a digital signature algorithm, the job RSA, ECDSA and Ed25519 do today for certificates, software updates and signed tokens.

Each comes in three parameter sets with rising security: ML-KEM-512, 768 and 1024, and ML-DSA-44, 65 and 87. Both are based on lattice problems that are believed to stay hard for quantum computers, which break the factoring and discrete-logarithm problems that RSA and elliptic curves rely on.

Speed is not the problem

We measured every algorithm with Node.js 25.8 and its bundled OpenSSL 3.6.3 on an Apple M4 laptop, single-threaded, averaging 2,000 runs of each operation. Times are in microseconds.

AlgorithmGenerate keysEncapsulate or signDecapsulate or verify
ML-KEM-51217.813.318.3
ML-KEM-76826.319.127.9
ML-KEM-102440.223.233.5
X25519 (key agreement)17.919.519.4
ML-DSA-4447.7249.750.1
ML-DSA-6585.6399.575.5
ML-DSA-87119.6465.5118.9
Ed2551917.819.042.1
ECDSA P-25614.314.735.7
RSA-204822,884344.111.1
RSA-307282,119984.021.1

Bar chart of post-quantum cryptography speed in microseconds. ML-KEM-768 encapsulation took 19.1, about the same as X25519 at 19.5; ML-DSA signing took 250 to 466; RSA-3072 signing took 984.

ML-KEM-768, the parameter set the current TLS hybrids use, took 19 to 28 microseconds per operation against about 19 for X25519. On a server handling a new connection, that difference disappears into the network round trip. ML-DSA signing is slower than the elliptic-curve schemes, at 250 to 466 microseconds, but faster than RSA-3072 signing, and ML-DSA key generation takes well under a millisecond where an RSA-3072 key took 82 milliseconds. Verification, the operation most systems do far more often, stayed between 50 and 119 microseconds.

None of these numbers would change an architecture. The next table might.

Size is the problem

AlgorithmPublic key (bytes)Ciphertext or signature (bytes)
ML-KEM-7681,1841,088
X255193232
ML-DSA-441,3122,420
ML-DSA-651,9523,309
ML-DSA-872,5924,627
Ed255193264

Bar chart comparing post-quantum and classical key sizes. ML-KEM-768 has a 1,184-byte public key against 32 bytes for X25519; an ML-DSA-65 signature is 3,309 bytes against 64 bytes for Ed25519.

An ML-KEM-768 public key is 37 times the size of an X25519 key. An ML-DSA-65 signature is about 52 times the size of an Ed25519 signature. Bandwidth is rarely the issue at these sizes on a web connection. Fixed limits are, because a great deal of software was written assuming a signature fits in a few dozen bytes.

Take the most common example in web applications: a signed session token, such as a JWT, kept in a browser cookie. The token carries its signature encoded as base64url, which grows it by a third. An Ed25519 or ES256 signature adds 86 characters. An ML-DSA-65 signature adds 4,412 characters before the header or any claims. The cookie standard, RFC 6265, only asks browsers to support at least 4,096 bytes per cookie, counting the name, value and attributes together. A token signed with ML-DSA-65 does not fit in the space browsers are guaranteed to give it, and ML-DSA-44, at 3,227 characters for the signature alone, leaves very little room for anything else.

The same arithmetic applies wherever signatures travel through a fixed-size slot: HTTP header size limits on proxies and load balancers, database columns sized for old signatures, QR codes, Bluetooth and low-power radio packets, and firmware images for small devices, where a signature that was 64 bytes becomes several kilobytes. Each of these is a place to measure before you migrate, because the failure is often a truncated value or a rejected request, not an error message that mentions cryptography.

Our site already uses post-quantum key exchange

We used OpenSSL 3.5's command-line client to connect to 15 sites, offering the hybrid group X25519MLKEM768 first and classical X25519 as a fallback, and recorded what each server chose.

Negotiated X25519MLKEM768Negotiated X25519 only
elrootlabs.com, google.com, cloudflare.com, microsoft.com, apple.com, anthropic.com, openai.com, hostinger.com, www.nist.gov, www.meity.gov.in, www.hdfcbank.com, www.npci.org.ingithub.com, amazon.com, www.onlinesbi.sbi

That is one connection per site from one location in India at one moment, and large sites run many front ends, so treat it as a snapshot. It is still telling. This site negotiated a post-quantum hybrid without any change on our side, because the hosting layer in front of it supports it. Two days later the site moved to a different host, and when we checked again on 17 November it still negotiated X25519MLKEM768, again with no configuration on our part. Most of the post-quantum protection a typical web application gets in the next few years will arrive this way, through browsers, TLS libraries and hosting providers.

The hybrid combines X25519 with ML-KEM-768, so the connection stays secure if either algorithm holds. That protects today's traffic against an attacker who records it now and decrypts it once a large enough quantum computer exists. Our certificate, by contrast, is a classical ECDSA certificate, from Let's Encrypt before the move and from Google Trust Services after it. That is the expected state of things: a forged signature only helps an attacker who can forge it during the handshake, so authentication can migrate later than key exchange, and the certificate ecosystem is still working out how.

What to do in an application this year

The UK's National Cyber Security Centre gives the clearest public timeline: by 2028, define migration goals and complete a discovery exercise of everything that depends on cryptography; by 2031, carry out the highest-priority migrations; by 2035, complete migration of all systems (NCSC, PQC migration timelines). For an application team, the discovery step is the one to start now.

  1. List where your application uses cryptography directly, outside TLS: session and API tokens, signed URLs, encrypted fields in the database, backups, webhooks, and firmware or update signing for any device you ship.
  2. Rank them by how long the protected data must stay secret. Records that must stay confidential for ten years are exposed to the record-now, decrypt-later attack today. Session tokens that expire in an hour are not.
  3. Ask each provider in the chain, from hosting and CDN to identity and key management, what they already support. Some of your migration may already be done, as ours was.
  4. Test the size limits before anything else: cookies, headers, columns, packets and any QR or radio payloads. Generate a real ML-DSA signature and push it through.
  5. Make algorithms replaceable. Store an algorithm identifier next to every signature and ciphertext, and version your token formats, so the next change is a configuration change and not a data migration.
  6. Use your platform's implementations. Node, OpenSSL and the major cloud key services already ship these algorithms; writing your own is how side channels get in.

Devices deserve particular care, because a product shipped in 2027 with a ten-year life will still be running in 2037. If you are designing hardware now, decide how its firmware signatures will be upgraded before the board is final. We cover the wider hardware path in IoT prototype development in India.

AI tools

Ask ChatGPTAsk Claude

Start with the problem that matters