HARD KEEL
Guide

How to find quantum-vulnerable encryption in your code

Before you can move to quantum-safe encryption, you need a list of where RSA and elliptic curves are used, and for what. Here is where to look, and how to search for it.

Hard Keel · November 20, 2026

What you're looking for

A large quantum computer breaks public-key algorithms built on factoring and discrete logarithms. In code, that means:

AES and SHA-256 are not on the list. NIST's final transition plan deprecates all of the above after 2030 and disallows them after 2035. More on the dates.

Where it hides

  1. Your own calls to encryption libraries: generating keys, signing, verifying, encrypting.
  2. Tokens and sessions: JWT algorithms such as RS256, ES256 and EdDSA are RSA or elliptic-curve signatures.
  3. Keys and certificates checked into the repository: PEM files, SSH public keys, test fixtures.
  4. Configuration: TLS settings in web servers, load balancers, Kubernetes ingress and Terraform.
  5. Library defaults you never wrote down: every HTTPS call your code makes negotiates a key exchange. Usually it's elliptic-curve, unless your TLS library offers the hybrid post-quantum option.

Search patterns by language

LanguageLook for
Pythonrsa.generate_private_key, ec.generate_private_key, ec.ECDH, Ed25519PrivateKey, X25519PrivateKey, padding.OAEP, padding.PSS, RSA.generate (PyCryptodome)
JavaScript, TypeScriptgenerateKeyPair('rsa' | 'ec' | 'ed25519' | 'x25519'), createECDH, createDiffieHellman, Web Crypto names RSA-OAEP, RSA-PSS, ECDSA, ECDH, JWT algorithms: ['RS256']
Gorsa.GenerateKey, rsa.SignPSS, ecdsa.GenerateKey, ecdh.P256(), ecdh.X25519(), ed25519.GenerateKey, CurvePreferences in tls.Config
JavaKeyPairGenerator.getInstance("RSA" | "EC"), KeyAgreement.getInstance("ECDH"), Signature.getInstance("SHA256withRSA"), Cipher.getInstance("RSA/...")
Files and configBEGIN RSA PRIVATE KEY, BEGIN EC PRIVATE KEY, ssh-rsa, ecdsa-sha2-nistp256, ssl_ecdh_curve, ssl_protocols

A single ripgrep command gets you a first pass across all of them:

rg -n -i \
  -e 'generate_private_key|RSA\.generate|ECDH|Ed25519|X25519' \
  -e 'generateKeyPair|createDiffieHellman|ecdsa\.' \
  -e 'KeyPairGenerator|KeyAgreement|withRSA|withECDSA' \
  -e '\b(RS|PS|ES)(256|384|512)\b|EdDSA' \
  -e 'ssh-rsa|ecdsa-sha2|BEGIN (RSA |EC )?PRIVATE KEY' \
  -e 'CurvePreferences|ssl_ecdh_curve'

Expect noise. ES256 appears in plenty of places that aren't JWTs, and test fixtures will match. That's fine for a first pass. You're building a list to sort, not a verdict.

Turn the matches into an inventory

A list of line numbers isn't a plan. For each use, record four things:

The standard format for this is a cryptography bill of materials, or CBOM, part of CycloneDX. It gives security teams and auditors one format to read, and gives you a baseline to track change against.

Put it in order

  1. Weak today: MD5, SHA-1, DES, ECB mode, RSA-1024, TLS 1.0 and 1.1. These are a problem now. What to use instead.
  2. Key exchange protecting long-lived data: traffic recorded today can be decrypted later. Move to hybrid X25519MLKEM768 for TLS, or ML-KEM directly.
  3. Signatures: start with long-lived keys such as code signing and root certificates, then move the rest to ML-DSA as your libraries support it.

Keep it current

An inventory goes stale the week after you build it. New code adds new keys, and a dependency upgrade changes a default. The cheapest way to keep it accurate is to check every pull request, so new uses are caught when they're written, while the author still remembers why.

Keep the inventory current on every pull request

Hard Keel Quantum Scan is free. It flags leaked keys, weak encryption and encryption quantum computers will break in each pull request, and keeps a migration plan for the repository.

See how it works

Sources