Skip to content

Migration playbook

A practical, step-by-step plan for engineering teams: inventory, prioritise, build crypto-agility, deploy hybrids, test, and monitor, with the pqe scanner, CBOMs and CI checks.

Part 08 of 09Advanced 8 min read
On this page

This is the hands-on part of the series. It assumes you've read why the migration matters (harvest now, decrypt later) and what you're migrating to (the new standards, hybrid cryptography). The plan has six phases. They overlap in practice: you'll be turning on hybrid TLS long before your inventory is perfect, and that's fine.

  1. INVENTORY ──► 2. PRIORITISE ──► 3. CRYPTO-AGILITY ──► 4. HYBRID ROLLOUT ──► 5. TEST ──► 6. MONITOR
     what & where     by risk & x+y>z    make the next swap      key exchange first,     interop,     CI gates,
                                         a config change         then signatures         size, perf   CBOM drift
         ▲                                                                                              │
         └──────────────────────────────────── repeat ─────────────────────────────────────────────────┘

Phase 1: Inventory — find all the cryptography

You can't migrate what you can't see. A cryptographic inventory answers: which algorithms, key sizes and protocols do we use, where, for what, and who owns them?

Cryptography hides in more places than people expect:

LayerWhere to look
Application codeCalls to crypto, cryptography, crypto/*, JCA/JCE, System.Security.Cryptography, OpenSSL, libsodium, JWT and JOSE libraries
ConfigurationTLS settings in servers and clients, ssl_ciphers, ssl_ecdh_curve, ecdhCurve, CurvePreferences, SSH KexAlgorithms, IPsec proposals
DependenciesLibraries that do crypto for you: HTTP clients, database drivers, SDKs, auth middleware
InfrastructureLoad balancers, CDNs, API gateways, service meshes, VPNs, KMS and HSM key types
Certificates & keysPublic and private CAs, mTLS certificates, code-signing keys, SSH host and user keys, JWT signing keys, PGP keys
Data at restEnvelope encryption with RSA/ECC-wrapped keys, encrypted backups, archived signed documents
Third partiesPartners' APIs, SaaS integrations, payment processors, identity providers

Scan your code

pqe's scanner is built for the code and configuration layers:

bash
npx -y pqe-cli scan .

It reports each finding with the algorithm (for example rsa, ecdsa, x25519, md5), its quantum status, severity, file and line, and a pointer to the migration guide for your language. Use pqe guide rsa --lang python (or your language) for step-by-step fixes, and pqe explain <algorithm> for background.

Produce a CBOM

A Cryptography Bill of Materials (CBOM) is a machine-readable inventory of cryptographic assets, defined as part of the CycloneDX standard (1.6 and later). It's to cryptography what an SBOM is to dependencies, and it's increasingly what auditors and customers ask for.

bash
npx -y pqe-cli scan . --cbom -o cbom.json

Commit CBOMs as build artefacts, aggregate them across repositories, and you have the start of an organisation-wide inventory that updates itself.

Check live endpoints

Code scanning won't see your load balancer's TLS policy. Check what each public hostname actually negotiates with pqe's website checker or:

bash
npx -y pqe-cli check api.example.com

Do the same for internal endpoints you can reach (npx -y pqe-cli check --file hosts.txt checks a whole list), and for SSH: npx -y pqe-cli ssh host shows which post-quantum key exchange a server offers and the sshd_config fix, and ssh -v host exit 2>&1 | grep "kex: algorithm" shows what a real connection negotiates.

Record ownership and context

For each item, capture: system, owner, algorithm and key size, purpose (key exchange, signature, encryption at rest), data sensitivity, data shelf life (x), external dependencies (vendor, partner, hardware), and how it's configured (code change, config, vendor upgrade). That metadata drives the next phase.

Phase 2: Prioritise — by exposure, not by count

You'll find hundreds of items. Rank them with Mosca's reasoning (x + y > z) and a few practical factors:

PriorityTypically includesWhy
1. NowKey exchange protecting long-lived sensitive data in transit: public TLS endpoints, partner APIs, VPNs, SSH to production; RSA/ECC-wrapped data keys for long-term storageHarvestable today; high x
2. NextLong-lived signing keys: root and intermediate CAs, firmware and secure-boot keys, software release signingHard to rotate; must be trusted for years
3. PlannedShort-lived signatures: TLS server certificates, JWTs, mTLS client certificates, SSH user keysNot harvestable; follow ecosystem readiness
Fix anywayMD5, SHA-1, DES, 3DES, RC4, RSA < 2048, ECB mode, insecure randomBroken today, unrelated to quantum, usually cheap

pqe's severity levels follow the same logic: classical breaks and harvestable key exchange rank higher than quantum-vulnerable signatures.

Two further prioritisation factors:

  • Lead time. Hardware (HSMs, smart cards, embedded devices, network appliances) and third parties take the longest. Start the conversations early, even if the deployment is years off.
  • Leverage. Shared components (a TLS-terminating proxy, a common auth library, a base container image) fix many systems at once.

Phase 3: Crypto-agility — make the next swap a config change

Crypto-agility is the ability to change algorithms without rewriting applications. This migration won't be the last: FN-DSA and HQC are coming, parameters may change, and a flaw could appear in anything. Teams that hard-coded RSA in 40 places will do this work 40 times; teams that centralised it will do it once.

Practical patterns:

  1. Centralise cryptographic operations behind a small internal interface (sign(keyId, data), seal(recipient, data)), not scattered library calls.
  2. Make algorithms configuration, not code. Read algorithm names and parameter sets from config with a safe default.
  3. Version and tag everything you store. Every ciphertext, signature, token and password hash should carry an algorithm identifier, so old data can still be read after the default changes:
v2:mlkem768-x25519:aes256gcm:<base64 payload>
  1. Support multiple algorithms during transition. Verify old and new signatures; accept old and new key types; publish multiple keys (for example in a JWKS) with kids.
  2. Don't parse algorithm-specific bytes in business logic. Key and signature sizes are changing from tens of bytes to kilobytes; fixed-size database columns, headers and buffers will break.
  3. Prefer libraries and protocols that negotiate. TLS, SSH and HPKE negotiate algorithms for you; custom formats don't.

pqe's crypto-agility-pattern guide shows a worked example of an algorithm registry with tagged payloads.

Phase 4: Hybrid rollout — key exchange first

Step 4a: TLS and SSH key exchange

This is usually the highest-value, lowest-effort work, because the hard parts live in the runtime:

  • Upgrade runtimes and libraries: OpenSSL 3.5+, Node.js 22.20+/24/26 (not 20), Go 1.24+, a current JDK (JDK 27 enables X25519MLKEM768 by default), rustls with aws-lc-rs, .NET 10 on OpenSSL 3.5+ (Linux).
  • Remove pinned classical-only curve lists (ecdhCurve, ssl_ecdh_curve, CurvePreferences, KexAlgorithms), or put the hybrid first.
  • Enable post-quantum policies on managed services: Cloudflare does it by default; AWS ALB/NLB need a -PQ- security policy such as ELBSecurityPolicy-TLS13-1-2-Res-PQ-2025-09.
  • Don't forget the origin: CDN-to-origin and service-to-service hops are often on older configurations than the edge.
  • SSH: OpenSSH 10+ everywhere; remove old KexAlgorithms hardening; ask appliance vendors for timelines.

pqe has per-stack guides for each of these (pqe guide x25519 --lang javascript, or browse the guides on the website).

Step 4b: Application-level encryption

Where your own code encrypts to public keys (envelope encryption, sealed messages, file encryption), move to ML-KEM in a vetted hybrid construction: HPKE with an ML-KEM-based suite where your library supports it, X-Wing (still a draft) or RFC 9980 for OpenPGP. Native ML-KEM is available in Node.js 24.7+, Python's cryptography 48+, Go 1.24+ (crypto/mlkem), JDK 24+, .NET 10, OpenSSL 3.5+ and Rust's aws-lc-rs.

Re-encrypt or re-wrap long-lived stored data keys: unwrap with the old RSA/ECC key and wrap with the new scheme, or move wrapping into a KMS using symmetric keys.

Step 4c: Signatures

Signatures depend more on ecosystem support, so pick the systems where you control both signer and verifier first:

  • Internal tokens and APIs: ML-DSA via JOSE (RFC 9964 algorithm names ML-DSA-44/65/87), where both sides use libraries that support it. Keep dual support (EdDSA/ES256 plus ML-DSA) during rollout.
  • Private PKI and mTLS: ML-DSA certificates (RFC 9881) can be issued with OpenSSL 3.5+ for internal use. Test every client first.
  • Firmware and release signing: SLH-DSA or LMS/XMSS with careful state management; check what your boot ROMs and HSMs support.
  • Public web certificates: wait for browser root programs. Not available from public CAs yet.

Phase 5: Test — sizes, interop and performance

Post-quantum changes break things in predictable ways. Test for:

RiskWhat to test
Larger handshakesOld middleboxes, firewalls and load balancers that mishandle a ClientHello split across packets; MTU and fragmentation issues in UDP-based protocols
Larger keys and signaturesDatabase column sizes, HTTP header limits (JWTs in headers or cookies can grow by ~3–6 KB), certificate chain sizes, QR codes, constrained devices
InteroperabilityEach client and server combination: older SDKs, mobile apps, partners, IoT devices; fallback to classical when the peer doesn't support PQ
PerformanceCPU per handshake (usually fine), signing speed (SLH-DSA is slow), bandwidth on high-volume small requests
FIPS and compliance modesWhether your FIPS-validated module enables the algorithms you need
Downgrade behaviourThat a client capable of PQ actually negotiates it, rather than silently falling back

Roll out with feature flags or canaries, measure handshake failures and latency, and keep a fast rollback path.

Phase 6: Monitor — keep it from regressing

Migration isn't done when the last config changes. New code and new dependencies reintroduce old algorithms constantly. Put checks in CI:

bash
# Fail the build on new high-severity findings and upload results to code scanning
npx -y pqe-cli scan . --sarif -o pqe.sarif --fail-on high

pqe also ships a GitHub Action for this, and SARIF output shows findings inline on pull requests. Then:

  • Track CBOM drift: generate a CBOM per build and diff it, so a new RSA dependency is visible in review.
  • Monitor endpoints: re-run pqe check against your public hostnames on a schedule and alert when an endpoint stops negotiating a post-quantum group (after a load balancer change, for example).
  • Watch the standards: FN-DSA, HQC, composite signatures and PQ certificates in browsers are all still moving. Review the inventory at least yearly.
  • Report progress against dated milestones (see Deadlines and regulations): the percentage of external endpoints with hybrid key exchange, the number of RSA/ECC-wrapped data keys remaining, signing systems with a PQ plan.

A sample 18-month plan for a mid-sized product team

QuarterWork
Q1Run pqe scan on all repositories, produce CBOMs, pqe check all public hostnames; fix MD5/SHA-1/DES/insecure-random findings; add the CI check in report-only mode
Q2Upgrade runtimes (Node 20 → 24/26, older Go/JDK), remove pinned curve lists, enable PQ load-balancer policies and origin PQ; turn CI to --fail-on high
Q3Introduce a crypto abstraction and tagged payloads; migrate envelope encryption to hybrid ML-KEM; plan re-wrapping of stored data keys
Q4Pilot ML-DSA for internal tokens or a private PKI; engage vendors on HSM and appliance roadmaps
Q5–Q6Re-wrap stored keys; extend PQ signatures where both ends are controlled; document the roadmap to 2030/2035 for customers and auditors

Next: FAQ and myths.