How to find quantum-vulnerable cryptography in your code
A practical method to inventory quantum-vulnerable cryptography: search code and config, scan certificates and endpoints, and rank findings by data lifetime.
Published 4 min readBy Imad Ez
On this page
To find quantum-vulnerable cryptography, search for the algorithms that Shor's algorithm breaks (RSA, Diffie-Hellman, ECDH, ECDSA, EdDSA) in four places: source code and configuration, certificates and key files, live network endpoints, and everything a scanner cannot see, such as vendors, HSMs and devices. Then rank each finding by how long the data it protects must stay secret. A first pass over a repository with grep takes minutes; a defensible inventory takes weeks, mostly because of the fourth place.
The aim is not a perfect list. It is enough of a list to decide what to fix first. Read what a quantum computer breaks if you want the background on why these algorithms.
Step 1: search code and configuration
Start with a plain search for the algorithms and the places they hide: key generation, encryption padding, curve names, JWT algorithm names, and TLS or SSH configuration.
grep -rnIiE 'rsa|ecdh|ecdsa|secp(256|384|521)|prime256v1|x25519|ed25519|ssl_ecdh_curve|KexAlgorithms|RS(256|384|512)|ES(256|384|512)|PS256|OAEP|createECDH' \
--exclude-dir=node_modules --exclude-dir=.git .
We ran this form on a small fixture directory containing Python, Go, Node and nginx files and it found the RSA key generation, the OAEP encryption, the ECDH call, the RS256 JWT and the ssl_ecdh_curve line (tested). It will also produce noise, so read results by category.
What the hits mean
| Pattern | What it is | Severity |
|---|---|---|
RSA encryption or OAEP; createECDH; ECDH or DH key agreement | Key establishment or key transport: exposed to harvest now, decrypt later | High |
ssl_ecdh_curve, TLS groups lists, KexAlgorithms | Hard-coded protocol algorithms: review for hybrid groups and TLS 1.3 | High |
| X25519 used for key exchange | Classical; pair with ML-KEM in a hybrid | High |
| RSA key generation | Often the first half of the above; check what it is used for | High |
| RS256, PS256, ES256, EdDSA in JWT or signing code | Signatures: forgery risk, later and lower priority | Medium |
| Ed25519 key generation or signing | Signatures | Medium |
Bare curve names (prime256v1, secp256r1) | Depends on context: key exchange is high, signatures are medium | Read the line |
| SHA-1, AES-128 | Not a quantum problem as such; AES-128 has a thinner margin, SHA-1 is already weak | Low |
The distinction between key establishment and signatures drives the ranking. Key establishment is attackable retroactively on recorded data; signatures need a quantum computer at the time they are trusted. See harvest now, decrypt later.
Also look for hints of progress: any mention of X25519MLKEM768, ml-kem, ML-DSA or mlkem tells you a team is already ahead of this list.
Languages and libraries to include
Check each ecosystem's crypto entry points, not only the word "rsa". Typical places: Python cryptography (rsa, ec, padding.OAEP), Go crypto/rsa, crypto/ecdsa, crypto/ed25519, crypto/elliptic; Node crypto.createECDH, generateKeyPairSync('rsa'), jsonwebtoken and jose algorithm options; Java KeyPairGenerator.getInstance("RSA"), Cipher.getInstance("RSA/..."), KeyAgreement; shell scripts with openssl genrsa, openssl rsautl, gpg; infrastructure-as-code with TLS policies and key types.
You can paste a snippet into the code scanner to see line-by-line findings with severity and a suggested replacement. It runs in your browser, nothing is uploaded, and it is a teaching tool, not an audit.
Step 2: certificates and key files
Search the file system and repositories for certificates and keys, then read their algorithms.
# Public key algorithm and signature algorithm of a certificate
openssl x509 -in cert.crt -noout -text | grep -E "Public Key Algorithm|Signature Algorithm"
On our fixture certificates this printed rsaEncryption with sha256WithRSAEncryption, id-ecPublicKey with ecdsa-with-SHA256, ED25519, and ML-DSA-65 for a post-quantum one issued with OpenSSL 4.0.3 (tested). Anything except the ML-DSA line is quantum-vulnerable.
Look in: web server and load balancer certificate directories, internal CA stores, Kubernetes secrets, secrets managers, backup key directories, code-signing keystores, SSH authorized_keys and host keys, VPN configuration.
Step 3: live endpoints
Certificates on disk are not the whole story; check what each service actually speaks.
# Key exchange group negotiated with a TLS server (OpenSSL 3.5 or later)
openssl s_client -connect host.example:443 -tls1_3 -groups X25519MLKEM768 </dev/null 2>/dev/null | grep -iE "negotiated tls1.3 group"
# Certificate presented by a live server
openssl s_client -connect host.example:443 </dev/null 2>/dev/null | openssl x509 -noout -text | grep -E "Public Key Algorithm|Signature Algorithm"
# SSH key exchange negotiated
ssh -vv user@host 2>&1 | grep "kex: algorithm"
For public hostnames, the post-quantum TLS check does the first one from our server. For internal endpoints, run the commands from inside your network. A result of a classical-only group, or a handshake failure with the hybrid offered, is a finding.
Step 4: what scanners cannot see
Add by hand, with the owner of each:
- HSM and KMS keys, and how data keys are wrapped.
- VPN and IPsec gateways, remote access, mTLS meshes.
- Databases with encryption at rest, backups, archive tooling.
- Email (S/MIME, PGP), Wi-Fi (802.1X), smart cards.
- Code-signing and firmware pipelines, secure boot, hardware roots of trust.
- SaaS vendors and managed services. Ask them; the migration plan lists seven questions.
- IoT and OT devices that cannot be upgraded.
Step 5: record and rank
For each finding, record: system, algorithm, key size, protocol, owner, data lifetime, exposure (recordable on a network, or stealable at rest), and the vendor's upgrade path. Then assign priority using data lifetime first:
| Priority | Typical finding |
|---|---|
| P0 | Long-lived confidential data with RSA or ECDH key transport or wrapping |
| P1 | Public TLS, VPN, SSH, service-to-service TLS without a hybrid group |
| P2 | Root CAs, code and firmware signing, hardware roots of trust |
| P3 | Short-lived authentication certificates, JWT signing |
You will increasingly see the term cryptographic bill of materials (CBOM) for this kind of inventory. We did not review a specific CBOM standard for this article; use whatever format your tooling already exports, as long as it carries the fields above.
Make it stick
Run the same search in CI so new vulnerable calls do not creep in. Start with a baseline of existing findings and fail the build only on new high-severity ones, otherwise the check gets disabled in a week. Re-run quarterly and record the results.
Next steps
Try the code scanner on a configuration file you know, then turn the findings into tasks with the migration checklist. If you want help running an inventory across repositories, vendors and infrastructure, you can contact a specialist via /en/contact.