Security

Moving JWT, SSH, certificates and code signing off 256-bit ECC

Capy team

Moving authentication off 256-bit elliptic curves requires updating verifiers before signers across JWT issuers, SSH hosts and CAs, internal PKI, and code-signing pipelines. Where post-quantum signatures are not yet supported by your libraries or hardware, move as an interim step to P-384 or RSA-3072 using dual-key JWKS rotation, explicit algorithm allowlists, and updated cert-manager or Terraform templates. Move directly to ML-DSA (FIPS 204) where tooling supports it, including OpenSSH 10.6 ssh-mldsa44-ed25519 keys, RFC 9964 ML-DSA JWS keys, and PQ-capable CAs or firmware verifiers. Authentication is protected only after every old signing key and weak trust anchor is removed from verifiers.

Enabling hybrid key exchange on TLS 1.3 with X25519MLKEM768 protects encrypted traffic in transit while leaving every JWT signer, SSH host key, internal CA, and software-signing pipeline on 256-bit elliptic curves. Many post-quantum cryptography (PQC) roadmaps pushed authentication to a later phase because harvest-now-decrypt-later attacks hit confidentiality first. The December 2 joint statement from ONCD, NSA and CISA noted that recent cryptographic advances disclosed by frontier AI companies "do not present an immediate and widespread threat", yet the accompanying guidance put certificate authorities, signing keys, and credentials straight into the immediate action list.

Why authentication moved up in the PQC order

In NSA's advisory, Immediate Actions to Push Toward Post-Quantum (PP-26-4956), authentication sits right behind inventory and TLS. Step 3 directs teams to stand up PQC Certificate Authorities and roots of trust, and Step 4 directs them to replace or reconfigure certificates, PKI, and code signing. Step 1 flags algorithms outside CNSA 2.0 and CNSA 1.0, which rules out P-256 and EdDSA, meaning Ed25519 in practice, across key establishment, signatures, and certificates.

In his December 2 analysis, Filippo Valsorda wrote that post-quantum authentication "went from a later thing to a now thing". His reading of the advisory is that 256-bit elliptic curves, including P-256, X25519, and Ed25519, are "likely broken or significantly weaker than we thought", that P-384 and RSA-3072 are stopgaps rather than destinations, and that ML-KEM (FIPS 203) and ML-DSA (FIPS 204) are what teams should adopt immediately. He also pointed out that authentication is secure only once you have no vulnerable trust anchors left. A TLS server can upgrade one handshake at a time, whereas a verifier that still trusts one legacy 256-bit ECC root or signing key remains open to forgery against that anchor.

Standards timelines push the same direction. NIST IR 8547 deprecates RSA, ECDSA, EdDSA, DH, and ECDH after 2030 and disallows them after 2035, replacing classical digital signatures with ML-DSA and SLH-DSA (FIPS 205). The NSA press release warns that firmware signatures and hardware roots of trust are hard to update during a device's lifetime, so procurement should require quantum-resistant hardware now. Before rotating any key, build an inventory across your repositories and infrastructure with the RSA and ECC codebase scanning guide.

Migrating JWT and JWS signing off ES256 and EdDSA

Audit every identity provider, auth gateway, webhook signer, and API verifier for ES256 on P-256, EdDSA on Ed25519, and RS256 backed by 2048-bit keys. Check the actual key behind every RS256 issuer, because RS256 identifies RSASSA-PKCS1-v1_5 with SHA-256 without fixing the RSA key length, and 2048-bit keys are common.

Where your runtime JOSE libraries do not support ML-DSA yet, move off ES256 and EdDSA as an interim step to ES384 on P-384, or to PS384 or RS256 backed by RSA-3072 keys. Treat P-384 and RSA-3072 as stopgaps until ML-DSA support is ready across all issuers and verifiers.

Rotate live signing keys through a dual-key JWKS window so active tokens keep verifying:

  1. Generate the new signing key with a distinct kid and publish its public key in the JWKS endpoint alongside the existing key.
  2. Confirm that every verifying service refreshes its JWKS cache and accepts both the old and new kid and algorithm values.
  3. Switch the issuer to sign new tokens with the new key and kid.
  4. Wait for the maximum token lifetime, plus clock skew and your longest JWKS cache TTL, so every token signed by the old key expires.
  5. Remove the old key from the JWKS endpoint and remove ES256 or EdDSA from every verifier allowlist.

Verify every consumer's alg check during steps 2 and 5. Each verifier must enforce an explicit allowlist of accepted algorithms and reject any token whose header names an unapproved algorithm. Never trust the alg header from an incoming JWT to pick verification logic.

