Python MIT License Open Source Project

Post Quantum Cryptography Scanner in Python: Find RSA and ECC, Plan ML-KEM (Free Code)

Post quantum cryptography scanner in Python: find RSA, ECC, MD5 and SHA-1 in your code, get a CBOM, a score and an ML-KEM/ML-DSA migration plan. Free code.

Project Specifications & Technical Summary

Difficulty Beginner
License MIT License

Post quantum cryptography (also written post-quantum cryptography) is the set of new encryption and signature algorithms designed to stay secure even when large quantum computers arrive. The hard part of moving to it is not the maths. It is finding every place your project still uses RSA, elliptic curves, Diffie-Hellman, MD5 or SHA-1. In this tutorial you will build a post quantum cryptography readiness scanner in Python that does exactly that: it reads your own code, configs, dependencies and certificates, and produces a cryptographic bill of materials (CBOM), a 0-100 readiness score and an ordered migration plan to ML-KEM and ML-DSA.

It is a strong final-year or mini project for BTech, MCA and MTech students who want a cybersecurity project that is modern, practical and easy to demo. The tool is strictly defensive: it only reads files you point it at, never executes or changes them, and never prints private key contents. The complete code is free on GitHub under the MIT License, with two example projects, sample reports, CI and 126 passing pytest tests.

What You Will Build: A Post Quantum Cryptography Scanner

The project is a command-line tool called pqc-scan. You point it at a folder and it answers three questions a security team asks first: where do we use quantum-vulnerable cryptography, how bad is it, and what should we replace it with?

CommandWhat it does
pqc-scan scan PATHInventories crypto in source code, configs, dependencies, certificates and keys, then prints a score and a migration plan
-f json | markdown | cyclonedx | sarifWrites the report as JSON, Markdown, a CycloneDX 1.6 CBOM or SARIF for GitHub code scanning
--fail-on high / --min-score 80Turns the scan into a CI gate that fails the build until the migration is done
pqc-scan tls HOSTOptionally checks the TLS handshake of a server you own (protocol, certificate key and signature hash)
pqc-scan algorithmsPrints the built-in knowledge base: every algorithm, its quantum status and its replacement
Post quantum cryptography scanner architecture: project files, five detectors, knowledge base and CBOM, score and migration plan outputs
How the scanner works: a safe file walker, five read-only detectors and a knowledge base that labels every hit.

Every finding is labelled with one of four statuses, so students and reviewers can read the report without a cryptography background:

StatusMeaningExamples
vulnerableBroken by Shor’s algorithm on a large quantum computerRSA, ECDSA, ECDH, Diffie-Hellman, DSA, Ed25519, X25519
deprecatedAlready weak today, no quantum computer neededMD5, SHA-1, 3DES, RC4, TLS 1.0 and 1.1
weakenedGrover’s algorithm halves the strength, so use bigger parametersAES-128, TLS 1.2 (no post-quantum key exchange)
pq-safeQuantum-resistant at current parametersML-KEM, ML-DSA, SLH-DSA, AES-256, SHA-384, hybrid X25519MLKEM768

Why Post Quantum Cryptography Matters Right Now

On 2 December 2026 the US National Security Agency published a press release titled NSA Advises Immediate Transition to Post-Quantum Cryptography to Protect National Security Systems. It warns that adversaries are already collecting encrypted data to decrypt later, and its first recommended action is to inventory cryptographic dependencies, including public-key algorithms, digital signatures and firmware validation. The accompanying advisory, summarised by PQC Handbook the same day, also asks organisations to move TLS to version 1.3, reissue certificates with post-quantum algorithms and triage systems that cannot be upgraded yet.

The timing follows research news. On 30 November 2026 Anthropic published four mathematics papers describing quantum algorithms for the lattice problems behind ML-KEM and ML-DSA. As Cloudflare explained on 1 December 2026 and Nature reported, these algorithms are “galactic”: far too expensive to threaten the deployed parameter sets, so post quantum cryptography is still safe to adopt. Outside cryptographers quoted by CNBC on 2 December 2026 recommended continuing the transition, because RSA and elliptic curves fall to far smaller quantum computers.

