Post-Quantum JWTs: Rotating Token Signing to ML-DSA JWKS

Your identity platform signs every access token with a classical key, and the day you change that key’s algorithm is the day you discover how many verifiers you actually have.

Rotating a signing key is routine. Rotating the signing algorithm is not. A JWT is a contract between one issuer and an unknown number of consumers, and verification is distributed across every service, gateway, sidecar and mobile client that validates a token. If your authorisation server starts signing with ML-DSA before those consumers can verify an ML-DSA signature, everyone holding a freshly issued token is locked out. This is not really a cryptography problem. It is a rollout-coordination problem wearing a cryptography badge, and the way it goes wrong is a coordinated outage rather than a broken cipher.

The driver is not harvest-now-decrypt-later

It is worth being honest about why you are doing this, because the honest answer changes the urgency. Signatures are not confidentiality. A token signed today and forged by a quantum adversary in 2035 is worthless, because it expired minutes after it was issued. Short-lived access tokens have no harvest-now-decrypt-later exposure the way encrypted-at-rest data does. What does carry exposure is anything long-lived that a signature underwrites: a signing key that stays trusted for years, a federation trust anchor, a token used for a durable grant. So the real drivers are crypto-agility, regulatory and procurement mandates, and the trust anchors that outlive individual tokens, not a race against a decryption clock. That distinction lets you stage the work deliberately instead of stampeding.

Free · 4 minutes

Would you survive contact with a determined attacker — or an auditor?

Fourteen questions on access, patching, detection, and recovery — the basics that prevent most real incidents, and the ones most often assumed rather than verified. Banded finding on screen, full sheet by email.

What RFC 9964 actually gives you

ML-DSA is the module-lattice signature scheme finalised by NIST as FIPS 204 in August 2024. Until recently, expressing it in a JWT was bespoke, because JOSE had no registered way to name the algorithm or represent the key. RFC 9964, published in May 2026 as a Proposed Standard, closes that gap. It registers three JOSE alg values — ML-DSA-44, ML-DSA-65 and ML-DSA-87 — and defines a new JWK key type, AKP (Algorithm Key Pair), that carries the public key in a pub member and, for private keys, a seed in priv. There is no crv member; the algorithm identity lives in alg. That standardisation matters because it means every verifier library can converge on the same wire format instead of each vendor inventing its own, which is the precondition for a rotation that works across a mixed estate.

The rotation is a three-phase overlap

A JWKS endpoint exists precisely so that keys can change without redeploying every consumer. Exploit that. The rotation has three phases, and the overlap between them is the whole game.

  1. Publish, do not sign. Add the ML-DSA public key to your JWKS alongside the existing RSA or EC key, each with its own distinct kid. Keep signing with the classical key. Verifiers fetch the updated set and now hold both keys, ready to accept either.
  2. Flip the signer. Once you have evidence that every verifier has refreshed its JWKS cache and that its library actually understands the AKP key type and the ML-DSA algorithm, switch the issuer to sign with the new kid. New tokens now carry alg: ML-DSA-65 and select the ML-DSA key by kid. The classical key stays published so tokens already in flight still verify.
  3. Retire the old key. After the longest token lifetime plus the longest JWKS cache lifetime has elapsed — so no valid classical-signed token can still be in circulation — remove the old key from the set.

Skip phase one and you sign with a key nobody has yet. Skip the wait in phase three and you revoke a key that live tokens still depend on. Both are self-inflicted outages.

The JWKS during the overlap

This is what your published key set looks like in phase one and two — a classical key for signatures still in flight, and the ML-DSA key that will take over. The distinct kid on each is what lets a verifier pick the right key deterministically rather than guessing.

{
  "keys": [
    {
      "kty": "RSA",
      "use": "sig",
      "alg": "RS256",
      "kid": "2026-rsa-01",
      "n": "0vx7agoebGcQSuu...truncated-base64url...",
      "e": "AQAB"
    },
    {
      "kty": "AKP",
      "use": "sig",
      "alg": "ML-DSA-65",
      "kid": "2026-mldsa-01",
      "pub": "gWVvR5Zx3kQm7...truncated-base64url..."
    }
  ]
}

# Verifier rules that make this safe during the overlap:
#  - select the key by the token header 'kid', never by trial
#  - keep an explicit 'alg' allowlist; during rollover it holds
#    BOTH RS256 and ML-DSA-65, and never the value 'none'
#  - only advance to signing with 2026-mldsa-01 once every
#    consumer has proven it can verify an ML-DSA token

The compatibility traps that catch people

Library support is the gate, not the cipher. Many JWT libraries hardcode which algorithms they will accept, and a build without ML-DSA support will simply throw on an unknown alg. Every consumer — not just the ones you own — has to be inventoried and tested before phase two. If you have not mapped where token verification actually happens, an automated cryptographic inventory is the honest starting point.

The algorithm allowlist must widen, then narrow. Verifiers should validate against an explicit list of accepted algorithms. During the overlap that list contains both the classical and the ML-DSA identifier; a lazy “accept anything the header claims” reopens the classic algorithm-confusion vulnerability. Widen it deliberately for the migration, then narrow it back to ML-DSA once the old key retires.

Cache lifetimes decide your timeline. A verifier that caches the JWKS for a day will not see the new key for a day. Phase one has to outlast the longest cache any consumer uses, and phase three has to outlast token lifetime plus that cache. Publish sane cache headers on the JWKS endpoint and know what your clients honour.

Tokens get large. An ML-DSA-65 signature is a few kilobytes, against tens of bytes for an EdDSA or ECDSA signature and 256 bytes for RSA-2048. That inflates the token, and inflated tokens run into the common eight-kilobyte HTTP header limits, cookie-size ceilings and proxy buffers that nobody sized for post-quantum signatures. Measure a real ML-DSA token against your gateways and browsers before you cut over, not after.

None of these are new cryptographic risks. They are the same rollover discipline that a crypto-agility layer is meant to make routine, and the same staged-parallel approach that governs post-quantum code signing and PKI. The signing algorithm is just the one place where getting the sequencing wrong logs everyone out at once.

Rotate the key set first, prove the verifiers, and only then move the signer. Do it the other way round and the incident review will not be about lattices — it will be about a kid nobody was ready for.

Build and rescue work

Hands-on delivery of this kind is handled by Sixteen Pillars Studio.

Free interactive tool

Website compliance checklist

What your site has to do, based on what it actually does

Answer as much or as little as you like — the list builds as you go. Nothing is stored against your name and no email is required.

Can you trust the architecture you have?

Architecture diagrams rarely show the reality of how systems actually operate. An independent review establishes what is really there.