PQC migration examples: seven real-world scenarios
Post-quantum migration examples for web apps behind nginx or a load balancer, SSH, application code, signing, backups, internal PKI and crypto wallets.
Chapter 6Published 6 min readBy Imad Ez
On this page
Post-quantum migration looks different in every system, but the same questions apply: what is exposed, how urgent it is, and what the smallest effective change is. This chapter walks through seven common situations with the risk, the priority and the fix for each. Commands and configuration are labelled by how far we have checked them: tested means we ran it on a local machine (OpenSSL 4.0.3, OpenSSH 10.2p1, Node 24.22.1), untested means it follows vendor documentation or release notes that we cite, but we did not run it.
1. A public web app or API behind nginx or a load balancer
Situation. An HTTPS service whose clients are browsers and API consumers. Risk. Recorded TLS sessions that used classical (EC)DHE can be decrypted later. Certificate signatures are a lower, later concern. Priority. P1, configuration-level, weeks.
Fix.
- Check where you stand: the post-quantum TLS check, or locally with OpenSSL 3.5 or later (tested against cloudflare.com and google.com, which both negotiated
X25519MLKEM768):
openssl s_client -connect example.com:443 -tls1_3 -groups X25519MLKEM768 </dev/null 2>/dev/null | grep -i "negotiated tls1.3 group"
- For nginx built against OpenSSL 3.5 or later (untested), list the hybrid group first. The nginx documentation says
ssl_ecdh_curvetakes a colon-separated list; whether the hybrid name is accepted depends on the OpenSSL nginx is linked against.
ssl_protocols TLSv1.3 TLSv1.2;
ssl_ecdh_curve X25519MLKEM768:X25519:prime256v1;
Check the linked version with nginx -V. If you instead remove ssl_ecdh_curve and keep the default auto, nginx uses OpenSSL's built-in list, which in 3.5 and later prefers hybrid groups (OpenSSL 3.5 notes).
-
Cloud load balancers (untested): choose a policy that lists hybrid key exchange. On AWS this is a policy with
PQin its name, for exampleELBSecurityPolicy-TLS13-1-2-Res-PQ-2025-09, which supportsX25519MLKEM768on TLS 1.3 (AWS documentation). Google Cloud enables it by default since October 2026 on supported load balancers. -
A local reproduction of server behaviour (tested):
openssl s_server -accept 18443 -cert srv.crt -key srv.key -tls1_3 -groups X25519MLKEM768:X25519 -www
A client offering the hybrid group negotiated X25519MLKEM768 against it, and a server limited to X25519 fell back to classical.
Verify. The negotiated group shows the hybrid; test with a real browser; watch for handshake failures from older middleboxes. Full guide: enable post-quantum TLS.
2. SSH access to servers
Situation. Administrators and CI jobs connect to Linux servers. Risk. Recorded SSH sessions (commands, secrets, file transfers) become readable later without a post-quantum key exchange. Host and user keys are signatures: a later forgery risk only. Priority. P1, and quick: upgrade OpenSSH.
Fix. OpenSSH 9.0 made sntrup761x25519-sha512@openssh.com the default, 9.9 added mlkem768x25519-sha256, and 10.0 made the ML-KEM hybrid the default (release notes). If you pin algorithms, include a hybrid (untested on a server; the client capability was tested):
# /etc/ssh/sshd_config and ~/.ssh/config
KexAlgorithms mlkem768x25519-sha256,sntrup761x25519-sha512,curve25519-sha256
Drop curve25519-sha256 to enforce post-quantum exchange once all your clients support it. Reload with sudo sshd -t && sudo systemctl reload sshd.
Verify. ssh -Q kex | grep -E "mlkem|sntrup" lists what your client supports (tested: both appear on OpenSSH 10.2p1). ssh -vv server 2>&1 | grep "kex: algorithm" shows what was negotiated. See post-quantum SSH.
3. Application code that does RSA or ECDH encryption
Situation. A service encrypts a data key to a recipient's RSA public key (OAEP), or does ECDH plus AES. Risk. Harvest now, decrypt later on any ciphertext stored or sent. P0 for long-lived data. Detect. Scan the code for RSA encryption and ECDH calls (how to).
Fix. Replace the wrap with ML-KEM. In Node 24 (tested):
import crypto from 'node:crypto';
const { publicKey, privateKey } = crypto.generateKeyPairSync('ml-kem-768');
const { ciphertext, sharedKey } = crypto.encapsulate(publicKey); // sender
const key = crypto.hkdfSync('sha256', sharedKey, Buffer.alloc(0), 'ctx-v1', 32); // then AES-256-GCM
const sharedKey2 = crypto.decapsulate(privateKey, ciphertext); // recipient
With the OpenSSL command line (tested):
openssl pkeyutl -encap -pubin -inkey kem.pub -out ct.bin -secret ss.bin
In Go 1.24 and later, crypto/mlkem provides GenerateKey768, Encapsulate and Decapsulate (Go 1.24 notes; we did not run Go).
Hybrid note. For application-layer use, combine ML-KEM with X25519 and derive the key from both secrets with HKDF when a vetted hybrid or HPKE library is available. Standalone ML-KEM is NIST-approved, but CIRG prefers hybrids. Store an algorithm identifier with every ciphertext. Do not invent your own combiner.
Verify. Re-run the scanner; round-trip tests; a migration path that decrypts old ciphertexts.
4. Code signing, firmware, JWTs
Situation. Release artifacts, firmware images or tokens signed with RSA, ECDSA or Ed25519. Risk. Forgery once a quantum computer exists. For firmware and hardware roots the trust anchor may live 10 to 20 years and cannot be changed in the field. This is not a harvest problem. Priority. Firmware and roots P2 (start procurement now); JWTs and short-lived tokens P3.
Fix.
- Firmware and software signing: plan for LMS or XMSS (NIST SP 800-208) or ML-DSA. Require field-updatable verification and algorithm agility in new hardware. ML-DSA signing and verification work in OpenSSL 4.0.3 and Node 24 (tested); an ML-DSA-65 signature is 3,309 bytes.
- Where verifiers support it, sign with both a classical and a post-quantum algorithm during the transition (untested).
- JWT: RFC 9964 defines ML-DSA for JOSE and COSE (Proposed Standard, 2026). Check whether your JWT library implements it before planning around it. Until then, keep short key lifetimes, support
kidrotation and keep the algorithm in configuration.
Verify. Scanner findings for RS256 and ES256 trend down; vendor roadmaps are documented; the new algorithm verifies in staging.
5. Long-lived backups wrapped with RSA keys
Situation. Backups or archives encrypted with AES, with the data key wrapped by an RSA or elliptic-curve public key, GPG, or a cloud KMS asymmetric key. Risk. The highest harvest exposure: stolen backups are the textbook case.
Fix, cheapest first.
- Prefer symmetric wrapping: AES-256 master keys in a KMS or HSM. Re-wrap data keys under AES-256 key-encryption keys.
- Where asymmetric wrapping is required (several recipients), re-wrap with ML-KEM, hybrid with X25519.
- For the most sensitive sets, generate fresh data keys and re-encrypt the data. A stolen copy of the old wrapped key is not protected by re-wrapping.
- Inventory your key directories and scripts for RSA and EC key files.
Before and after with the OpenSSL command line (the primitives were tested; the pipeline as a whole was not):
# before
openssl pkeyutl -encrypt -pubin -inkey rsa.pub -in dek.bin -out dek.wrapped
# after: encapsulate, derive a KEK with HKDF, encrypt the data key with AES-256, store ct + algorithm id
openssl pkeyutl -encap -pubin -inkey mlkem.pub -out kem_ct.bin -secret ss.bin
Verify. A restore test using only the new wrapping.
6. Internal PKI and mTLS
Situation. A private CA issues RSA or ECDSA certificates for services and mutual TLS. Risk. Key exchange inside mTLS handshakes is exposed to harvesting; fix it with hybrid groups, independently of certificates. Certificate signatures and CA keys are a forgery risk, and long-lived roots matter most.
Fix.
- Enable hybrid groups in your TLS libraries and service mesh (versions matter; Go 1.24 and later do it by default; untested for Envoy and Istio).
- Inventory certificates and endpoints, including internal ones.
- Shorten leaf lifetimes and automate issuance (ACME, SPIFFE) so re-issuing under a new CA is a configuration change.
- Pilot a private ML-DSA-65 or ML-DSA-87 CA with OpenSSL 3.5 or later. We issued a self-signed ML-DSA-65 certificate with
openssl req -x509(tested), but many clients cannot yet verify ML-DSA chains; test before cutover. - Keep the root key offline and document how you would re-key the root.
7. Crypto wallets and blockchains
Wallets get their own article: are Bitcoin and Ethereum wallets at risk? In short, Bitcoin and Ethereum sign with ECDSA over secp256k1 (Bitcoin Taproot uses Schnorr on the same curve), and Solana and others use Ed25519. All are broken by Shor's algorithm in principle. The risk is signature forgery after a public key has been revealed, not harvesting. Nothing in the December 2026 statements says wallets are at immediate risk, and users cannot unilaterally switch their on-chain signature scheme; that needs protocol upgrades. What users can do now is avoid address reuse, encrypt backups with AES-256 rather than RSA, and follow their chain's roadmap. This section reflects general knowledge: we did not fetch a blockchain source.
Next steps
Pick the scenario closest to your estate and try its check: the TLS check for item 1, the code scanner for item 3. Then see the migration plan for sequencing. If you want an engineer to review your configuration or scope a rollout, you can contact a specialist via /en/contact.