The standards themselves are settled. NIST published FIPS 203 (ML-KEM), FIPS 204 (ML-DSA) and FIPS 205 (SLH-DSA) in August 2024, and its draft NIST IR 8547 plans to deprecate quantum-vulnerable algorithms such as RSA-2048 after 2030 and disallow them after 2035. Every migration starts with the same step: find out what you use today. That is the job of this project: a post quantum cryptography inventory you can run on your own code in minutes.

Harvest now, decrypt later: data encrypted with RSA or ECDH today can be recorded now and decrypted once a large quantum computer exists. That is why key exchange is near the top of the migration plan.

Features, Tech Stack and Prerequisites

  • Python AST detector: understands cryptography, PyCryptodome, rsa, ecdsa, paramiko, PyNaCl, hashlib, PyJWT and liboqs, resolves import aliases and reads RSA key sizes without running your code.
  • Multi-language patterns for Java/Kotlin, JavaScript/TypeScript, Go, C#, PHP, C/OpenSSL and Rust.
  • Config detector for nginx/Apache TLS protocols, ciphers and groups, OpenSSH KexAlgorithms and HostKey, and JWT alg settings in YAML, JSON, TOML and .env files.
  • Dependency detector for requirements*.txt, pyproject.toml, package.json and go.mod.
  • Key material detector for X.509 certificates (algorithm, size, signature hash, expiry), public keys, OpenSSH keys and private keys committed by mistake.
  • Post quantum cryptography aware: ML-KEM, ML-DSA, X25519MLKEM768 and mlkem768x25519-sha256 count as good signals.
  • Reports: terminal, Markdown, JSON, CycloneDX 1.6 CBOM and SARIF 2.1.0.
ItemVersion / notes
Python3.10 or newer (CI runs 3.10, 3.11, 3.12 and 3.13)
Runtime dependencycryptography (for parsing certificates and public keys)
Dev dependenciespytest, pytest-cov, ruff
OSWindows, macOS or Linux
Prior knowledgeBasic Python, functions and classes. No cryptography maths needed.

Project File Structure

Post-Quantum-Cryptography-Readiness-Scanner-Python/
├── pqc_scanner/
│   ├── cli.py            # pqc-scan scan | tls | algorithms
│   ├── scanner.py        # walks the folder, runs every detector
│   ├── walker.py         # safe file walking (no symlinks, skips vendored/binary/huge files)
│   ├── knowledge.py      # algorithm knowledge base: status, severity, replacement
│   ├── models.py         # Finding dataclass with evidence redaction
│   ├── report.py         # score, migration plan, Markdown/JSON/CycloneDX/SARIF
│   ├── tls_probe.py      # optional TLS check for servers you own
│   └── detectors/        # python_ast, source_regex, config, deps, keys
├── examples/
│   ├── legacy-campus-portal/   # the "before" project (RSA, ECDSA, MD5, TLS 1.0...)
│   └── pq-ready-service/       # the "after" project (ML-KEM, ML-DSA, hybrid TLS)
├── samples/              # generated reports, including a CBOM and a SARIF file
├── tests/                # 126 pytest tests
├── .github/workflows/ci.yml
├── pyproject.toml
└── README.md

Step-by-Step: Build the Post Quantum Cryptography Scanner

Step 1: Set up the project

Clone the repository, create a virtual environment and install the package in editable mode. The pqc-scan command becomes available in your terminal, ready for your first post quantum cryptography inventory.

git clone https://github.com/GetProjectsIdea/Post-Quantum-Cryptography-Readiness-Scanner-Python.git
cd Post-Quantum-Cryptography-Readiness-Scanner-Python
python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate
pip install -e ".[dev]"
pqc-scan --version

Step 2: Write the algorithm knowledge base

Any post quantum cryptography inventory depends on knowing which algorithms are at risk. The core of the scanner is a small table that says, for each algorithm, how it fares against a quantum attacker and what to replace it with. Keeping this in one file (knowledge.py) means every detector and every report uses the same facts.

@dataclass(frozen=True)
class Algorithm:
    name: str
    family: str  # key-exchange, signature, encryption, hash, symmetric, protocol
    status: str
    severity: str
    replacement: str
    note: str = ""


_KEM = "ML-KEM-768 (FIPS 203), or hybrid X25519MLKEM768 in TLS 1.3; ML-KEM-1024 for CNSA 2.0"
_SIG = "ML-DSA-65 (FIPS 204); ML-DSA-87 for CNSA 2.0; SLH-DSA (FIPS 205) or LMS/XMSS for firmware signing"

