---
title: "Post-Quantum Cryptography Migration Guide for Modern Stacks"
author: "Bhavani Kalisetty"
date: 2026-12-03
canonical: https://rtrvr.ai/blog/post-quantum-cryptography-migration-guide
---

# Post-Quantum Cryptography Migration Guide for Modern Stacks

In the first two days of December 2026, three coordinated notices landed back to back. On December 1, the NSA published Cybersecurity Advisory [PP-26-4956](https://media.defense.gov/2026/Dec/01/2004039413/-1/-1/0/CSA_Immediate_Actions_Push_Toward_PQC.PDF), *Immediate Actions to Push Toward Post-Quantum Cryptography*. On December 2, the White House Office of the National Cyber Director, NSA, and CISA released a [joint statement](https://www.cisa.gov/news-events/news/joint-statement-recent-advances-cryptographic-and-cybersecurity-capabilities) calling for faster migration off vulnerable public-key algorithms. Hours later, Amazon, Anthropic, Apple, Cloudflare, Google, Microsoft, OpenAI, and Oracle published a [joint commitment](https://www.anthropic.com/news/joint-statement-post-quantum-cryptography) to accelerate post-quantum deployment across their platforms.

Engineering Slack channels split immediately into two extremes. Half the room asked whether AES-256 and Stripe webhook secrets were broken and needed rotating before Monday. The other half glanced at a green padlock on Vercel or Cloudflare, assumed the CDN solved post-quantum cryptography, and moved on.

Both instincts miss where real stacks actually break.

When you trace a single production request from a user's browser all the way through your cloud, containers, middleware, databases, signing keys, and developer laptops, the real exposure is rarely exotic math. It is quiet defaults: a Node 20 container silently stripping post-quantum key exchange from an OpenAI API call that already supports it, a managed Cloud Run URL serving a P-256 certificate you cannot swap, a two-year-old AWS load balancer stuck on a classical listener policy, or a JWK helper that leaks an RSA private key the moment you migrate off Ed25519.

This guide follows that request end to end. Every section pairs the underlying cryptographic rule with exact commands to test your own infrastructure today, honest notes on top hosting platforms, and a calm 30-day migration order.

## Why 256-bit elliptic curves moved to the front of the line

Most developers who learned modern cryptography in the 2010s were taught a simple habit: skip heavy RSA keys and default to 256-bit elliptic curves like `P-256`, `X25519`, and `Ed25519`. They are fast, compact, and clean against classical computers.

The December 2026 NSA advisory flips that classical hierarchy. As cryptographer [Filippo Valsorda analyzed](https://words.filippo.io/nsa-advisory/) right after the release, PP-26-4956 singles out **256-bit elliptic curves** (`P-256`, `X25519`, `Ed25519`, and `secp256k1`) as the first algorithms to exit, placing them below even `RSA-3072+`, `P-384`, and legacy `RSA-2048` fallback compatibility. Under Shor's algorithm, solving a 256-bit elliptic-curve discrete logarithm requires far fewer logical qubits than factoring a 3072-bit RSA modulus or attacking a 384-bit curve.

In plain engineering terms, every cryptographic primitive in your stack falls into one of four buckets:

1. **Exit first (256-bit ECC):** Bare `X25519` or `P-256` TLS key exchange, `ECDSA P-256` certificates and KMS keys, and `Ed25519` (`EdDSA`) app or SSH signing keys.
2. **Interim stopgaps (when peers lack PQC):** `RSA-3072` / `RSA-4096` and `ECDSA P-384` for signatures and certificates where verifiers cannot speak `ML-DSA` yet. Retain `RSA-2048` only where legacy compatibility forces it.
3. **Target NIST PQC:** Hybrid `X25519MLKEM768` (FIPS 203, [RFC 10024](https://datatracker.ietf.org/doc/rfc10024/)) for TLS 1.3 and SSH key exchange, plus `ML-DSA` (FIPS 204) for digital signatures.
4. **Unaffected symmetric primitives:** `AES-256-GCM`, `ChaCha20-Poly1305`, `HMAC-SHA256`, `SHA-256`, `SHA-384`, and `HKDF`. Leave them alone. Grover's algorithm does not break 256-bit symmetric keys or MACs in practice.

Keep one threat-model split in mind while prioritizing tickets:

- **Key exchange (TLS, SSH, VPN) matters right now.** Anyone capturing encrypted traffic today can store it and decrypt it later ("harvest now, decrypt later"). Flipping TLS 1.3 handshakes to `X25519MLKEM768` protects every future session immediately.
- **Signatures (JWTs, certificates, KMS, software releases) are an authenticity problem, not a retroactive decryption problem.** Recording a signature today does not let an attacker decrypt old traffic later. Focus first on **long-lived trust anchors, root keys, auth signers, and release pipelines**, and make sure verifiers support clean key rotation without downtime.

![Interactive post-quantum hop audit across a startup stack: Edge and CDN, Outbound APIs from containers, Data and Tunnels, and Auth and Signing.](https://rtrvr.ai/blog-delivery/post-quantum-cryptography-migration-guide/stack-hops.svg)

## Hop 1: Edges, CDNs, and cloud load balancers

Your request starts at the user's browser. Modern Chrome, Safari, and Firefox already offer `X25519MLKEM768` by default. Whether the connection actually uses it depends on what terminates TLS at your front door.

You can check any public domain in ten seconds from a laptop running OpenSSL 3.5+ (Homebrew `openssl@3` on macOS already ships 3.5+):

```bash
openssl s_client -connect api.yourdomain.com:443 -servername api.yourdomain.com -tls1_3 -brief </dev/null
```

Read two fields in the output:

- **`Negotiated TLS1.3 group`:** Look for `X25519MLKEM768`. If it prints bare `X25519` or `P-256`, your edge or load balancer is still negotiating classical key exchange.
- **`Signature type` and leaf certificate key:** Run `openssl s_client -connect api.yourdomain.com:443 -servername api.yourdomain.com </dev/null 2>/dev/null | openssl x509 -noout -text | grep -E "Public Key Algorithm|Public-Key|ASN1 OID"` to see whether your certificate sits on `RSA 2048`, `RSA 3072`, `prime256v1` (P-256), or `secp384r1` (P-384).

Across the top hosting and cloud platforms, the boundary between what your host handles and what you still configure looks like this:

| Platform | Client-to-edge PQ KEX | Handled by the platform | Still owned by your team |
|---|---|---|---|
| **Vercel** | `X25519MLKEM768` on by default | Edge TLS 1.3 termination, Let's Encrypt RSA-2048 chains | Pin Project Node version to `22.x` or `24.x` so serverless outbound fetches use OpenSSL 3.5+; enforce HSTS |
| **Cloudflare** | `X25519MLKEM768` on all plans (incl. Free) | Browser-to-edge PQ KEX, automatic PQ origin KEX when origin supports it, ML-DSA Authenticated Origin Pulls | Keep SSL/TLS in `Full (strict)` (never `Flexible`), raise Minimum TLS Version, and upgrade origin OpenSSL |
| **Google Cloud (GCP)** | `X25519MLKEM768` on External Application LBs | Global HTTPS LB hybrid KEX, Cloud KMS GA `ML-DSA` & `ML-KEM` | Default `*.run.app` and `*.cloudfunctions.net` URLs serve **ECDSA P-256** leaf certs; Terraform SSL policies require `profile = "RESTRICTED"` for `min_tls_version = "TLS_1_3"` |
| **AWS** | `X25519MLKEM768` on CloudFront by default | CloudFront edge PQ, AWS KMS FIPS 140-3 HSM `ML-DSA` & `ML-KEM`, PQ KMS API endpoints | Existing **ALB and NLB listeners do not auto-upgrade** legacy SSL security policies; switch listeners to AWS PQ-enabled TLS 1.3 policies |
| **Fastly / Netlify / Render / Fly.io** | Modern TLS 1.3 edges live or rolling out | Client-facing edge TLS termination | Edge-to-origin and custom container egress depend entirely on the OpenSSL, Go, or Rustls build inside your image |

Two quiet cloud traps show up repeatedly during audits:

1. **Default serverless URLs on GCP serve P-256 certs you cannot change.** Any client calling a raw `*.run.app` or `*.cloudfunctions.net` hostname hits Google's shared frontend with a Google-managed ECDSA P-256 leaf certificate. Fronting public production APIs behind an External Application Load Balancer and Certificate Manager lets you control both TLS policies and certificate key types (`RSA-3072` or `P-384` stopgap today, PQ certificates as CAs roll them out).
2. **Legacy listener policies silently survive for years.** On AWS, an ALB deployed two years ago stays pinned to `ELBSecurityPolicy-TLS13-1-2-2021-06` or an older TLS 1.2 policy with zero ML-KEM until you explicitly update it. On GCP, writing `min_tls_version = "TLS_1_3"` inside Terraform's `google_compute_ssl_policy` fails if `profile = "MODERN"`; you must set `profile = "RESTRICTED"`.

## Hop 2: The silent outbound trap inside your containers

Once the request clears your CDN, your application container wakes up and calls out to the rest of the world: OpenAI, Anthropic, Google Cloud, Gemini, Stripe, GitHub, Resend, Slack, and internal APIs.

Here is the surprise that catches almost every engineering team off guard. Most major AI and cloud endpoints **already advertise `X25519MLKEM768` today**. If you probe `api.openai.com`, `api.anthropic.com`, `generativelanguage.googleapis.com`, or `graph.facebook.com` from OpenSSL 3.5+, they negotiate hybrid post-quantum TLS right now.

Yet a typical production container still downgrades every single outbound request to bare `X25519`, without logging a single warning. The culprit is the TLS library compiled into your base image: **OpenSSL 3.0.x has no ML-KEM support.**

| Runtime / Language | TLS library source | When `X25519MLKEM768` arrived | Minimum version to deploy |
|---|---|---|---|
| **Node.js** | Bundled OpenSSL | OpenSSL 3.5 landed in **Node 22.20.0** and **Node 24.5.0** | **Node `>=22.20`** or **`>=24.5`** (retire Node 20 and early 22.x) |
| **Go** | Built-in `crypto/tls` | Default in **Go 1.24**; NIST curve hybrids added in **Go 1.26** | **Go `>=1.24`** (rebuild static binaries even with zero code changes) |
| **Python** | OS system OpenSSL | Debian Bookworm & Ubuntu 24.04 ship OpenSSL **3.0.x** (no ML-KEM) | **Debian Trixie** (`python:3.12-slim-trixie`) or **Alpine `3.22+`** (OpenSSL 3.5+) |
| **Rust** | `rustls` / `native-tls` | `rustls` with `aws-lc-rs` supports `X25519MLKEM768` | Modern `rustls` + `aws-lc-rs` (check older `ring` or OpenSSL 3.0 `native-tls` builds) |

Prove what your deployed container actually negotiates with two quick commands:

```bash
# 1. Check the TLS library baked into your Node or Python image
node -p "process.versions.node + ' / OpenSSL ' + process.versions.openssl"
python3 -c "import ssl; print(ssl.OPENSSL_VERSION)"

# 2. Verify live outbound key exchange from inside Node
node -e '
const tls = require("node:tls");
const s = tls.connect(443, "api.openai.com", { servername: "api.openai.com" }, () => {
  console.log({ protocol: s.getProtocol(), kex: s.getEphemeralKeyInfo() });
  s.end();
});
'
```

Run that against Node `22.15.1` (OpenSSL `3.0.16`) and it prints `{ type: 'ECDH', name: 'X25519', size: 253 }`. Run the exact same script on Node `22.22.0` or `24.20.0` (OpenSSL `3.5.x`) and it prints `{ type: 'TLSGroup', name: 'X25519MLKEM768', size: undefined }`.

That makes container upgrades the highest-leverage win in the entire migration. Moving Dockerfiles from `node:20-slim` to `node:22-slim` (`22.20+`) or `node:24-slim`, rebuilding Go services with Go 1.24+, and shifting Python containers from `-bookworm` to `-trixie` upgrades outbound LLM, cloud, and webhook traffic across your whole fleet without touching a line of product code.

Some third-party SaaS APIs still answer with classical `X25519` or `P-384` even when your client offers `X25519MLKEM768`. Record those endpoints in a vendor tracker, file a note with their security team, and keep moving.

## Hop 3: Auth, JWTs, webhooks, KMS, and app signing

Next, your service checks who is calling and verifies incoming webhooks or signs outbound tokens. This is where rushing causes self-inflicted outages, while calm triage saves weeks.

### Leave HMAC-SHA256 webhooks untouched

Stripe, GitHub, Slack, Meta, and Shopify authenticate webhooks with symmetric **HMAC-SHA256**. Shor's algorithm does not affect HMACs. Do not break working webhook integrations trying to add post-quantum wrappers.

While you have those files open, verify three classical basics instead: constant-time signature checks (`crypto.timingSafeEqual`, never `===`), timestamp replay windows, and fail-closed behavior if the webhook secret env var is empty.

### Separate managed IdP tokens from keys you mint yourself

1. **Managed identity providers (Firebase Auth, Auth0, Clerk, Supabase, Cognito):** Established IdPs mostly default to `RS256` (RSA-2048), which sits in the legacy compatibility tier rather than the urgent 256-bit ECC exit tier. Newer setups, including modern Supabase projects using asymmetric signing keys, often default to `ES256` (P-256). Check your IdP console for `RS256` or `ES384` options, keep access tokens short-lived, and follow vendor `ML-DSA` rollouts.
2. **Custom JWTs, signed receipts, RFC 9421 HTTP Message Signatures, and Cloud KMS keys:** Any key your own backend mints on `Ed25519` (`EdDSA`) or `P-256` (`ES256`, GCP `EC_SIGN_P256_SHA256`, AWS `ECC_NIST_P256`) belongs at the top of your signing rotation list.

When you own both signer and verifier (internal service tokens, artifact receipts, new trust roots), both Google Cloud KMS and AWS KMS already ship GA **`ML-DSA`** (`ML-DSA-65` and `ML-DSA-87`). When external verifiers cannot parse `ML-DSA` yet (OIDC JWKS, third-party RFC 9421 peers), rotate to **`RSA-3072` (`PS256` / `RS256`)** or **`P-384` (`ES384`)** with a dual-`kid` overlap window before retiring the 256-bit ECC key.

### Two signing migration bugs that bite in production

**1. The JWK private-key export leak.** Many TypeScript backends export a public JWK from an Ed25519 or EC private JWK by stripping `d`:

```ts
// DANGEROUS ON RSA KEYS: leaks p, q, dp, dq, qi (the full private key!)
const { d: _private, ...publicJwk } = privateJwk;

// SAFE: explicit public-field allowlist per key type
export function toPublicJwk(jwk: JsonWebKey): JsonWebKey {
  const base = { kty: jwk.kty, kid: jwk.kid, use: jwk.use, alg: jwk.alg };
  if (jwk.kty === "RSA") return { ...base, n: jwk.n, e: jwk.e };
  if (jwk.kty === "EC") return { ...base, crv: jwk.crv, x: jwk.x, y: jwk.y };
  if (jwk.kty === "OKP") return { ...base, crv: jwk.crv, x: jwk.x };
  throw new Error(`Unsupported JWK kty: ${String(jwk.kty)}`);
}
```

That destructuring trick works on Ed25519 and P-256 because `d` is the sole private component. Switch the key generator to RSA-3072 and the JWK also holds CRT prime factors `p`, `q`, `dp`, `dq`, and `qi`. Stripping only `d` silently publishes your private key on `/.well-known/jwks.json`. Always build public JWKs from an explicit allowlist.

**2. JWT algorithm confusion during dual-key rollouts.** Never let an unverified token's `header.alg` choose the verifier algorithm. Pass an explicit `algorithms` allowlist (such as `["PS256", "ES384"]`) and bind each `kid` to its expected key type so an attacker cannot feed your public key into an `HS256` verifier as an HMAC secret.

## Hop 4: Middleware, databases, caches, proxies, and tunnels

Behind your app code sit the internal hops that glue a real system together. Auditing this layer for PQC almost always uncovers classical transport gaps that deserve fixing first.

### Reverse proxies, middleware, gateways, and queues

- **Nginx, HAProxy, Envoy, and Caddy:** Nginx and HAProxy inherit the host OS OpenSSL version, so an Ubuntu 24.04 or Debian Bookworm proxy container stays locked on OpenSSL 3.0 until you upgrade the base image (or build against BoringSSL/AWS-LC). Caddy compiled with Go `1.24+` negotiates `X25519MLKEM768` out of the box. Watch for stale `ssl_ecdh_curve X25519:prime256v1;` lines in Nginx configs, which silently disable ML-KEM even on OpenSSL 3.5+.
- **App middleware and API gateways (Next.js, Express, FastAPI, Kong, AWS/GCP API Gateway):** Middleware usually does not terminate TLS, yet it guards header and auth boundaries. Enforce `Strict-Transport-Security`, prevent public clients from spoofing `X-Forwarded-Proto`, and audit internal gRPC or service-mesh mTLS roots for hardcoded `prime256v1` certs.
- **Message brokers (Pub/Sub, SQS, Kafka/MSK, RabbitMQ):** Managed HTTPS queues inherit your container's outbound TLS upgrade automatically. Self-hosted Kafka and RabbitMQ clusters need the same TLS 1.3 and OpenSSL/JVM runtime check as your web tier.

### Databases and Redis caches

Before asking whether your managed Postgres or Redis cluster supports ML-KEM (most VPC database endpoints still run classical TLS 1.3 or 1.2), verify **whether TLS is active at all**:

- **Redis, Memorystore, and ElastiCache:** Cloud Redis frequently defaults to `TRANSIT_ENCRYPTION_MODE = DISABLED` inside a VPC. Even when server TLS is on, client libraries often keep a `redis://` scheme instead of `rediss://` or pass `rejectUnauthorized: false` to silence a private CA error. Audit both Terraform config and client connection code.
- **Postgres, MySQL, Cloud SQL, and RDS:** Enforce `sslmode=verify-full` (or Cloud SQL Auth Proxy / IAM DB auth) and keep AES-256 encryption at rest enabled.

### Outbound proxies, WebSockets, and WireGuard / Tailscale tunnels

- **HTTP vs HTTPS outbound proxies:** Sending HTTPS through an `http://` proxy via `CONNECT` keeps the target payload encrypted end to end, **but sends `Proxy-Authorization` credentials in plaintext** across the first hop. Prefer `https://` proxy endpoints whenever available and keep your inner TLS client on OpenSSL 3.5+ or modern Chromium.
- **WebSockets and self-signed certs:** Upgrade every `ws://` hop crossing service or browser boundaries to `wss://` behind TLS 1.3. Grep setup scripts for `ec_paramgen_curve:prime256v1` and move self-signed certs to `secp384r1` (P-384) today, then `ML-DSA` once internal clients support OpenSSL 3.5+.
- **Tailscale and WireGuard:** WireGuard's Noise handshake relies on bare `X25519`, squarely inside the 256-bit ECC exit tier. Raw WireGuard can layer a post-quantum pre-shared key exchange such as [Rosenpass](https://rosenpass.eu/). Tailscale does not currently ship post-quantum WireGuard or user-configurable PSKs. Treat Tailscale as a routing, identity, and ACL layer rather than your only encryption boundary, and keep end-to-end `X25519MLKEM768` HTTPS or PQ SSH running inside every tunnel.

## Hop 5: Developer laptops, SSH, CI/CD, and releases

Production hardening fails if developer machines and CI pipelines still hold weak long-lived keys.

- **OpenSSH:** Run `ssh -V` across developer laptops, CI runners, and bastions. OpenSSH `10.0+` negotiates hybrid `mlkem768x25519-sha256` key exchange by default, closing the harvest-now-decrypt-later window on SSH traffic immediately. **OpenSSH `10.6`** adds `ssh-mldsa44-ed25519` hybrid host and user keys. Upgrade laptops and bastions now, and adopt hybrid keys as hosts and Git providers support them.
- **CI/CD cloud auth:** Replace static GCP service-account JSON keys and long-lived AWS IAM keys in GitHub Actions, Buildkite, or GitLab CI with **Workload Identity Federation (short-lived OIDC tokens)**. Eliminating static private keys shrinks both classical and post-quantum blast radius in one move.
- **Registries and app stores:** Platforms such as npm (Sigstore provenance), Chrome Web Store (CRX3), and Apple Notarization own the outer signature format. Keep CI provenance and hardware-key 2FA enforced and track upstream `ML-DSA` rollouts rather than inventing custom wrappers.

![Post-quantum algorithm triage matrix dividing startup cryptographic primitives into Exit First, Interim Stopgap, Target NIST PQC, and Unaffected buckets.](https://rtrvr.ai/blog-delivery/post-quantum-cryptography-migration-guide/migration-matrix.svg)

## A realistic 30-day migration order

Before opening twenty tickets, keep perspective: **classical security bugs still beat quantum cryptanalysis by a wide margin.** A plaintext Redis cache, `NODE_TLS_REJECT_UNAUTHORIZED=0`, a leaked CI JSON key, or an unauthenticated admin endpoint lets someone break in today. Close those first, then work through the 256-bit ECC inventory in order.

### Hour 1: Measure what actually runs on the wire

1. Probe every public domain and load balancer with OpenSSL 3.5+ `s_client` to record TLS version, negotiated TLS 1.3 group (`X25519MLKEM768` vs bare `X25519`), and leaf certificate key type.
2. Check `process.versions.openssl`, `python3 -c "import ssl; print(ssl.OPENSSL_VERSION)"`, and `go version` in every deployed container and serverless runtime.
3. Grep your repos for `prime256v1`, `P-256`, `ES256`, `Ed25519`, `EdDSA`, `EC_SIGN_P256`, `ssl_ecdh_curve`, `rejectUnauthorized`, `redis://`, and `ws://`.

### Day 1: Fix classical gaps and listener policies

- Enable transit TLS on internal Redis/caches and enforce `sslmode=verify-full` on databases.
- Delete `rejectUnauthorized: false` and `NODE_TLS_REJECT_UNAUTHORIZED=0` overrides from production code.
- Confirm Cloudflare is on `Full (strict)`, remove stale `ssl_ecdh_curve` overrides from Nginx, and switch legacy AWS ALB/NLB listeners and GCP SSL policies (`RESTRICTED` + `TLS_1_3`) to PQ-capable TLS 1.3 profiles.

### Week 1: Upgrade runtimes to unlock outbound PQ everywhere

- Move Node services and Vercel/cloud functions to **Node `22.20+` or `24.5+`** (OpenSSL 3.5+).
- Rebuild Go binaries and Caddy proxies on **Go `1.24+`** (or `1.26+`).
- Shift Python and Nginx Dockerfiles off Debian Bookworm / Ubuntu 24.04 (OpenSSL 3.0) to **Debian Trixie** or **Alpine `3.22+`** (OpenSSL 3.5+).
- Front public production serverless endpoints off default P-256 `*.run.app` URLs behind a managed Load Balancer and Certificate Manager where certificate policy matters.
- Upgrade developer and bastion OpenSSH to `10.6+`.

### Quarter 1: Rotate signing roots and lock in CI guards

- Migrate custom app and Cloud/AWS KMS signing keys off `P-256` and `Ed25519` to **`ML-DSA`** (where verifiers support it) or **`RSA-3072+` / `P-384`** (interim stopgap) with dual-`kid` overlap and explicit public-JWK allowlists.
- Replace static CI cloud keys with **Workload Identity Federation (OIDC)**.
- Add a lightweight CI check that verifies runtime OpenSSL/Node versions and blocks new `prime256v1` cert scripts or `rejectUnauthorized: false` flags from slipping back in.

Post-quantum migration feels intimidating only when people treat it as theoretical cryptography. Follow your traffic hop by hop, and most of the real work turns out to be sharp systems hygiene: current runtimes, strict TLS 1.3 policies, encrypted internal hops, agile signing keys, and short-lived credentials. Run the Hour 1 checks today, and you will know where every real gap lives before lunch.