For the post-quantum target, IETF RFC 9964 registers the JWS algorithm names ML-DSA-44, ML-DSA-65, and ML-DSA-87 alongside the AKP (Algorithm Key Pair) JWK key type. An AKP public JWK carries kty, alg, and a base64url-encoded pub field, and omits priv. A public JWKS during a transition from an interim ES384 key to ML-DSA-44 looks like this, with key bytes truncated:

{
  "keys": [
    {
      "kid": "auth-es384-2026-12",
      "kty": "EC",
      "crv": "P-384",
      "alg": "ES384",
      "use": "sig",
      "x": "MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4...",
      "y": "4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM..."
    },
    {
      "kid": "auth-mldsa44-2027-01",
      "kty": "AKP",
      "alg": "ML-DSA-44",
      "pub": "unH59k4Ru...DZgbTP07e7gEWzw4MFRrndjbDQ"
    }
  ]
}

Account for two constraints before rolling out RFC 9964 tokens. Library support for AKP and ML-DSA still varies across ecosystems, so verify every service runtime before enabling ML-DSA issuance. Token sizes also grow. Per FIPS 204 and the RFC 9964 size table, an ML-DSA-44 signature is 2,420 bytes and its public key is 1,312 bytes, while ML-DSA-65 uses 3,309-byte signatures and 1,952-byte public keys and ML-DSA-87 reaches 4,627-byte signatures and 2,592-byte public keys. Base64url-encoded, one ML-DSA-44 signature adds roughly 3.2 KB to a compact JWT before headers or claims. That can push session cookies past the 4,096-byte browser limit and trips default 4 KB to 8 KB HTTP header caps in reverse proxies. Test header sizes early, or move browser sessions to opaque session identifiers backed by server-side storage.

Separating SSH key exchange from host, user, and CA keys

SSH splits cryptography into two layers. Key exchange protects session confidentiality, while host keys, user keys, and SSH certificates authenticate servers and callers. Upgrading key exchange blocks session recording attacks, while leaving authentication on ssh-ed25519, ecdsa-sha2-nistp256, or legacy ssh-rsa keys.

For key exchange, OpenSSH enabled post-quantum key agreement by default in 9.0 with sntrup761x25519-sha512 and made mlkem768x25519-sha256 the default in 10.0. Inspect what a build supports, then pin KexAlgorithms in sshd_config:

ssh -Q kex
ssh -Q key
KexAlgorithms mlkem768x25519-sha256,sntrup761x25519-sha512
WarnWeakCrypto yes

OpenSSH 10.1 added client warnings through WarnWeakCrypto whenever a connection negotiates a non-PQC key exchange. OpenSSH 10.6, released October 6, 2026, added WarnWeakCrypto to sshd_config on by default so servers log clients using classical key exchange. Read those logs to catch outdated CI runners and automation scripts before removing legacy KexAlgorithms.

For authentication, OpenSSH 10.6 enabled the hybrid ssh-mldsa44-ed25519 signature algorithm for host and user keys. Generate new keys once both clients and servers run 10.6 or newer:

ssh-keygen -t mldsa44-ed25519 -f ~/.ssh/id_mldsa44_ed25519

OpenSSH 10.4 shipped experimental composite keys with an @openssh.com suffix. OpenSSH 10.6 dropped that suffix, so you must regenerate any keys created with that experimental support and remove the old entries from authorized_keys, known_hosts, and host key directories.

Do not stop at bastion host keys and laptop keys. Two additional SSH inventories frequently remain on 256-bit curves:

  • SSH certificate authorities. If you issue short-lived SSH user or host certificates, generate new CA keys alongside the old ones, add both public keys to TrustedUserCAKeys and @cert-authority, reissue certificates from the new CA, and remove the old CA only after prior certificates expire.
  • Git signing and deploy keys. Developer Git commit signing keys, repository deploy keys, and CI SSH keys often sit on ed25519 or ecdsa-nistp256 for years. Rotate and revoke them across git hosts and CI secret stores once new keys are live.

Hardening internal PKI, cert-manager, Terraform, and KMS keys

Public WebPKI certificates follow external CA and browser timelines, while internal PKI for service-to-service mTLS, Kubernetes ingress, VPNs, and database client authentication is under your direct control. NSA Step 3 directs teams to stand up updated CAs and roots of trust and verify RSA-3072 or P-384 as the interim base size for roots, allowing RSA-2048 only where legacy systems require it. Move those CAs to ML-DSA as your PKI tooling and clients add support, and coordinate with your managed PKI provider if you do not operate your own roots.

