By Bonaventure Ogeto · Published · Last verified:
Crypto-Agility and Cryptographic Inventory: How to Find Every RSA and ECC Key in Your Systems
The short answer
Build the inventory in four passes: check what your endpoints present, list the certificates and keys you hold, search code and dependencies for RSA and elliptic-curve calls, and record it all in a cryptographic bill of materials. Replace key exchange first, then long-lived signatures. Crypto-agility means keeping algorithm choices in configuration, so the next swap is easy.
Source: Mctaba Labs, “Crypto-Agility and Cryptographic Inventory: How to Find Every RSA and ECC Key in Your Systems”, last verified 4 December 2026, mctaba.com/learn/cryptography/crypto-agility-cryptographic-inventory
At a glance
- The inventory comes first: CISA, the NSA and NIST say a list of quantum-vulnerable systems lets you begin the quantum risk assessment processes[1], and the UK NCSC wants discovery finished by 2028[2].
- Record what you find in a standard format. CycloneDX added the cryptographic bill of materials (CBOM) in version 1.6, on 9 April 2024[3].
- Replace in order: key exchange first, because recorded traffic can be decrypted later; then long-lived signatures and roots of trust; then the rest, before NIST disallows RSA and elliptic-curve algorithms after 2035[4].
- Crypto-agility is a spectrum rather than a binary property[5], the UK NCSC says. Each algorithm you move from code into configuration makes the next change cheaper.
What is a cryptographic inventory, and why do you need one?
A cryptographic inventory is a list of every place your organisation uses cryptography: which algorithms and key sizes, in which certificates, protocols, libraries and devices, protecting which data. It is the map for the move to post-quantum cryptography, the new algorithms designed to resist quantum computers.
The target is public-key cryptography. NIST lists ECDSA, EdDSA and RSA signatures, and Diffie-Hellman, MQV and RSA key establishment, as vulnerable to Shor's algorithm[4] on a large enough quantum computer. NIST IR 8547 deprecates them after 2030[4] and disallows them after 2035[4]. No such computer exists yet[6], and no published attack breaks deployed encryption. The pressure is time: moving from a new standard to full use has historically taken 10 to 20 years[4].
Every major plan starts with the inventory:
- The CISA, NSA and NIST factsheet of 21 August 2023[7] pairs a cryptographic inventory with a readiness roadmap and talks with vendors.
- NIST's crypto-agility paper, CSWP 39upd1, recommends an inventory built with an assets-centric approach informed by the criticality of the data[8].
- The NSA told US national security system owners to identify quantum-vulnerable cryptographic dependencies[9].
- The UK NCSC wants a full discovery exercise done by 2028[2].
What is crypto-agility?
NIST defines crypto-agility as the capabilities needed to replace and adapt cryptographic algorithms[10] in protocols, applications, software, hardware, firmware and infrastructures while preserving security and ongoing operations. The current version of its paper is CSWP 39upd1, updated on 29 June 2026[10]. It replaced the original CSWP 39, final on 19 December 2025[11] and withdrawn[11] the day the update appeared. The UK NCSC adds that agility is a spectrum rather than a binary property[5]: you get more agile system by system.
Four reasons it matters now:
- The migration comes in steps. The NCSC expects at least two steps[5] for most systems: add post-quantum algorithms, then remove the old ones. Each step touches every system your inventory finds.
- Algorithms can still weaken. Anthropic said its lattice results lower its long-term confidence in structured lattices, the maths under ML-KEM and ML-DSA, calling them “a limited signal that weaknesses in structured lattices could be found in the future”[12]. The CIRG, a group of cryptographers who serve in a personal capacity[13], recommends designing agile systems so that individual schemes can be replaced quickly[14].
- Early adopters are already swapping. AWS said it would remove the draft Kyber algorithm from all its endpoints in 2026[15] in favour of the final ML-KEM.
- Certificates are slow. Google's Chrome team says a lack of agility in web certificates has contributed to significant delays in past cryptographic transitions[16].
Where do RSA and elliptic-curve keys hide?
Look far beyond the certificate on your website. The CISA factsheet points at systems that create and validate digital signatures, including software and firmware updates[1].
| Where to look | What to record | How to find it |
|---|---|---|
| Public websites and APIs | TLS versions, key exchange groups, certificate key types and expiry | openssl s_client against every hostname you own |
| Internal services | Mutual TLS certificates and internal certificate authorities | Service mesh, load balancer and CA records |
| Certificate and key files | RSA, ECDSA and Ed25519 keys, sizes, expiry dates | A scan of PEM files; keytool -list -v for Java keystores |
| SSH | Host and user key types; key exchange methods | ssh-keygen -lf and ssh -Q kex |
| VPNs and network gear | IKE and IPsec settings, device certificates | Vendor consoles and configuration exports |
| Code and dependencies | Calls to RSA, ECDSA and ECDH; token algorithms such as RS256 and ES256 | Code search, dependency lists, software bills of materials |
| Signing systems | Code-signing, firmware and document-signing keys | Build pipelines, hardware security module (HSM) and public key infrastructure (PKI) records |
| Cloud keys and HSMs | Key types held, and the TLS used to reach them | Provider consoles; for AWS KMS, CloudTrail's tlsDetails.keyExchange[17] field |
| Partner integrations | Encryption a partner's API requires | Integration documents and code |
Partner APIs are the easiest to miss. Safaricom's Daraja documentation, as archived in December 2019[18], had developers produce the SecurityCredential by encrypting a password with RSA and the M-Pesa public key certificate[18]. RSA used that way lives in application code, where no certificate scan will see it. Check the current documentation for what applies today.
How do you build a cryptographic bill of materials (CBOM)?
A software bill of materials (SBOM) lists the components inside your software. A cryptographic bill of materials (CBOM), which CycloneDX's own pages call a cryptography bill of materials, adds the cryptography. CycloneDX introduced it in version 1.6[3], announced by OWASP on 9 April 2024[3] and developed by IBM Research. The format simplifies the discovery, management and reporting of cryptographic assets[3] and represents algorithms, keys, certificates and their relationships to software components[19].
Here is a minimal CBOM for one API and its certificate. It validates against the CycloneDX 1.6 schema:
cbom.json{
"bomFormat": "CycloneDX",
"specVersion": "1.6",
"version": 1,
"components": [
{ "type": "application", "bom-ref": "app/payments-api", "name": "payments-api" },
{
"type": "cryptographic-asset",
"bom-ref": "cert/api",
"name": "api.example.co.ke",
"cryptoProperties": {
"assetType": "certificate",
"certificateProperties": {
"subjectName": "CN=api.example.co.ke",
"notValidAfter": "2027-03-01T00:00:00Z",
"signatureAlgorithmRef": "alg/ecdsa-p256",
"certificateFormat": "X.509"
}
}
},
{
"type": "cryptographic-asset",
"bom-ref": "alg/ecdsa-p256",
"name": "ECDSA",
"cryptoProperties": {
"assetType": "algorithm",
"algorithmProperties": {
"primitive": "signature",
"curve": "secp256r1",
"cryptoFunctions": ["sign", "verify"],
"nistQuantumSecurityLevel": 0
}
}
}
],
"dependencies": [
{ "ref": "app/payments-api", "dependsOn": ["cert/api"] }
]
}A nistQuantumSecurityLevel of zero means the algorithm meets none of NIST's post-quantum security categories, which makes RSA and elliptic-curve entries easy to filter. The dependencies list ties each asset to the application that relies on it, so you can see what breaks when you swap it.
Tools help. CSWP 39upd1 suggests automated data and cryptographic discovery[8], and the NCCoE's preliminary draft NIST SP 1800-38B offers a functional test plan for cryptographic discovery tools[20]. In the US, Executive Order 14412 directs CISA, with NIST, to publish the minimum elements for a cryptographic bill of materials[21].
For developers: how do I list the RSA and ECC keys in my own systems?
Run these only against systems you own or are authorised to assess. They read public certificates and key types; they never print private keys.
What an endpoint presents
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null \
| openssl x509 -noout -subject -enddate -text \
| grep -E 'subject=|notAfter|Public Key Algorithm|NIST CURVE|Public-Key'subject=CN=example.com
notAfter=Feb 22 23:53:08 2027 GMT
Public Key Algorithm: id-ecPublicKey
Public-Key: (256 bit)
NIST CURVE: P-256An elliptic-curve P-256 key: quantum-vulnerable, so it goes on the list. The post-quantum TLS guide shows how to check the key exchange group as well.
Certificates on disk
cert-inventory.sh#!/usr/bin/env bash
# List every certificate under a directory you own, with its key type and expiry.
# Usage: ./cert-inventory.sh /etc/ssl > certs.tsv
# A bundle file is read only as far as its first certificate.
printf 'file\tkey\tbits\tcurve\tsignature\texpires\n'
find "${1:-.}" -type f \( -name '*.pem' -o -name '*.crt' -o -name '*.cer' \) | while read -r f; do
text=$(openssl x509 -in "$f" -noout -text 2>/dev/null) || continue
key=$(awk -F': ' '/Public Key Algorithm/ {print $2; exit}' <<<"$text")
bits=$(grep -oE '\([0-9]+ bit' <<<"$text" | head -1 | tr -dc '0-9')
curve=$(awk -F': ' '/ASN1 OID/ {print $2; exit}' <<<"$text")
sig=$(awk -F': ' '/Signature Algorithm/ {print $2; exit}' <<<"$text")
end=$(openssl x509 -in "$f" -noout -enddate | cut -d= -f2)
printf '%s\t%s\t%s\t%s\t%s\t%s\n' "$f" "$key" "${bits:--}" "${curve:--}" "$sig" "$end"
doneRun against a test folder holding one certificate of each key type, piped through column -t -s $'\t':
file key bits curve signature expires
certs/rsa.pem rsaEncryption 2048 - sha256WithRSAEncryption Jan 2 22:53:39 2027 GMT
certs/mldsa.pem ML-DSA-65 - - ML-DSA-65 Jan 2 22:53:39 2027 GMT
certs/ec.pem id-ecPublicKey 256 prime256v1 ecdsa-with-SHA256 Jan 2 22:53:39 2027 GMT
certs/ed.pem ED25519 - - ED25519 Jan 2 22:53:39 2027 GMTThree of the four are quantum-vulnerable. The ML-DSA row is a post-quantum certificate. OpenSSL 3.5[22] added ML-DSA, so it and later versions can read it; older tools print only an object identifier.
SSH keys and code
ssh-keygen -lf ~/.ssh/authorized_keys # type and size of each authorised key
ssh -Q kex | grep -i mlkem # hybrid post-quantum key exchange your client supports
grep -rnoE "generateKeyPair(Sync)?\('(rsa|ec)'|createSign\('[A-Z0-9-]+'|algorithm: '(RS|ES|PS)[0-9]+'|crypto/(rsa|ecdsa|ecdh|elliptic)|KeyPairGenerator\.getInstance\(\"(RSA|EC)\"\)" src/ | sort3072 SHA256:IWNdNj6IIaL4/ogi8QMH1WfxQaGUa3aMmba96nvm70M deploy@ci (RSA)
256 SHA256:0TKhvYOt5D3gq+hq+xF90uAika3w7h2RmYpQd9ZBzHU ops@laptop (ECDSA)
256 SHA256:i9VZI8GbE2tFSUTw8xuskgk66VUfz2kVAugQDkSXrD0 dev@laptop (ED25519)
mlkem768x25519-sha256
src/jwt.ts:2:algorithm: 'ES256'
src/main.go:2:crypto/ecdsa
src/main.go:2:crypto/elliptic
src/sign.ts:2:generateKeyPairSync('rsa'
src/sign.ts:3:createSign('RSA-SHA256'That output comes from test keys and a small sample project. The pattern covers Node.js, Go and Java calls; extend it for your languages. Dependencies need the same pass:
npm ls jose jsonwebtoken node-forge # JavaScript libraries that sign or encrypt
go list -m all | grep -iE 'jwt|crypto' # the same question for Go modulesAdd each finding to the CBOM as a component linked to the application that uses it.
In what order should you replace RSA and ECC?
| Priority | What | Why |
|---|---|---|
| First | Key exchange in TLS, VPNs and SSH | Recorded traffic can be decrypted later, which NIST calls one of the main reasons[4] the transition is urgent; for TLS, the NCSC says you should be aiming to make this move now[23] |
| Second | Long-lived signatures: certificate authority roots, firmware and code signing | The NCSC says forgery should be considered before a cryptographically relevant quantum computer (CRQC) exists[24] for long-lived trust anchors, and CNSA 2.0 wants US national security software and firmware signing on the new algorithms by 2030[25] |
| Third | Everyday signatures: TLS certificates, tokens, documents | NIST deprecates these algorithms after 2030[4]; move as ML-DSA support reaches your stack |
| Last | Removing RSA and ECC altogether | The second step of the migration; NIST disallows them after 2035[4] |
Hardware deserves early attention even when its keys are not first in line: the NSA warned that missing quantum-resistant protection at purchase can mean costly hardware replacement[9].
For the replacement algorithms themselves, see the NIST post-quantum standards guide. The real risks of post-quantum migration covers what can go wrong during the swap, and the readiness checklist for Kenyan and African businesses turns this order into owners and dates.
For developers: how do I keep algorithm choices in configuration?
- Negotiate rather than hard-code. The NCSC advises standardised protocols that allow the negotiation of cryptographic algorithms[5], and libraries that can be updated to add and remove algorithms. In TLS, that means a group list in configuration.
- Put cryptography behind one module. Application code asks for a purpose, such as signing a token, and one module decides the algorithm.
- Label what you store. Keep the algorithm name and key ID beside every signature, token and ciphertext, so old and new formats can coexist during the change.
- Test outside production first. The NCCoE's preliminary draft NIST SP 1800-38C covers finding and resolving compatibility issues between quantum-ready algorithms[20] in a non-production environment.
crypto-policy.ts// One place decides which algorithm each job uses. Application code asks for a purpose.
type Purpose = 'tls-groups' | 'token-signing' | 'webhook-mac';
const policy: Record<Purpose, string> = {
'tls-groups': process.env.TLS_GROUPS ?? 'X25519MLKEM768:X25519:P-256',
'token-signing': process.env.TOKEN_ALG ?? 'ES256',
'webhook-mac': 'HMAC-SHA512',
};
export const algorithmFor = (purpose: Purpose): string => policy[purpose];
// Store the algorithm and key id beside every signature, so old and new formats can coexist.
export interface SignedValue {
alg: string; // 'ES256' today, a post-quantum algorithm later
kid: string;
sig: string;
}Changing TOKEN_ALG then becomes a deployment setting, not a code change, as long as every verifier reads alg and kid from the stored value and its library supports the new algorithm. The cryptography series hub has the rest of the series.
Frequently asked questions
- What is a CBOM?
- A cryptographic bill of materials: a machine-readable list of the cryptographic assets in a system and the software that uses them. CycloneDX introduced it in version 1.6[3], and it covers algorithms, keys, certificates and their relationships to software components[19].
- When should a cryptographic inventory be finished?
- The UK NCSC asks organisations to complete a full discovery exercise and an initial migration plan by 2028[2]. Treat it as a living record after that, because every new system and supplier adds cryptography.
- Do I need to replace AES and SHA-256 too?
- No. NIST does not expect to need to transition away[4] from its symmetric standards as part of the post-quantum migration. List them anyway: an AES key that travels inside an RSA-encrypted message is only as safe as the RSA.
- Are there tools that find cryptography automatically?
- Yes, and NIST encourages them. CSWP 39upd1 suggests automated data and cryptographic discovery[8], and the preliminary draft NIST SP 1800-38B sets out a functional test plan for cryptographic discovery tools[20]. Compare any tool's output with manual scans, because a scanner sees only what it can reach.
Sources
- [1] CISA, 21 August 2023, checked 4 December 2026
- [2] UK National Cyber Security Centre (NCSC), 20 March 2025, checked 4 December 2026
- [3] OWASP CycloneDX, 9 April 2024, checked 4 December 2026
- [4] NIST, October 2026, checked 4 December 2026
- [5] UK National Cyber Security Centre, 3 December 2026, checked 4 December 2026
- [6] NIST, 27 February 2026, checked 4 December 2026
- [7] CISA, 21 August 2023, checked 4 December 2026
- [8] NIST, 29 June 2026, checked 4 December 2026
- [9] National Security Agency, 2 December 2026, checked 4 December 2026
- [10] NIST CSRC, 29 June 2026, checked 4 December 2026
- [11] NIST CSRC, 19 December 2025, checked 4 December 2026
- [12] Anthropic (X post), 30 November 2026, checked 4 December 2026
- [13] Cryptography Incident Review Group, 30 November 2026, checked 4 December 2026
- [14] Cryptography Incident Review Group, 30 November 2026, checked 4 December 2026
- [15] Amazon Web Services (AWS Security Blog), 7 April 2025, checked 4 December 2026
- [16] Google (Chromium Blog), 23 May 2024, checked 4 December 2026
- [17] Amazon Web Services, checked 4 December 2026
- [18] Safaricom Daraja developer portal (API Documentation), Internet Archive snapshot of 10 December 2019, 10 December 2019, checked 4 December 2026
- [19] OWASP CycloneDX, checked 4 December 2026
- [20] NIST CSRC (NCCoE), 19 December 2023, checked 4 December 2026
- [21] The White House, 22 June 2026, checked 4 December 2026
- [22] OpenSSL Library, 8 April 2025, checked 4 December 2026
- [23] UK National Cyber Security Centre, 15 October 2026, checked 4 December 2026
- [24] UK National Cyber Security Centre, 14 August 2024, checked 4 December 2026
- [25] National Security Agency, 7 September 2022, checked 4 December 2026
Related guides
- NIST Post-Quantum Standards Explained: ML-KEM, ML-DSA, SLH-DSA, FN-DSA and HQC
- The Real Risks of Post-Quantum Migration: Bugs, Side Channels and Broken Assumptions
- Post-Quantum Readiness for Kenyan and African Businesses: A Practical Checklist
- How to Enable Post-Quantum TLS Today: A Developer Guide
- Cryptography explained: the full series
