Library · |journey⟩ Migration and compliance

Crypto-agility and the cryptographic bill of materials

Designing systems so the next algorithm change is a setting, and keeping a CBOM that stays true over time.

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.

Bytes, from the FIPS standards and common encodings. Bars use a logarithmic scale. FN-DSA is not yet a final standard.
AlgorithmUseSignature / ciphertextSize
X25519key exchange32
Ed25519signature64
ECDSA P-256signature64
RSA-2048both256
ML-KEM-512key exchange768
ML-KEM-768key exchange1,088
ML-KEM-1024key exchange1,568
FN-DSA-512signature666
ML-DSA-44signature2,420
ML-DSA-65signature3,309
ML-DSA-87signature4,627
SLH-DSA-128ssignature7,856
SLH-DSA-128fsignature17,088
Try it: compare public-key and signature sizes across classical and post-quantum schemes.

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.

Cryptographic asset types in CycloneDX 1.6 and typical content (summary; see the CycloneDX specification for the full schema)
Asset typeWhat it describesTypical fields
algorithmA primitive in use, such as RSA, AES, ECDSA or ML-KEMPrimitive (for example signature, key-encapsulation, block cipher), parameter set, crypto functions, security levels
certificateAn X.509 or similar certificateSubject, issuer, validity dates, signature algorithm, public-key reference
related-crypto-materialKeys, tokens, secrets and similar objectsType, size, creation and expiry dates, state, the algorithm it is used with
protocolA protocol and its configuration, such as TLS or SSHProtocol 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.

Illustrative CBOM fragment (field names follow CycloneDX 1.6; the values are invented for the example and are not scanner output)
{
  "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 --baseline with --fail-on new.
  • No findings at or above a chosen severity. The --fail-on option 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.
A gate that passes existing debt and blocks new findings
qsc scan . --baseline qsc-reports/qsc-report.json --fail-on new

Keep 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.

Metrics for crypto-agility and inventory quality
MetricWhat it tells you
Share of systems with an inventory entryCoverage of the CBOM against your asset list
Age of the last scan per systemHow stale the inventory is
Hard-coded algorithm findings, trendWhether the code is becoming more agile
Share of certificates issued and renewed by automationWhether rotation is routine
Time to change an algorithm in a pilot systemThe real cost of a change, measured by doing one
New findings blocked by the gate, per monthWhether the gate is catching real regressions
Exceptions open and past their expiryPolicy 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

  1. Run qsc scan . --format cbom on one important repository and read the output as an auditor would.
  2. 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.
  3. Grep for hard-coded algorithm names in the code you own, and list which ones sit on a path that handles long-lived data.
  4. Add a baseline and --fail-on new to one build pipeline.
  5. Assign an owner to each system in your top-ten list.
  6. 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.

Sources

  1. OWASP CycloneDX. Cryptographic Bill of Materials (CBOM) in CycloneDX 1.6. 2024-04. https://cyclonedx.org/capabilities/cbom/
  2. NIST. FIPS 203: Module-Lattice-Based Key-Encapsulation Mechanism Standard. 2024-08-13. https://csrc.nist.gov/pubs/fips/203/final
  3. NIST. FIPS 204: Module-Lattice-Based Digital Signature Standard. 2024-08-13. https://csrc.nist.gov/pubs/fips/204/final
  4. NIST. FIPS 205: Stateless Hash-Based Digital Signature Standard. 2024-08-13. https://csrc.nist.gov/pubs/fips/205/final
  5. NIST. NIST IR 8547 (initial public draft): Transition to Post-Quantum Cryptography Standards. 2024-11-12. https://csrc.nist.gov/pubs/ir/8547/ipd
  6. IETF. RFC 9370: Multiple Key Exchanges in the Internet Key Exchange Protocol Version 2 (IKEv2). 2023-05.
  7. NIST. NIST selects HQC as fifth algorithm for post-quantum encryption. 2025-03-11. https://www.nist.gov/news-events/news/2025/03/nist-selects-hqc-fifth-algorithm-post-quantum-encryption
  8. Wouter Castryck and Thomas Decru. An efficient key recovery attack on SIDH. 2022. https://eprint.iacr.org/2022/975
  9. Department of Science and Technology, task force under the National Quantum Mission. Implementation of Quantum Safe Ecosystem in India. 2026-02. https://dst.gov.in/sites/default/files/Report_TaskForce_PQMigration_4Feb26%20%28v1%29.pdf
  10. CERT-In. Technical guidelines on SBOM, QBOM and CBOM (version 2.0). 2025. https://www.cert-in.org.in/