⚛ Quantum & Post-Quantum

Crypto-Agility: Migrating to Post-Quantum Cryptography

Crypto-agility is the capacity of a system to switch cryptographic algorithms, parameters, and keys quickly and safely, without redesigning the applications that depend on them. It matters because the migration to post-quantum cryptography is large, uncertain, and unavoidable, and organizations that hard-coded their algorithms face painful, error-prone changes. Treating cryptography as a replaceable component rather than a permanent fixture is what turns a disruptive overhaul into a routine upgrade. This article lays out a practical framework for achieving crypto-agility and executing a quantum-safe migration.

What Is Crypto-Agility

A crypto-agile system negotiates or configures its algorithms rather than embedding them. In practice this means referencing algorithms through named identifiers, abstracting cryptographic operations behind clean interfaces, and centralizing policy so a single change propagates everywhere. TLS cipher-suite negotiation is a familiar example: endpoints agree on algorithms at connection time, so new ones can be introduced without rewriting applications. The goal is to make swapping a primitive a configuration decision, not a software rewrite. Crypto-agility also covers the operational machinery around algorithms, including key rotation, certificate reissuance, and protocol version negotiation, so that a change in cryptographic policy can be deployed and, if necessary, rolled back with confidence.

Why Migration Is Hard

Cryptography is embedded far more deeply than most inventories suggest, which is why migration demands deliberate planning:

  • Ubiquity. Cryptographic calls hide in applications, libraries, protocols, hardware modules, firmware, and third-party products.
  • Hard-coded choices. Legacy systems often pin a specific algorithm and key size, with no path to change them.
  • Larger post-quantum artifacts. Post-quantum keys and signatures are bigger, which can break assumptions about buffer sizes, certificate formats, and handshake packet limits.
  • Long tails. Embedded devices, industrial controllers, and long-lived certificates can persist for a decade or more, so migration must be planned around their lifetimes.

Step 1: Build a Cryptographic Inventory

Migration begins with discovery, because you cannot replace what you cannot see. A cryptographic bill of materials (CBOM) catalogs every place cryptography is used, drawing on source-code scanning, network traffic analysis, certificate discovery, and vendor attestations. For each finding, record the essentials.

# Cryptographic inventory entry
asset:        payment-api / TLS termination
algorithm:    ECDHE (P-256) + RSA-2048 signatures
purpose:      key exchange + certificate authentication
data_lifetime: 7 years        # drives migration priority
owner:        platform-security
agility:      cipher-suite configurable, no code change needed

Step 2: Assess Risk and Prioritize

With an inventory in hand, rank systems by exposure. The harvest now, decrypt later threat makes key establishment protecting long-lived data the top priority, since that traffic can be captured and stored for future decryption. Signatures used only for real-time authentication are generally lower priority, because retroactively forging them yields little value. Mosca's inequality, which weighs data lifetime and migration time against the arrival of quantum computers, is a practical prioritization tool.

Step 3: Deploy Hybrid Cryptography

The prevailing recommendation is to migrate through hybrid schemes that run a classical algorithm and a post-quantum algorithm together, combining their outputs so the result is secure if either one holds. A hybrid key exchange, for instance, derives the session secret as KDF(ss_classical || ss_pq), where ss_classical comes from a classical exchange such as X25519 and ss_pq comes from an ML-KEM decapsulation, so an adversary must defeat both components to recover the key.

Hybrids hedge against two risks at once: an unexpected weakness in a relatively young post-quantum algorithm, and the quantum threat to the classical one. For key exchange, pair a classical algorithm with ML-KEM; for signatures, pair with ML-DSA where a hybrid is warranted.

Step 4: Test, Roll Out, and Monitor

Treat the migration as a controlled deployment rather than a single switchover:

  1. Pilot post-quantum and hybrid modes in noncritical systems to surface interoperability and performance issues, such as larger handshakes fragmenting across the network.
  2. Roll out incrementally, keeping classical fallbacks until confidence is high, and watch latency, error rates, and CPU cost.
  3. Update trust anchors and PKI, since certificate chains, roots, and hardware security modules must support the new algorithms end to end.
  4. Monitor and iterate, because algorithm recommendations and parameters evolve, and an agile system should absorb the next change smoothly.

