The algorithms that protect today's systems will change at least once more. RSA, ECDSA and Diffie-Hellman are being replaced by the standards NIST published in August 2024.[2][3][4] Earlier in the same competition, the key-encapsulation candidate SIKE was broken in about an hour on an ordinary computer.[8] Cryptography has always aged, and the question for an organisation is how much it costs to change an algorithm when the time comes.
This article covers the design practice that makes that cost low, the cryptographic inventory format (the CBOM) that makes it visible, and the controls that keep the inventory accurate. It follows on from the migration playbook, which places these ideas in a programme.
What crypto-agility means in practice
Crypto-agility is the ability to replace a cryptographic algorithm, parameter or key without redesigning the system around it. A system with this property can move from RSA-2048 to ML-DSA-65, or from one hybrid key-exchange group to another, as a planned change with a test plan and a rollback. A system without it needs a code change in every place the algorithm is named.
Five practices produce it.
- Algorithms in configuration. The algorithm name, key size, curve and protocol version sit in configuration or policy, where operations staff can change and audit them. The code asks for "the signing algorithm for payment messages" and does not say "RSA with SHA-256".
- Negotiation. Protocols such as TLS, SSH and IKEv2 let both sides agree on an algorithm from a list. A server that offers a hybrid group next to a classical one can serve old and new clients at once. IKEv2 gained a standard way to add a further key exchange in RFC 9370.[6]
- Abstraction layers. One internal library or service wraps all cryptographic calls, so that an algorithm change touches one module. Java's provider architecture and PKCS#11 are existing examples. In-house wrappers work too, if every team uses them.
- Automated rotation. Certificates and keys are issued, deployed and renewed by automation. A team that rotates certificates by hand every year will not manage a fleet-wide change in a quarter. A team whose certificates renew every few weeks already has the pipeline.
- Testing. Interoperability, performance and failure tests run automatically against each configuration you may need. If you only test the algorithm you use today, you will find the problems with the next one in production.
Anti-patterns to find and remove
Hard-coded algorithms
A constant such as "SHA256withRSA" or a call to a function that can only produce RSA keys fixes the algorithm at compile time. Find these first, because changing each one means a build, a test cycle and a release. Move the choice into configuration, and keep the default at the current value.
Fixed-size columns and fields for keys and signatures
Many schemas, message formats and hardware tokens size a field for one algorithm. Post-quantum objects are larger. An RSA-2048 signature is 256 bytes and an ECDSA P-256 signature is about 64 to 72. An ML-DSA-65 signature is 3,309 bytes, and an SLH-DSA-SHA2-128s signature is 7,856.[3][4] ML-KEM-768 has a 1,184-byte public key and a 1,088-byte ciphertext.[2] A VARCHAR(512) or a 1 KB message field is a silent failure waiting to happen. Search for these in schemas, queue message formats, API definitions, smart-card profiles and log pipelines.
| Algorithm | Use | Signature / ciphertext | Size |
|---|---|---|---|
| X25519 | key exchange | 32 | |
| Ed25519 | signature | 64 | |
| ECDSA P-256 | signature | 64 | |
| RSA-2048 | both | 256 | |
| ML-KEM-512 | key exchange | 768 | |
| ML-KEM-768 | key exchange | 1,088 | |
| ML-KEM-1024 | key exchange | 1,568 | |
| FN-DSA-512 | signature | 666 | |
| ML-DSA-44 | signature | 2,420 | |
| ML-DSA-65 | signature | 3,309 | |
| ML-DSA-87 | signature | 4,627 | |
| SLH-DSA-128s | signature | 7,856 | |
| SLH-DSA-128f | signature | 17,088 |
Pinned key sizes and parameters
Pinning a certificate or key size in a client, for example by accepting exactly one public key, defeats rotation. So does a validation routine that rejects any key longer than 4,096 bits or any signature algorithm it does not recognise. Prefer pinning to an identity that you control and can reissue, and write validation code that accepts new algorithms by policy.
Consider a loan-origination system that stores a customer's signed consent as a signature in a database column of 512 bytes, and verifies it with a routine that calls RSA by name. Moving it to ML-DSA-65 needs a schema change, a data migration for existing rows, a new verification path and a decision about how long old signatures stay valid. Each of those is easy once. Discovered one by one during an urgent change, they delay the whole programme. Finding them now, while nothing is urgent, is the cheapest form of preparation.
Other patterns
- Cryptographic choices made inside third-party products with no configuration option. These belong in the vendor register.
- Algorithm identifiers stored as integers or enumerations with no room for new values.
- Key material embedded in firmware, container images or mobile apps, which can only be rotated by shipping a release.
- Long-lived credentials and certificates, whose lifetime is itself a barrier to change.
The CBOM: what CycloneDX 1.6 records
A software bill of materials lists the components in an application. A cryptographic bill of materials (CBOM) lists the cryptographic assets: algorithms, keys, certificates and protocols, and where each is used. CycloneDX 1.6, released in April 2024, added cryptographic assets to its schema, so a CBOM is an ordinary CycloneDX document in which some components have the type cryptographic-asset.[1]
The schema distinguishes four kinds of asset.
| Asset type | What it describes | Typical fields |
|---|---|---|
| algorithm | A primitive in use, such as RSA, AES, ECDSA or ML-KEM | Primitive (for example signature, key-encapsulation, block cipher), parameter set, crypto functions, security levels |
| certificate | An X.509 or similar certificate | Subject, issuer, validity dates, signature algorithm, public-key reference |
| related-crypto-material | Keys, tokens, secrets and similar objects | Type, size, creation and expiry dates, state, the algorithm it is used with |
| protocol | A protocol and its configuration, such as TLS or SSH | Protocol version, cipher suites, linked algorithms |
Components refer to each other by identifier, so a protocol entry can point to the cipher suites it allows, and a certificate to its signature algorithm. A component can also carry evidence, such as the file and line where the scanner found a call. Quantum risk appears as a security level for an algorithm: a classical public-key algorithm such as RSA-2048 has a quantum security level of 0, and ML-KEM-768 has level 3.
{
"bomFormat": "CycloneDX",
"specVersion": "1.6",
"version": 1,
"components": [
{
"type": "cryptographic-asset",
"bom-ref": "crypto/algorithm/rsa-2048",
"name": "RSA-2048",
"cryptoProperties": {
"assetType": "algorithm",
"algorithmProperties": {
"primitive": "signature",
"parameterSetIdentifier": "2048",
"cryptoFunctions": ["sign", "verify"],
"nistQuantumSecurityLevel": 0
},
"oid": "1.2.840.113549.1.1.1"
},
"evidence": {
"occurrences": [
{ "location": "services/payments/src/Signer.java", "line": 42 }
]
}
},
{
"type": "cryptographic-asset",
"bom-ref": "crypto/algorithm/ml-kem-768",
"name": "ML-KEM-768",
"cryptoProperties": {
"assetType": "algorithm",
"algorithmProperties": {
"primitive": "kem",
"parameterSetIdentifier": "768",
"nistQuantumSecurityLevel": 3
}
}
}
]
}Why a standard format matters. A CBOM from a scanner, one from a vendor and one from a cloud inventory can be merged and compared. A regulator or a customer can read it without your tools. India's CERT-In has published guidance that extends bill-of-materials practice to cryptography[10] (low confidence in the knowledge base; verify before relying on it), and the 2026 task-force roadmap there asks vendors to submit CBOMs from the 2027-28 financial year.[9] Expect more customers to ask for one in procurement.
The scanner writes a CBOM with --format cbom, alongside JSON, SARIF, HTML and Markdown. It can also import an existing CycloneDX file with --import, so that vendor-supplied bills of materials join the same inventory.
Keeping the inventory true over time
A one-off inventory is a snapshot. Code changes daily, teams adopt new libraries, and vendors push updates. Three controls keep the CBOM current.
Gates in the pipeline
Run the scanner on every pull request or build, and fail the build when a change adds a weak algorithm. The gate needs a baseline, so that findings that existed before the gate was introduced do not block unrelated work. New code is held to the standard from the day the gate goes live, while the older findings are worked down on the programme's schedule.
Scan cadence
Repositories change often and infrastructure changes less often, so set different cadences. A reasonable starting point is a scan on every change for code, a weekly scan for configuration and infrastructure as code, and a scan of live endpoints and cloud key services at least monthly. Write the cadence into the programme and review it after the first two quarters. These are starting points; set your own by how fast your estate changes.
Ownership
Every item in the inventory needs an owner who can change it. Findings with no owner do not get fixed. Map repositories, hosts and cloud accounts to teams, and route each finding to the team that owns the asset. When a team is reorganised, the mapping is part of the handover.
Policy as code
A policy that lives in a document is read once. A policy that runs in the pipeline is applied every time. Express the rules in a form that a tool can check, store them in version control next to the code, and review changes to them like any other change.
Typical rules, from simple to strict:
- No new findings against the baseline. In the scanner this is
--baselinewith--fail-on new. - No findings at or above a chosen severity. The
--fail-onoption also accepts severity levels such as critical and high. - No classical-only key exchange on internet-facing endpoints after an agreed date.
- No RSA or ECDSA keys for new code-signing certificates.
- No use of SHA-1 or three-key Triple DES, which NIST has already phased out or disallowed.
qsc scan . --baseline qsc-reports/qsc-report.json --fail-on newKeep exceptions in the repository too, with an owner, a reason and an expiry date. An exception without an expiry becomes permanent. NIST IR 8547 proposes deprecating the quantum-vulnerable public-key algorithms at the 112-bit security level after 2030 and disallowing all of them after 2035,[5] which gives a policy a dated end point to point at.
Metrics
Measure agility the same way you measure other engineering properties. Useful measures are few.
| Metric | What it tells you |
|---|---|
| Share of systems with an inventory entry | Coverage of the CBOM against your asset list |
| Age of the last scan per system | How stale the inventory is |
| Hard-coded algorithm findings, trend | Whether the code is becoming more agile |
| Share of certificates issued and renewed by automation | Whether rotation is routine |
| Time to change an algorithm in a pilot system | The real cost of a change, measured by doing one |
| New findings blocked by the gate, per month | Whether the gate is catching real regressions |
| Exceptions open and past their expiry | Policy discipline |
The time-to-change measure is the most honest. Pick one system, change its signature algorithm in a test environment, and record every step and delay. That exercise finds the hard-coded choices that no scanner can see, and it gives you a number that you can compare after the next round of work.
What a scanner cannot see
Pattern-based scanning finds API calls and configuration. It does not trace data flow, so keys built by in-house wrappers can be missed, and settings left at a product's default are not visible in files. It cannot read keys inside an HSM, or the logic inside a commercial product. Combine it with probes of live endpoints, which show what is negotiated, with the vendor questionnaire, and with interviews. Record each gap in the CBOM as an open item so that the inventory shows its own limits. The where cryptography hides article describes the places that need other methods.
What to do now
- Run
qsc scan . --format cbomon one important repository and read the output as an auditor would. - Search schemas and message formats for fields that hold a signature or a public key, and note which are sized for a few hundred bytes.
- Grep for hard-coded algorithm names in the code you own, and list which ones sit on a path that handles long-lived data.
- Add a baseline and
--fail-on newto one build pipeline. - Assign an owner to each system in your top-ten list.
- Run the time-to-change exercise on one system and share the result.
Related reading: The post-quantum migration playbook, Where cryptography hides in an organisation, Choosing post-quantum algorithms and Regulations and deadlines.