Skip to content
Back to skills

Post Quantum Ready

ASecurity

Use when building a new application that uses cryptography (TLS, JWT/tokens, signing, webhooks, key exchange, encryption at rest, certificates, SSH, KMS, wallets) OR when auditing/migrating an existing codebase to post-quantum cryptography (PQC). Finds quantum-vulnerable RSA/ECC/DH usage with a scanner, ranks it by harvest-now-decrypt-later risk, and gives concrete, tested replacements (ML-KEM, ML-DSA, SLH-DSA, X25519MLKEM768 hybrid TLS). Triggers: "post-quantum", "PQC", "quantum safe", "quan...

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 4, 2026
developmentpythonrustgojavabashnodedockerawsgcpterraform

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 15 files and shows the line behind each finding

Scanned December 4, 2026

npx -y skills add dilukangelosl/post-quantum-ready-skill --skill post-quantum-ready --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Post Quantum Ready?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Post Quantum Ready
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/dilukangelosl-post-quantum-ready/badge)](https://www.skillsdirectory.com/skills/dilukangelosl-post-quantum-ready)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: post-quantum-ready
description: Use when building a new application that uses cryptography (TLS, JWT/tokens, signing, webhooks, key exchange, encryption at rest, certificates, SSH, KMS, wallets) OR when auditing/migrating an existing codebase to post-quantum cryptography (PQC). Finds quantum-vulnerable RSA/ECC/DH usage with a scanner, ranks it by harvest-now-decrypt-later risk, and gives concrete, tested replacements (ML-KEM, ML-DSA, SLH-DSA, X25519MLKEM768 hybrid TLS). Triggers: "post-quantum", "PQC", "quantum safe", "quantum ready", "migrate RSA", "ML-KEM", "Kyber", "Dilithium", "harvest now decrypt later", "crypto inventory", "CBOM".
metadata:
  author: Diluk Angelo
  version: 1.2.0
---

# Post-Quantum Ready

Two modes. Pick one from the request:

- **NEW**: designing or writing a new app. Follow *Build it PQ-ready*.
- **MIGRATE**: existing codebase. Follow *Find & migrate*.

| File | Read when |
|---|---|
| `references/why-now.md` | someone asks "why now / what are the deadlines" |
| `references/algorithms.md` | choosing algorithms, parameter sets, codepoints |
| `references/recipes.md` | turning PQ on in a specific language, server, cloud, SSH, Terraform |
| `references/patterns.md` | **designing** app-level crypto: hybrid encryption, KMS vs app-level, webhooks, tokens, certificates, mobile, re-encryption, rollout & fallback removal |
| `references/CRYPTO.template.md` | writing the app's crypto inventory + exceptions register |
| `scripts/pq_scan.py` | inventory / CI gate (stdlib Python 3.10+) |
| `examples/pq-ready-node/` | tested Node 24.7+ reference: hybrid X25519+ML-KEM envelope encryption, ML-DSA webhooks, HMAC tokens, nginx, CI |

## Ground rules (both modes)

1. **Don't invent crypto.** Use the platform implementation (OpenSSL 3.5+, Go 1.24+, Node 24.7+, JDK 24+/27, .NET 10, BoringSSL/AWS-LC, rustls). Prefer, in order: (a) PQ TLS / managed KMS, (b) a standard hybrid API (HPKE with ML-KEM or X-Wing, Node 24.22+/26.10+ WebCrypto hybrid KEM, GCP `KEM_XWING`), (c) only if neither exists, the documented combiner in `references/patterns.md`, copied exactly, with its tests.
2. **Key exchange first, signatures right behind.** Traffic recorded today can be decrypted later ("harvest now, decrypt later", HNDL). Forged signatures need a working break, but long-lived signing keys (roots, firmware, code signing, keys valid for years) take years to rotate, so start now. Since the Dec 2026 NSA advisory, don't assume a break needs a quantum computer (why-now.md): don't treat 256-bit ECC signatures (P-256, Ed25519) as safe for years.
3. **Hybrid during transition.** Key agreement uses `X25519MLKEM768` (classical + PQ), not classical-only, and not pure PQ unless a mandate (e.g. CNSA 2.0) requires it.
4. **Symmetric crypto and hashes are fine at size:** AES-256-GCM, ChaCha20-Poly1305, SHA-256+, SHA-3, HMAC-SHA-256+, HKDF, Argon2id. Use AES-256 rather than AES-128 for long-lived data.
5. **Crypto agility:** algorithms live in config/one module; every ciphertext, signature, token and key carries an algorithm id + key id (`alg`, `kid`, version), so rotation is a config change.
6. **Fallback is a phase, not the end state.** Recipes ship `PQ-hybrid first, classical last` so old clients still connect. *Done* = you measured the negotiated group (patterns.md → "Rollout") and removed the classical fallback, or recorded why not.
7. **Exceptions are written down.** Anything that can't move yet goes in `CRYPTO.md` (owner, reason, review date) and `.pq-scan-ignore`.
8. **Interim classical, when PQ isn't available yet.** For new private roots, CAs and long-lived keys where ML-DSA isn't supported, use RSA-3072+ or P-384, which is the NSA advisory's base size for roots, and record an exception. Don't create new long-lived P-256 or Ed25519 keys.

## NEW: Build it PQ-ready

Decide each row, then record it in `CRYPTO.md` (template: `references/CRYPTO.template.md`).

| Concern | Use today | Avoid | Details |
|---|---|---|---|
| Inbound TLS (edge/server) | TLS 1.3, groups `X25519MLKEM768:X25519`; log negotiated group | TLS ≤1.1; groups list without ML-KEM | recipes.md (nginx, Go, Node…) |
| Outbound TLS (to DBs, APIs, partners) | Runtime that offers X25519MLKEM768 by default (OpenSSL 3.5, Go 1.24, Node 24.5, JDK 27) | Pinning classical curves | recipes.md |
| TLS certificate | ECDSA P-256 from a public CA **today** (record as exception); move to ML-DSA / Merkle Tree Certs when CAs + clients support them | Long-lived manual certs | patterns.md → Certificates |
| Data at rest | KMS/HSM envelope encryption (AES-256-GCM DEKs) when the server can call KMS; **app-level hybrid KEM** only for offline / end-to-end / "server must not decrypt" cases | RSA-OAEP / ECIES wrapping | patterns.md → Encryption at rest |
| Tokens (sessions, mobile access) | Issuer == verifier → HMAC (HS256) or opaque tokens, short TTL, `kid`; third parties verify → ML-DSA JWS (RFC 9964) or KMS-held ML-DSA | Long-lived RS256/ES256 | patterns.md → Tokens |
| Webhooks / outbound signatures | Per-partner HMAC-SHA-256 (simplest, PQ-safe) or ML-DSA-65 with context string, `id.timestamp.body`, dual-sign on rotation | ECDSA/RSA keys valid for years | patterns.md → Webhooks |
| Documents / releases / firmware signing | ML-DSA-65; SLH-DSA or LMS/XMSS for roots, firmware, code signing | RSA/ECDSA-only for new long-lived keys | algorithms.md |
| Passwords | Argon2id / scrypt / bcrypt (unchanged) | — | — |
| SSH | `KexAlgorithms mlkem768x25519-sha256,...` (default since OpenSSH 10.0); host/user keys `ssh-mldsa44-ed25519` (OpenSSH 10.6+), ed25519 fallback for old clients | `diffie-hellman-group*`, `ssh-rsa` | recipes.md → SSH |
| Mobile clients | Verify the HTTP stack offers X25519MLKEM768 (iOS 26+ system TLS; Android: check OkHttp/Conscrypt/Cronet version) | Assuming the server alone makes the link PQ | patterns.md → Mobile |
| Blockchain / wallets | Chain-mandated secp256k1/Ed25519: isolate signer behind one interface, no address reuse, follow the chain's PQ plan; make all off-chain crypto PQ now | Treating on-chain ECDSA as PQ-safe | recipes.md → Blockchain |

**NEW deliverables** (produce all of them):
1. `CRYPTO.md`, filled from the template: every algorithm, where it is used, data lifetime, key storage, rotation plan, exceptions.
2. Edge/TLS config (nginx/Caddy/LB) with PQ groups + negotiated-group logging.
3. One crypto module that owns all public-key crypto (see `examples/pq-ready-node/src/crypto.mjs`), with a round-trip + tamper test.
4. Pinned runtimes: `engines`/`go`/base image with OpenSSL ≥ 3.5, plus a CI step that fails if the runtime lacks ML-KEM.
5. CI gate: copy `scripts/pq_scan.py` to `tools/pq_scan.py` (it skips itself) and run `python3 tools/pq_scan.py . --fail-on high`.

## MIGRATE: Find & migrate

### Step 1: Inventory

```bash
python3 <skill-dir>/scripts/pq_scan.py <repo>                        # report, grouped by severity/file
python3 <skill-dir>/scripts/pq_scan.py <repo> --min-severity medium  # hide low
python3 <skill-dir>/scripts/pq_scan.py <repo> --json > pq-inventory.json   # CBOM seed
python3 <skill-dir>/scripts/pq_scan.py <repo> --fail-on high         # CI gate (exit 1)
```

What the scanner does and doesn't do:
- Regex heuristic over code and config in about 40 languages/formats. It flags RSA/ECDH/DH/DSA/ECDSA/EdDSA/secp256k1 APIs, JWT RS*/ES*/PS*/EdDSA/ECDH-ES, committed private keys, TLS versions and group lists, SSH KEX and host keys, KMS key specs, Kyber drafts, classical crypto dependencies, AES-128, MD5 and SHA-1.
- Downgrades to **low**, with a tag: test/fixture/example paths, comment lines, import lines, and classical key exchange in a file that actually calls ML-KEM (likely the classical half of a hybrid, so verify it).
- Can't see crypto inside dependencies, cloud services, HSMs or binaries. String literals that mention algorithms can produce false hits; suppress those.
- Suppress accepted findings with a `pq-scan: ignore` comment on the line, or a `.pq-scan-ignore` file at the scan root (`<glob> [rule-id]  # reason, owner, date`). Use the file for JSON and other configs that can't hold comments.

Then **read the flagged code**, and check what the scanner can't see:
- Runtime/library versions: `openssl version`, `nginx -V 2>&1 | grep -i openssl`, `node -p process.versions.openssl`, `go version`, `java -version`, base Docker images, lockfiles.
- Live endpoints (needs local OpenSSL ≥ 3.5):
  ```bash
  openssl s_client -connect HOST:443 -servername HOST -groups X25519MLKEM768 -tls1_3 </dev/null 2>&1 | grep -q 'group: X25519MLKEM768' && echo "PQ OK" || echo "NOT PQ"
  ```
- Cloud KMS/HSM key specs, CA/cert profiles, SSH host keys, VPNs, DB/broker TLS, third-party APIs, mobile client TLS stacks.

### Step 2: Prioritize

Rank by **how long the secret must stay secret** (for encryption) or **how long the key stays valid** (for signatures), times exposure:

| Priority | What | Examples |
|---|---|---|
| **Critical** | Key exchange / public-key encryption protecting data that must stay secret more than ~5 years, over networks | Public TLS group config, RSA-OAEP/ECIES on stored PII, VPN, X25519-only app protocols |
| **High** | Long-lived signing keys (valid ≥ 1 year), legacy TLS, classical KMS keys | Root/intermediate CA, code/firmware/release signing, IdP/SSO keys, webhook keys valid for years, custody keys |
| **Medium** | Short-lived auth signatures, SSH KEX and host/user keys, TLS 1.2 floor, crypto deps | JWTs ≤ 1 day, session signing, internal mTLS, `ssh-ed25519` keys |
| **Low** | Informational / classical hygiene | AES-128 → 256, MD5/SHA-1 |

The scanner's severities follow this table, but it can't know lifetimes. Raise a finding's priority when its data or key lives long.

### Step 3: Migrate (cheapest wins first)

1. **Upgrade runtimes/libraries.** Hybrid PQ TLS usually turns on by default (versions in recipes.md). Then remove any hard-coded classical-only group/curve lists.
2. **Put a PQ-terminating edge in front** of anything you can't upgrade yet (Cloudflare, AWS ALB/NLB/CloudFront PQ policies, nginx/Caddy on OpenSSL 3.5), and tunnel internal traffic over PQ links.
3. **Replace app-level key exchange/encryption** (patterns.md → Encryption at rest):
   - Use KMS envelope encryption, or the hybrid KEM pattern.
   - Keep a **dual-read period**: decrypt both old and new formats (switch on the `alg` field), write only the new one, re-encrypt in the background, then delete the old keys.
   - The recipient key format changes (one RSA key becomes an X25519 + ML-KEM pair), so update every caller and key-distribution path.
4. **Introduce agility.** Put all crypto behind one module and tag outputs with `alg`/`kid`.
5. **Signatures.** Move long-lived keys to ML-DSA-65 / SLH-DSA as your KMS/HSM/CA/runtime supports. Dual-sign (classical + ML-DSA) while verifiers upgrade. Where a counterpart can't verify ML-DSA yet, use per-party HMAC (PQ-safe) or record an exception.
6. **Remove classical fallback** once the measured share of non-PQ handshakes is acceptable (patterns.md → Rollout).

Language-specific traps are in recipes.md. Examples: Go needs 1.24 for `crypto/mlkem`, `crypto/hkdf` and `tls.X25519MLKEM768`, and 1.27 for `crypto/mldsa`. Node needs 24.7 for the ML-KEM/ML-DSA APIs, and its `hkdfSync` caps `info` at 1024 bytes. Terraform's `tls_private_key` has no PQ algorithms.

### Step 4: Verify

- Re-run the scanner. Every remaining critical/high finding is either fixed or listed in `CRYPTO.md` + `.pq-scan-ignore` with an owner, reason and date.
- Run the tests for every changed crypto path (round-trip + tamper + old-format read).
- Test endpoints with the `openssl s_client` check above, and log the negotiated group in production.
- Add the CI gate (`--fail-on high`).

## Output format

**MIGRATE**: deliver
1. A findings table: file:line, what, severity (after lifetime adjustment), replacement.
2. A prioritized plan in Step 2 order, with concrete diffs for the top items (applied, if asked to change code).
3. An exceptions list (in `CRYPTO.md`, mirrored in `.pq-scan-ignore`).
4. Scanner before/after counts and test results.

**NEW**: the five deliverables listed above.

Version claims change fast. Tie them to `references/recipes.md` ("as of" date), and tell the user to confirm against release notes before pinning.

Files in this skill

  • SKILL.md12.1 KB
  • examples/pq-ready-node/.github/workflows/ci.yml513 B
  • examples/pq-ready-node/.nvmrc8 B
  • examples/pq-ready-node/CRYPTO.md3.9 KB
  • examples/pq-ready-node/deploy/nginx.conf1.3 KB
  • examples/pq-ready-node/package.json234 B
  • examples/pq-ready-node/src/crypto.mjs8.5 KB
  • examples/pq-ready-node/test/crypto.test.mjs3.6 KB
  • examples/pq-ready-node/tools/pq_scan.py29.2 KB
  • references/CRYPTO.template.md1.7 KB
  • references/algorithms.md3.7 KB
  • references/patterns.md7 KB
  • references/recipes.md9.8 KB
  • references/why-now.md6.6 KB
  • scripts/pq_scan.py29.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.