Design Principles for Agile Cryptography

  • Abstract cryptography behind interfaces so implementations can be replaced without touching application logic.
  • Avoid hard-coded algorithm identifiers, key sizes, and buffer lengths; make them configurable and parameterized.
  • Centralize cryptographic policy so a single update reaches every dependent system.
  • Automate certificate and key lifecycle management to make rotation routine.
  • Design for larger artifacts by sizing buffers and formats for post-quantum keys and signatures from the start.
  • Test rollback paths so that a problematic algorithm change can be reverted safely without service downtime.

Key Takeaways

  • Crypto-agility lets systems change algorithms through configuration rather than costly redesign.
  • Migration is hard because cryptography is embedded everywhere, often hard-coded, and post-quantum artifacts are larger.
  • Start with a cryptographic inventory (CBOM), then prioritize by data lifetime and the harvest-now-decrypt-later threat.
  • Adopt hybrid schemes that stay secure if either the classical or post-quantum component holds.
  • Roll out incrementally, update PKI and trust anchors, and design abstractions so future algorithm changes are routine.
crypto-agilitypqc-migrationhybrid-cryptographycryptographic-inventoryquantum-safe

Frequently asked questions

What is crypto-agility?

Crypto-agility is the capacity of a system to switch cryptographic algorithms, parameters, and keys quickly and safely, without redesigning the applications that depend on them. It treats cryptography as a replaceable component rather than a permanent fixture, which turns a disruptive overhaul into a routine upgrade. It matters because the migration to post-quantum cryptography is large, uncertain, and unavoidable, and systems that hard-coded their algorithms face painful, error-prone changes.

How do you migrate to post-quantum cryptography?

Migration typically starts by building a cryptographic inventory that catalogs every place cryptography is used, then assessing risk and prioritizing systems by data lifetime and the harvest now, decrypt later threat. Next, organizations deploy hybrid schemes that combine a classical and a post-quantum algorithm, and finally they pilot, roll out incrementally with classical fallbacks, update PKI and trust anchors, and monitor. Treating it as a controlled deployment rather than a single switchover reduces risk.

What is a cryptographic bill of materials?

A cryptographic bill of materials, or CBOM, is an inventory that catalogs every place cryptography is used across an organization, drawing on source-code scanning, network traffic analysis, certificate discovery, and vendor attestations. For each finding it records details such as the asset, algorithm and key size, purpose, data lifetime, owner, and how agile the component is. It is the foundation of migration, because you cannot replace cryptography you cannot see.

Why is migrating to post-quantum cryptography so hard?

Cryptography is embedded far more deeply than most inventories suggest, hiding in applications, libraries, protocols, hardware modules, firmware, and third-party products. Legacy systems often hard-code a specific algorithm and key size with no path to change them, and post-quantum keys and signatures are larger, which can break assumptions about buffer sizes, certificate formats, and handshake limits. Embedded devices and long-lived certificates can also persist for a decade or more.

What should be migrated to post-quantum cryptography first?

Key establishment protecting long-lived data is the top priority, because the harvest now, decrypt later threat lets that traffic be captured and stored for future decryption. Signatures used only for real-time authentication are generally lower priority, since retroactively forging them yields little value. Mosca's inequality, which weighs data lifetime and migration time against the arrival of quantum computers, is a practical prioritization tool.

What design principles support crypto-agility?

Abstract cryptography behind clean interfaces so implementations can be replaced without touching application logic, and avoid hard-coded algorithm identifiers, key sizes, and buffer lengths in favor of configurable parameters. Centralize cryptographic policy so a single update reaches every dependent system, automate certificate and key lifecycle management, and size buffers and formats for larger post-quantum artifacts from the start. Testing rollback paths ensures a problematic algorithm change can be reverted safely.

Try it hands-on

K0G is an open toolkit of browser-based security utilities — hashing, encoding, JWT, certificates, crypto and more, all running locally in your browser.

Explore the tools →