Skip to content
All guides
Training & education

Crypto-agility: designing systems that can swap algorithms

8 min
TL;DR

Read this first

Crypto-agility is the ability to replace a cryptographic algorithm, parameter, or key without redesigning the system around it — swap the primitive, keep the architecture. It is the real deliverable of a post-quantum migration, because post-quantum will not be the last cryptographic transition. Systems that hardcode algorithms turn every future change into a multi-year project; agile systems turn it into a configuration change. Build the agility, not just the swap.

Most teams frame their post-quantum work as a one-time job: rip out RSA and ECDH, drop in ML-KEM and ML-DSA, done. That framing quietly recreates the exact problem it is trying to solve. The reason the current migration is so painful is that classical algorithms were wired into systems that were never designed to change them. Post-quantum standards will themselves be revised, deprecated, or broken over the coming decades — and the organizations that treat this migration as a chance to build crypto-agility will absorb the next transition cheaply, while everyone else repeats today's fire drill.

What crypto-agility actually means

Crypto-agility is a design property, not a product. A system is agile when you can change the algorithm, its parameters, or the keys it uses through configuration and negotiation — without touching data schemas, protocol definitions, or application logic. The primitive is a replaceable component behind a stable boundary. Both NIST and the NSA emphasize agility precisely because they expect the cryptographic landscape to keep moving: the goal is not to reach a final algorithm but to make the next change routine.

Anti-patterns that block agility

Rigidity is usually built in by accident, through decisions that looked reasonable when only one algorithm existed. The common offenders:

  • **Hardcoded algorithm identifiers.** Constants like `RSA_2048` or `ECDSA_P256` scattered through the codebase mean a change touches every call site instead of one setting.
  • **Fixed-size fields, columns, and buffers.** Database columns, wire fields, and buffers sized to a specific key or signature length break the moment a larger primitive arrives — and post-quantum signatures are far larger than ECDSA, with SLH-DSA signatures running to tens of kilobytes.
  • **Protocols with no algorithm negotiation.** If the wire format assumes a single algorithm, both endpoints must upgrade in lockstep — impossible at scale.
  • **Certificate and public-key pinning.** Pinning a specific key or algorithm freezes it in place and makes rotation a breaking change.
  • **Inline cryptographic calls.** When crypto is called directly wherever it is needed rather than behind one interface, there is no single place to make the swap.
Pitfall

Hardcoding the new algorithm rebuilds the old cage

The most common mistake in a post-quantum migration is to treat it as a one-time swap: pull out RSA, hardcode ML-KEM in exactly the same rigid places, and call it finished. You have spent a multi-year effort and ended up with a system just as brittle as before — one that will need another multi-year effort when ML-KEM's parameters change or its successor arrives. The point of the migration is to make the *next* change cheap, not to perform this one swap and re-lock the door.

The enablers

Agility is built from a small set of well-understood mechanisms, most of which already exist in mature protocols. Algorithm negotiation lets peers agree on a primitive at runtime — TLS does this with supported groups, and it is what makes hybrid key exchange deployable without a flag day. An abstraction or provider layer puts every cryptographic operation behind one interface, so a swap is a single change. Config-driven algorithm selection moves the choice out of code and into policy you can update without a redeploy. And none of it is safe to attempt until you know what you actually have.

That last point is the foundation. You cannot make agile what you cannot see, so agility starts with a cryptographic inventory — every algorithm, key, and certificate in use and where it lives. Made machine-readable as a CBOM, that inventory becomes something you can query, diff, and enforce against policy as algorithms change, rather than a one-off spreadsheet that is stale the week after it is written.

How quantakrypto helps

Crypto-agility is easy to state and hard to retrofit, because the rigidity is spread across code, schemas, and protocols that already ship. We start with an audit that produces a machine-readable inventory of where cryptography is hardcoded, pinned, or size-locked; we turn it into a migration roadmap that fixes the boundaries — provider layers, negotiation, config-driven selection — so the post-quantum swap and every swap after it becomes a configuration change; and we run training so your teams design for agility by default. The deliverable is not a single algorithm change. It is a system where the next one is cheap.

Frequently asked questions

What is crypto-agility in simple terms?

Crypto-agility is the ability to replace a cryptographic algorithm, its parameters, or its keys without redesigning the system around them. In an agile system the algorithm is a replaceable component behind a stable interface, so a change is configuration rather than re-architecture. The opposite is a system where the algorithm is wired into code, schemas, and protocols and cannot be changed without breaking them.

Why is crypto-agility the real goal of a post-quantum migration?

Because post-quantum will not be the last cryptographic transition — today's ML-KEM and ML-DSA parameters will themselves be revised or deprecated over time. If you hardcode the new algorithms the way the old ones were hardcoded, the next change is another multi-year project. Building agility during this migration converts all future changes from re-engineering efforts into configuration changes. NIST and the NSA both emphasize agility for exactly this reason.

What design anti-patterns prevent crypto-agility?

The main ones are hardcoded algorithm identifiers, fields and buffers sized to a specific key or signature length, protocols with no algorithm negotiation, certificate or public-key pinning, and cryptographic calls scattered inline instead of behind one interface. Fixed-size fields are especially dangerous for post-quantum work because ML-DSA and particularly SLH-DSA signatures are far larger than ECDSA. Each of these forces a lockstep, all-at-once change instead of a controlled swap.

How do I make an existing system crypto-agile?

Start with a cryptographic inventory so you know every algorithm, key, and certificate in use and where it is hardcoded or pinned. Then introduce a provider or abstraction layer so all crypto operations go through one interface, move algorithm selection into configuration, and adopt protocols that negotiate algorithms at runtime rather than assuming a single one. Making the inventory machine-readable as a CBOM lets you keep enforcing these properties as algorithms change.

Take the next step

Related reading

References

Get started

Turn quantum risk into a credential.

Book a discovery call and get an indicative scope and pricing for your organisation.