ALGORITHMS: dict[str, Algorithm] = {
    # Public-key algorithms broken by Shor's algorithm
    "RSA": Algorithm("RSA", "encryption/signature", VULNERABLE, "high",
                     f"Key transport: {_KEM}. Signatures: {_SIG}",
                     "Factoring is solved by Shor's algorithm. NIST IR 8547 deprecates RSA-2048 after 2030."),
    "ECDSA": Algorithm("ECDSA", "signature", VULNERABLE, "high", _SIG,
                       "Elliptic-curve discrete log is solved by Shor's algorithm."),
    "ECDH": Algorithm("ECDH", "key-exchange", VULNERABLE, "high", _KEM,
                      "Harvest-now-decrypt-later: recorded traffic can be decrypted later."),
    "EdDSA": Algorithm("EdDSA", "signature", VULNERABLE, "medium", _SIG,
                       "Ed25519/Ed448 are modern and safe classically, but still elliptic-curve."),
    "X25519": Algorithm("X25519", "key-exchange", VULNERABLE, "medium",
                        "Hybrid X25519MLKEM768 (keeps X25519 and adds ML-KEM)",
                        "Fine classically; pair it with ML-KEM in a hybrid key exchange."),
    "DH": Algorithm("DH", "key-exchange", VULNERABLE, "high", _KEM,
                    "Finite-field Diffie-Hellman is solved by Shor's algorithm."),
    "DSA": Algorithm("DSA", "signature", VULNERABLE, "high", _SIG,
                     "Already removed from FIPS 186-5 for new signatures."),

Notice that Ed25519 and X25519 are marked vulnerable with medium severity. They are excellent classical choices, but they are still elliptic-curve cryptography, so a post-quantum migration plan must include them. The hybrid fix keeps X25519 and adds ML-KEM next to it.

Step 3: Model a finding and redact evidence

Each detector returns Finding objects. The evidence line is cleaned before it is stored, and anything that looks like a private key header is replaced, so a report can never leak key material. RSA keys smaller than 2048 bits are raised to critical, because they are weak today, not only in a quantum future.

def clean_evidence(text: str) -> str:
    """Shorten a matched line for the report and make sure no key material leaks."""
    text = " ".join(text.strip().split())
    if "PRIVATE KEY" in text and "-----" in text:
        return "[private key header - contents redacted]"
    if len(text) > MAX_EVIDENCE:
        text = text[: MAX_EVIDENCE - 3] + "..."
    return text
def severity(self) -> str:
    sev = self.info.severity
    # Small RSA keys are a problem today, not only after a quantum computer arrives.
    if self.algorithm == "RSA" and self.key_size and self.key_size < 2048:
        sev = "critical"
    # A low-confidence hint (for example a generic JWT library in requirements) is only a lead.
    if self.confidence == "low" and SEVERITY_ORDER[sev] > SEVERITY_ORDER["low"]:
        sev = "low"
    return sev

Step 4: Walk the folder safely

A scanner that reads every file can be slow or even dangerous. The walker skips .git, node_modules and virtual environments, ignores binary files and anything over 2 MB, and never follows symbolic links, so a scan cannot wander outside the folder you chose.

def iter_files(root: Path, excludes: tuple[str, ...] = DEFAULT_EXCLUDES,
               extra_globs: tuple[str, ...] = ()) -> Iterator[Path]:
    """Yield readable candidate files under ``root`` in a stable order."""
    root = Path(root)
    if root.is_file():
        if is_candidate(root):
            yield root
        return
    for dirpath, dirnames, filenames in os.walk(root, followlinks=False):
        dirnames[:] = sorted(d for d in dirnames if d not in excludes)
        for fn in sorted(filenames):
            p = Path(dirpath) / fn
            rel = p.relative_to(root).as_posix()
            if any(fnmatch.fnmatch(rel, g) for g in extra_globs):
                continue
            if p.is_symlink() or not is_candidate(p):
                continue
            try:
                if p.stat().st_size > MAX_FILE_BYTES:
                    continue
            except OSError:
                continue
            yield p

Step 5: Detect crypto in Python with the ast module

Searching Python code for the word “rsa” would give many false positives. Instead the detector parses the file with Python’s built-in ast module, remembers what each import alias points to, and matches the fully-qualified name of every call. That is why from cryptography.hazmat.primitives.asymmetric import rsa as r followed by r.generate_private_key(65537, 3072) is still reported as RSA-3072. The code is only parsed, never executed.

def _dotted(self, node: ast.AST) -> str | None:
    parts = []
    while isinstance(node, ast.Attribute):
        parts.append(node.attr)
        node = node.value
    if not isinstance(node, ast.Name):
        return None
    self._last_head = node.id
    head = self.aliases.get(node.id, node.id)
    return ".".join([head, *reversed(parts)])

def _mark_used(self) -> None:
    line = self.alias_line.get(getattr(self, "_last_head", ""))
    if line:
        self.used_lines.add(line)
def visit_Call(self, node: ast.Call) -> None:
    dotted = self._dotted(node.func)
    if dotted:
        alg = _match(dotted)
        if alg:
            self.called.add(alg)
            self._mark_used()
            self._add(alg, node, self._key_size(node, alg, dotted), call=dotted)
        elif dotted == "hashlib.new" and node.args and isinstance(node.args[0], ast.Constant):
            name = str(node.args[0].value).lower()
            if name in HASHLIB_NEW:
                self.called.add(HASHLIB_NEW[name])
                self._add(HASHLIB_NEW[name], node, call=dotted)
        elif dotted.split(".")[0] == "jwt" or dotted.startswith("jose."):
            for kw in node.keywords:
                vals = []
                if kw.arg == "algorithm" and isinstance(kw.value, ast.Constant):
                    vals = [kw.value.value]
                elif kw.arg == "algorithms" and isinstance(kw.value, (ast.List, ast.Tuple)):
                    vals = [e.value for e in kw.value.elts if isinstance(e, ast.Constant)]
                for v in vals:
                    alg = _jwt_alg(str(v))
                    if alg:
                        self.called.add(alg)
                        self._add(alg, node, call=dotted, jwt_alg=str(v))
    self.generic_visit(node)

JWT libraries get special handling: jwt.encode(..., algorithm="RS256") becomes an RSA finding and ES256 becomes ECDSA, while HS256 (a symmetric HMAC) is correctly ignored.

Step 6: Read TLS, SSH and JWT configuration

A lot of real-world cryptography lives in configuration, not code. The config detector understands nginx and Apache TLS settings, OpenSSH key-exchange and host-key lines, and JWT algorithm settings. It also knows the post-quantum names, so mlkem768x25519-sha256 in sshd_config or X25519MLKEM768 in ssl_ecdh_curve are reported as pq-safe.

# OpenSSH names. sntrup761x25519 and mlkem768x25519 are post-quantum hybrids.
SSH_KEX = {
    "mlkem768x25519-sha256": "HYBRID-KEX", "sntrup761x25519-sha512": "HYBRID-KEX",
    "[email protected]": "HYBRID-KEX",
    "curve25519-sha256": "X25519", "[email protected]": "X25519",
    "ecdh-sha2-nistp256": "ECDH", "ecdh-sha2-nistp384": "ECDH", "ecdh-sha2-nistp521": "ECDH",
    "diffie-hellman-group14-sha256": "DH", "diffie-hellman-group16-sha512": "DH",
    "diffie-hellman-group18-sha512": "DH", "diffie-hellman-group-exchange-sha256": "DH",
    "diffie-hellman-group1-sha1": "DH", "diffie-hellman-group14-sha1": "DH",
}
SSH_HOSTKEY = {"ssh-rsa": "RSA", "rsa-sha2-256": "RSA", "rsa-sha2-512": "RSA", "ssh-dss": "DSA",
               "ecdsa-sha2-nistp256": "ECDSA", "ecdsa-sha2-nistp384": "ECDSA", "ssh-ed25519": "EdDSA"}

Cipher strings are split into tokens, and tokens that start with ! are skipped, so HIGH:!RC4:!3DES does not produce false alarms.

Step 7: Inspect certificates and catch committed private keys

Certificates and public keys are parsed with the cryptography package to get the real algorithm, key size, signature hash and expiry date. Private keys are treated differently: the scanner never loads or decrypts them. It reads the PEM header and, for unencrypted PKCS#8 keys, the algorithm identifier, then raises a critical finding telling you to remove and rotate the key.

elif label in PRIVATE_HEADERS:
    alg = PRIVATE_HEADERS[label]
    if alg is None and label == "PRIVATE KEY":
        alg = _oid_alg(der)
    out.append(Finding("PRIVATE-KEY-FILE", rel, n, "private-key", f"-----BEGIN {label}-----",
                       extra={"key_algorithm": alg or "unknown (encrypted or OpenSSH format)"}))
    if alg:
        out.append(Finding(alg, rel, n, "private-key", f"-----BEGIN {label}-----"))

Step 8: Score the project and build the migration plan

The post quantum cryptography readiness score starts at 100 and subtracts points per finding (critical 25, high 8, medium 4, low 1). Only the four worst hits of each algorithm count, so a large codebase is not punished just for being large. The migration plan puts critical items first, then key exchange (because of harvest-now-decrypt-later), then signatures, then legacy hashes and ciphers.

def readiness_score(result: ScanResult) -> dict:
    """0-100 score (100 = nothing quantum-vulnerable found). Repeated hits of one algorithm are capped
    so a big codebase is not punished for size alone."""
    per_alg: dict[str, list[int]] = defaultdict(list)
    for f in result.findings:
        per_alg[f.algorithm].append(PENALTY[f.severity] * (0.5 if f.confidence == "low" else 1))
    penalty = sum(sum(sorted(v, reverse=True)[:MAX_HITS_PER_ALGORITHM]) for v in per_alg.values())
    score = max(0, round(100 - penalty))
    grade = "A" if score >= 90 else "B" if score >= 75 else "C" if score >= 60 else "D" if score >= 40 else "F"
    counts = {s: len(result.by_status(s)) for s in (VULNERABLE, DEPRECATED, WEAKENED, PQ_SAFE)}
    return {"score": score, "grade": grade, "counts": counts,
            "pq_ready_signals": sorted({f.algorithm for f in result.by_status(PQ_SAFE)})}


def migration_plan(result: ScanResult) -> list[dict]:
    """Group non-safe findings into an ordered to-do list (private keys first, then key exchange
    because of harvest-now-decrypt-later, then signatures, then legacy hashes and ciphers)."""
    groups: dict[str, list] = defaultdict(list)
    for f in result.findings:
        if f.status != PQ_SAFE:
            groups[f.algorithm].append(f)
    plan = []
    for alg, items in groups.items():
        info = items[0].info
        plan.append({"algorithm": alg, "family": info.family, "status": info.status,
                     "severity": max(items, key=lambda f: f.severity_rank).severity,
                     "occurrences": len(items), "files": sorted({f.file for f in items}),
                     "replacement": info.replacement, "why": info.note})
    plan.sort(key=lambda p: (p["severity"] != "critical", PRIORITY.get(p["algorithm"], PRIORITY.get(p["family"], 9)),
                             -["info", "low", "medium", "high", "critical"].index(p["severity"]), p["algorithm"]))
    for i, p in enumerate(plan, 1):
        p["step"] = i
    return plan
Post quantum cryptography migration map: RSA and ECDH to ML-KEM, ECDSA to ML-DSA, MD5 and SHA-1 to SHA-384, before and after scores
What to replace with what, and the before/after scores of the two example projects (0/100 versus 96/100).

Step 9: Export a CycloneDX CBOM and SARIF

A cryptographic bill of materials is the industry format for a post quantum cryptography inventory. The scanner writes a CycloneDX 1.6 CBOM with one cryptographic-asset component per algorithm and every place it occurs. It can also write SARIF, so findings appear as code-scanning alerts on GitHub.

def to_cyclonedx(result: ScanResult) -> str:
    """CycloneDX 1.6 CBOM: one cryptographic-asset component per algorithm with every occurrence."""
    comps = []
    for alg, items in sorted({f.algorithm: [x for x in result.findings if x.algorithm == f.algorithm]
                              for f in result.findings}.items()):
        info = items[0].info
        if alg in ("TLS1.0", "TLS1.1", "TLS1.2", "TLS1.3"):
            props = {"assetType": "protocol", "protocolProperties": {"type": "tls", "version": alg[3:]}}
        elif alg == "PRIVATE-KEY-FILE":
            props = {"assetType": "related-crypto-material", "relatedCryptoMaterialProperties": {"type": "private-key"}}
        else:
            props = {"assetType": "algorithm", "algorithmProperties": {
                "primitive": _PRIMITIVE.get(alg, "other"),
                "nistQuantumSecurityLevel": 0 if info.status in (VULNERABLE, DEPRECATED) else
                (1 if info.status == WEAKENED else 3)}}
        comps.append({"type": "cryptographic-asset", "bom-ref": f"crypto/{alg}", "name": alg,
                      "cryptoProperties": props,
                      "properties": [{"name": "pqc:status", "value": info.status},
                                     {"name": "pqc:replacement", "value": info.replacement}],
                      "evidence": {"occurrences": [{"location": f.file, "line": f.line} for f in items]}})
    return json.dumps({"bomFormat": "CycloneDX", "specVersion": "1.6", "version": 1,
                       "metadata": {"timestamp": result.started,
                                    "tools": {"components": [{"type": "application", "name": "pqc-readiness-scanner",
                                                              "version": result.version}]}},
                       "components": comps}, indent=2)

Step 10: Add the CLI and a CI gate

The command line uses argparse with three sub-commands. Two flags turn it into a quality gate: --fail-on high exits with code 2 if any high or critical finding exists, and --min-score 80 fails when the score is too low. Add it to a GitHub Actions workflow and new RSA or MD5 code cannot slip into the main branch unnoticed.

# .github/workflows/pqc.yml (in your own project)
- run: pip install git+https://github.com/GetProjectsIdea/Post-Quantum-Cryptography-Readiness-Scanner-Python.git
- run: pqc-scan scan . -f sarif -o pqc.sarif --fail-on critical
- uses: github/codeql-action/upload-sarif@v3
  if: always()
  with:
    sarif_file: pqc.sarif

Step 11: Optional TLS check for servers you own

pqc-scan tls makes one normal TLS connection and reports the protocol version, cipher, certificate key algorithm and signature hash. To keep it ethical, it refuses any host other than localhost unless you pass --i-own-this-host. Use it on your college project server or your own website, never on systems you do not administer.

pqc-scan tls localhost:8443 --insecure          # your local dev server
pqc-scan tls myproject.example.com --i-own-this-host

Run the Post Quantum Cryptography Scanner and Tests

Run the scanner on the two example projects to see the before and after pictures, then point it at your own code:

pqc-scan scan examples/legacy-campus-portal          # grade F
pqc-scan scan examples/pq-ready-service              # grade A
pqc-scan scan path/to/your/project -f markdown -o pqc-report.md
pqc-scan scan . -f cyclonedx -o cbom.json
pytest -v
Post quantum cryptography readiness report in the terminal: grade F, RSA 1024-bit critical finding and an ordered migration plan
The scanner run on the legacy demo portal: 30 quantum-vulnerable findings, a 0/100 score and a step-by-step migration plan.

The legacy example is a made-up campus portal with an RSA-1024 backup key, RS256 JWT login tokens, MD5 password hashing, 3DES, TLS 1.0 and classical SSH key exchange. It scores 0/100. The pq-ready-service example uses ML-KEM-768, ML-DSA-65, TLS 1.3 with X25519MLKEM768 and post-quantum SSH key exchange, and scores 96/100. That jump from F to A is what a finished post quantum cryptography migration looks like in numbers. It loses a few points only because a classical X25519 fallback group is still enabled, which is a realistic result.

The test suite has 126 tests covering every detector, the score, the plan, all four report formats, the CLI exit codes, and a TLS test that starts its own local server with a freshly generated certificate. Test keys are generated at runtime, so no private key is stored in the repository. GitHub Actions runs the suite on Python 3.10 to 3.13.

126 pytest tests passing for the post quantum cryptography scanner, including a local TLS server test
All 126 tests pass offline. The TLS test starts its own local server, so no outside host is contacted.

Sample Output

A shortened post quantum cryptography readiness report (Markdown) for the legacy example. The full JSON, Markdown, CBOM and SARIF versions are in the samples/ folder of the repository.

| Step | Algorithm | Status     | Severity | Uses | Replace with                         |
|------|-----------|------------|----------|------|--------------------------------------|
| 1    | RSA       | vulnerable | critical | 17   | ML-KEM-768 (FIPS 203) / ML-DSA-65    |
| 2    | DH        | vulnerable | high     | 2    | ML-KEM-768 or hybrid X25519MLKEM768  |
| 3    | ECDH      | vulnerable | high     | 4    | ML-KEM-768 or hybrid X25519MLKEM768  |
| 5    | ECDSA     | vulnerable | high     | 5    | ML-DSA-65 (FIPS 204)                 |
| 7    | TLS1.0    | deprecated | high     | 1    | TLS 1.3                              |
| 10   | MD5       | deprecated | high     | 2    | SHA-256 or SHA-384                   |

Learning Outcomes and Future Scope

This post quantum cryptography project gives you plenty to talk about in a viva or project report:

  • How Shor’s and Grover’s algorithms affect public-key and symmetric cryptography differently.
  • What ML-KEM, ML-DSA and SLH-DSA are, and where hybrid key exchange fits.
  • Static analysis with Python’s ast module and well-tested regular expressions.
  • Parsing X.509 certificates and handling secrets safely in tooling.
  • Software supply-chain formats (CycloneDX CBOM, SARIF) and CI quality gates.

Ideas to extend it into a bigger final-year or MTech project:

  • Add detectors for Kotlin Android keystores, Terraform cloud KMS keys or Kubernetes TLS secrets (metadata only).
  • Build a small Flask dashboard that compares scans over time and charts the readiness score.
  • Add an --fix-hints mode that prints example ML-KEM code for each finding using liboqs-python.
  • Measure precision and recall of the detectors on a labelled set of open-source repositories, a good research angle for an MTech thesis.
  • Map findings to CNSA 2.0 deadlines and generate a dated migration timeline.

FAQ

What is post quantum cryptography in simple words?

Post quantum cryptography means encryption and digital signature algorithms that remain secure even against a large quantum computer. NIST standardised the first ones in August 2024: ML-KEM (FIPS 203) for key exchange and ML-DSA (FIPS 204) and SLH-DSA (FIPS 205) for signatures. They run on normal computers; you do not need quantum hardware to use them.

Is RSA really broken by quantum computers?

Not yet. No quantum computer today can break RSA-2048. But Shor’s algorithm would break RSA and elliptic-curve cryptography on a large enough machine, and attackers can record encrypted traffic now and decrypt it later. That is why agencies such as the NSA, in its 2 December 2026 advisory, ask organisations to start the move now, beginning with an inventory.

Is this scanner safe and legal to use?

Yes, when you use it on your own projects. It only reads files in the folder you choose, never runs or changes them, and never prints private key contents. The optional TLS check refuses remote hosts unless you confirm with –i-own-this-host that you own or administer the server.

Does a high score mean my project is quantum-safe?

No. The score reflects what the scanner can see in your files. Cryptography inside libraries, the operating system, hardware security modules or cloud services also matters. Treat the report as a strong starting inventory and a migration to-do list, not a certificate.

Did the November 2026 lattice research break ML-KEM?

No. The quantum algorithms Anthropic published on 30 November 2026 are described as galactic: too costly to run against the ML-KEM and ML-DSA parameter sets in use. Cloudflare, Nature and outside cryptographers all said post quantum cryptography is still safe and the migration should continue.

Can I submit this as my final-year project?

Yes. The code is MIT licensed. Add one feature from the future scope list, explain the four statuses and the migration plan in your report, and run the 126 tests and both example scans during your demo. The source is on GitHub.

Download the Source Code

The complete project (scanner, five detectors, knowledge base, report writers, TLS check, two example projects, sample reports, 126 tests and CI) is on GitHub: GetProjectsIdea/Post-Quantum-Cryptography-Readiness-Scanner-Python. It is released under the MIT License, so you can use this post quantum cryptography scanner for coursework, college projects and your own code reviews.

References

Conclusion

You have built a complete, defensive post quantum cryptography readiness scanner in Python. It finds RSA, elliptic-curve, Diffie-Hellman and legacy algorithms across code, configs, dependencies and certificates, explains each finding in plain language, and turns the result into a score, a CBOM and a migration plan to ML-KEM and ML-DSA. Clone the repository, scan the two examples, then scan your own projects and start ticking off the plan. Happy coding!

Team Get Projects

Contributor & Author
View All Projects →

Contributor at GetProjects.org, sharing open-source codebases, tutorials, and practical software architectures.

0 Discussion Comments

Markdown Supported

Join the Discussion & Code Review

Share architectural feedback, benchmark results, or troubleshooting notes.