In Kubernetes clusters running cert-manager, omitted privateKey fields default to 2048-bit RSA or 256-bit ECDSA. Set the algorithm and key size explicitly on every Certificate:

apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: payments-mtls
  namespace: payments
spec:
  secretName: payments-mtls-tls
  issuerRef:
    name: internal-p384-ca
    kind: ClusterIssuer
  privateKey:
    algorithm: ECDSA
    size: 384

Where older TLS clients reject P-384 certificates, set algorithm: RSA and size: 3072.

Check Terraform manifests next. The hashicorp/tls provider's tls_private_key resource defaults rsa_bits to 2048 when algorithm = "RSA" and permits P256 or ED25519. Pin interim keys explicitly to P-384 or 3072-bit RSA:

resource "tls_private_key" "internal_service" {
  algorithm   = "ECDSA"
  ecdsa_curve = "P384"
}

When using algorithm = "RSA", set rsa_bits = 3072 so the 2048-bit default never ships.

Audit managed KMS keys and HSM slots separately because their key specs live in cloud configuration and HSM policies rather than application code. Flag any signing key on P-256, Ed25519, or RSA-2048, and check your cloud KMS or HSM provider's current ML-DSA support directly before deciding between an interim P-384 or RSA-3072 rotation and a direct ML-DSA cutover.

Before cutting an internal CA over to ML-DSA, generate a test key with OpenSSL 3.5 or newer and feed it through your parsers, proxies, and CI scripts:

openssl genpkey -algorithm ML-DSA-65 -out test-mldsa65.pem

That quick check catches incompatible ASN.1 parsers and outdated runtime crypto bindings before you issue live certificates.

Updating code, container, and firmware signing

Software releases and device firmware carry the longest trust chains in most organizations. NSA Step 4 directs teams to re-sign software, firmware, and update packages with updated algorithms, install vendor updates so systems recognize future signatures, and remove old chains and trust anchors once the transition finishes.

Ship verifier updates first every time. If a device bootloader, container admission controller, or package manager does not already trust the new signing key and algorithm, switching your build pipeline bricks future updates. For container images and software packages, configure admission controllers and verifiers to accept both old and new signing identities during the overlap window, re-sign active releases, and delete the old key from verification policies once old images expire.

For firmware and software signing on constrained hardware, CNSA 2.0 allows stateful hash-based signatures, LMS and XMSS under NIST SP 800-208, alongside ML-DSA. Verification code for LMS and XMSS stays compact in bootloaders, though signing servers must track one-time key state so no signing index is ever reused.

Hardware roots of trust are the hardest boundary to cross. As the NSA press release notes, firmware signatures and hardware roots of trust are hard to update during a device's lifetime, so require PQ-capable verification and signing hardware when buying new devices. Put deployed hardware with immutable 256-bit ECC roots into your Step 6 mitigation plan with network isolation and a hardware refresh schedule.

Sequencing rollouts across services

Every signing migration follows the same five-step order, whether you are rotating a JWKS, an SSH CA, an internal PKI root, or a container signing key:

  1. Deploy verifier updates so every consumer trusts both the old key and the new key.
  2. Confirm that live verifiers picked up the new trust anchor, JWKS key, or algorithm allowlist.
  3. Switch the issuer, CA, or release pipeline to sign new tokens, certificates, or artifacts with the new key.
  4. Wait out the maximum lifetime of every credential signed by the old key, or reissue long-lived artifacts early.
  5. Remove the old trust anchor and disallow the old algorithm on every verifier.

Skipping step 5 leaves the migration incomplete because any remaining weak trust anchor can still authenticate forged credentials. Per NSA Step 4, record the owning team for every certificate, JWKS issuer, SSH CA, and signing pipeline so renewals and the later ML-DSA cutover stay aligned. For how Steps 3 and 4 fit into the full six-step rollout alongside TLS and inventory, see the post-quantum codebase migration guide.

Coordinating verifier-first rollouts with Capy

Updating JWT verifiers, cert-manager manifests, Terraform modules, and SSH configs across dozens of repositories is ordered, repetitive work where one missed consumer causes an outage. Teams executing that rollout on the Capy platform use the pilot-then-fan-out workflow from the multi-repository code migration guide, with a Captain running one thread per service repository.

Put the shared rules in the Captain's CREW.md file, specifying the target algorithms (ES384, RSA-3072, or ssh-mldsa44-ed25519), the verifier allowlist updates, and the test commands each repository must pass. Run the verifier wave first. Each thread works on an isolated cloud microVM with the repository cloned and Setup applied, updates the verifier code or IaC manifest, runs the repository's real test suite, and opens a pull request. Failing CI checks or review comments wake the owning thread so it pushes fixes to the same branch.

