If your PQ migration ends with “we replaced RSA with ML-DSA and called it done,” you’ve done half the work. The other half: ensure that when ML-DSA is replaced by something else in 2032, you don’t go through the same painful inventory-and-replace cycle. Build the agility into the system; the migration is the opportunity.
What crypto-agility means in practice
A crypto-agile system has these properties:
- Cryptographic algorithm choices live in configuration, not code. A YAML / TOML / DB-row says “for this purpose, use this algorithm.”
- Multiple algorithms can be supported simultaneously. Migration period: producers sign with old + new; verifiers accept either. After full migration: drop old.
- Algorithm identifiers are versioned: the wire format includes “alg=ML-DSA-65” not just “alg=signed.”
- Library abstractions hide algorithm details from application code. Application says “give me a signature”; library handles which algorithm.
- Key rotation is automated and well-rehearsed. New keys can be generated, distributed, and old keys retired without service disruption.
Pattern 1 — Pluggable algorithm registry
Application code should not name specific algorithms. Instead, register algorithm purposes:
// Bad: hardcoded
signature = sign_rsa_2048(message, key);
// Better: configurable
signature = crypto.sign(purpose="document_signing", message, key);
// Where crypto.sign reads from config:
// purpose: document_signing
// algorithm: ml-dsa-65
// key_source: hsm
// fallback: rsa-2048 // for verifying old signatures
Libraries that already do this well: HashiCorp Vault (transit secrets engine), AWS KMS (alias-based keys), Google Cloud KMS (key purpose abstraction).
Pattern 2 — Multi-algorithm certificates
X.509 certificates traditionally have one signing algorithm. The “composite signature” extension (RFC 6916) and similar drafts allow a cert to carry multiple signatures (e.g., RSA AND ML-DSA). Verifiers check whichever they support.
For PQ migration, the practical pattern:
- Issue legacy ECDSA-signed leaf cert.
- Add a “certificate transparency”-style attestation containing an ML-DSA signature over the same cert content.
- Modern verifiers check both; legacy verifiers check only ECDSA.
Production-ready in 2025-2027 timeframe; experimental today via OQS-OpenSSL.
Pattern 3 — Hybrid signatures in JWT
JWT extension for hybrid:
{
"alg": "PS256+ML-DSA-65",
"typ": "JWT"
}
.
{
"sub": "user-123",
"iss": "auth.example.com",
"exp": 1735689600
}
.
{
"ps256_sig": "<base64>",
"mldsa_sig": "<base64>"
}
Verifier checks based on its capability. Token is larger but explicit about the hybrid.
Pattern 4 — Algorithm versioning in stored data
Encrypted-at-rest data should carry algorithm metadata:
{
"version": "v3",
"kem_alg": "ml-kem-768",
"kem_ciphertext": "<base64>",
"aead_alg": "aes-256-gcm",
"iv": "<base64>",
"ciphertext": "<base64>",
"tag": "<base64>"
}
When you migrate algorithms in 2030, the new format is “v4” with different alg names. Old encrypted blobs are still readable; new blobs use new algorithms. Decryption code handles both.
Pattern 5 — Automated key-rotation
If rotating a key requires manual operations across multiple systems, you’ll never do it preventatively. Automate:
- Application keys: HashiCorp Vault, AWS Secrets Manager, GCP Secret Manager — auto-rotation with versioning.
- TLS certificates: cert-manager (Kubernetes), Let’s Encrypt + acme.sh, AWS ACM.
- SSH host keys: configuration management (Ansible, Salt) with playbook for rotation.
- Code-signing keys: HSM-resident, with documented rotation runbook tested annually.
Pattern 6 — Forward-secrecy at the protocol layer
Even if your long-term keys are compromised in 2035, sessions encrypted with ephemeral PQ KEM keys remain confidential. TLS 1.3 enforces forward secrecy by design; ensure your stack negotiates only PFS-providing cipher suites (which all TLS 1.3 do).
Organizational habits for crypto-agility
- Quarterly cryptographic-inventory refresh. Don’t let the inventory go stale.
- Annual algorithm-deprecation review. NIST issues guidance; review and align.
- Cryptographic-design review for any new system handling sensitive data. Force engineers to specify algorithm choices and crypto-agility plan up-front.
- Centralised crypto library / service instead of every team rolling its own. Reduces inconsistency, simplifies migration.
- Documentation: maintain a cryptographic-bill-of-materials (CBOM). Like SBOM but for cryptographic primitives.
Anti-patterns to avoid
- Hardcoded algorithm strings in application code. Always go through a library/abstraction.
- “We’ll add agility later” — adding it to a deployed system is harder than designing for it.
- One-time migration sprints without ongoing inventory. Migration is continuous.
- “Vendor will handle it” — vendors handle their products; the integration glue is yours.
- Mixing algorithm choices in unmanaged ways: half your microservices use ML-DSA-65, half use ML-DSA-44. Standardise.
FAQ
How do we balance agility with simplicity?
Start with the smallest set of supported algorithms (e.g., one classical + one PQ per purpose). Add support only when needed. Excess agility is expensive too.
Should every microservice be crypto-agile?
If it touches cryptography, yes. The cost of retrofitting is much higher than designing for it. Make crypto-agility a default architectural principle.
Are there frameworks for this?
HashiCorp Vault is the strongest open-source option; AWS KMS and GCP KMS are managed equivalents. For self-built apps: libsodium abstracts most cryptography; combine with config-driven algorithm selection.
How does crypto-agility interact with FIPS compliance?
FIPS validates specific algorithms in specific modes. Crypto-agility means your system supports multiple FIPS-validated algorithms with config-driven selection. Both compatible.
Will this matter beyond the PQ migration?
Yes. The next migration (post-PQ to whatever-comes-next) and the migration after that all benefit from agility. Build it once, harvest forever.
⚖️ Module 13 of 20. Advanced. Module 14 covers PQ-resistant PKI; Module 15 covers blockchain.
Custom team training + practitioner advisory
Beyond the free academy — we run private workshops, vCISO advisory, and red-team exercises tailored to your stack. For Indian SMBs scaling past their first hire.