Add a Capy Review rule in each repository's AGENTS.md file to flag any new ES256, EdDSA, RS256 backed by keys under 3072 bits, P-256, or Ed25519 keys on future pull requests. For HSMs, firmware targets, and appliances that cannot change today, create Capy Issues with sub-issues where multiple teams are involved, recording the NSA Step 6 mitigation fields: product, affected algorithm, mission criticality, and path forward such as a plan of action and milestones, hardware refresh, or both.

A person owns the merge order and production cutover. Capy edits repositories, runs tests, reviews pull requests, and tracks Issues, while live key generation, CA issuance, and HSM administration stay in your PKI and key-management tooling. Because Capy never merges a pull request without explicit approval or a merge rule in AGENTS.md, the migration owner verifies that every verifier pull request has deployed before merging signer switches and final anchor-removal pull requests.

Frequently Asked Questions

Why does upgrading TLS to X25519MLKEM768 not protect JWTs, SSH keys, or certificates?+
Hybrid TLS 1.3 key exchange protects session confidentiality against traffic recording and later decryption, while JWT signatures, SSH keys, X.509 certificates, and code signatures protect identity and integrity. Each signing system uses its own keys and trust anchors outside the TLS key exchange. Leaving them on 256-bit elliptic curves leaves token verification, host authentication, and software updates exposed even when TLS handshakes negotiate ML-KEM.
How do you rotate JWT signing from ES256 to ES384 or ML-DSA without logging users out?+
Publish the new public key with a fresh kid in your JWKS endpoint alongside the existing key, and confirm that every verifier refreshes its cache and accepts both algorithms in its allowlist. Switch the issuer to sign new tokens with the new key, then wait for the maximum token lifetime plus clock skew and cache TTL to pass. Once every token signed by the old key has expired, remove the old key from the JWKS and drop ES256 from every verifier allowlist.
Will ML-DSA JWT signatures break HTTP headers or browser cookies?+
They can. An ML-DSA-44 signature is 2,420 bytes in raw form, which grows to roughly 3.2 KB after base64url encoding before adding the JWT header and claims. That size can exceed the 4,096-byte browser cookie limit and default 4 KB to 8 KB reverse-proxy header limits, so test token sizes and move session payloads server-side or raise proxy header buffers before switching cookies or Authorization headers to ML-DSA.
If OpenSSH already uses post-quantum key exchange, do I still need to rotate SSH keys?+
Yes. Post-quantum key exchange such as mlkem768x25519-sha256 protects session confidentiality, while host keys, user keys, and SSH CA keys authenticate servers and users. You still need to move off ssh-ed25519, ecdsa-sha2-nistp256, and legacy RSA keys by upgrading to OpenSSH 10.6 and generating ssh-mldsa44-ed25519 keys, and by rotating SSH CA keys, Git signing keys, and deploy keys.
Should I move internal PKI certificates to RSA-3072, P-384, or straight to ML-DSA?+
Move straight to ML-DSA where your CA, certificate libraries, and clients already support it. Where your stack cannot issue or verify ML-DSA yet, NSA Step 3 directs teams to use RSA-3072 or P-384 as the interim base size for roots, using RSA-2048 only where legacy compatibility forces it. Treat RSA-3072 and P-384 as stopgaps while preparing your PKI for ML-DSA.
How should teams handle firmware signing and hardware roots of trust that cannot be patched?+
Hardware roots of trust and device bootloaders are hard to change once deployed, so require post-quantum signing and verification support when buying new hardware. For deployed devices that cannot accept new roots or algorithms, record each product, its affected algorithm, its mission criticality, and a mitigation path such as network isolation or a hardware refresh schedule. When a device can take a firmware update, ship the verifier update first so it trusts the new signing key before signing future releases with it.

Sources

  1. CISA: Joint statement from ONCD, NSA and CISA on recent advances in cryptographic and cybersecurity capabilities
  2. NSA: NSA advises immediate transition to post-quantum cryptography
  3. NSA: Immediate Actions to Push Toward Post-Quantum (PP-26-4956)
  4. Filippo Valsorda: What to Make of the NSA Advisory
  5. NIST IR 8547: Transition to Post-Quantum Cryptography Standards
  6. IETF RFC 9964: ML-DSA for JOSE and COSE
  7. OpenSSH: Post-quantum cryptography
  8. OpenSSH 10.6 release notes
  9. Capy docs: Captains
  10. Capy docs: Reviews

Spotted something out of date? Tell us at support@capy.ai.