Quantum is a forensic security tool for scanning compiled binaries and identifying cryptographic implementations that are vulnerable in a post-quantum threat model. It focuses on ELF, PE, and Mach-O binaries, extracts executable instructions, analyzes assembly patterns with machine learning, and recommends post-quantum cryptography remediations when RSA or ECC usage is detected.
The goal of Quantum is to help security teams, reverse engineers, and platform owners answer a practical question:
Which shipped binaries are still using cryptography that should be replaced before large-scale quantum attacks become viable?
Quantum performs that analysis in a pipeline:
- Parse compiled binaries and locate executable sections.
- Disassemble machine code into opcode sequences.
- Chunk opcode streams into model-friendly windows.
- Classify each chunk for cryptographic risk patterns.
- Aggregate findings into a JSON scorecard and dashboard view.
The current scaffold includes:
- A binary extraction engine for ELF, PE, and Mach-O parsing.
- A CodeBERT-backed inference module with a heuristic fallback path.
- A scanner that computes PQC compliance and remediation guidance.
- A FastAPI backend with file upload scanning.
- A lightweight web dashboard for interacting with the scanner.
- A test data generator for building benign and crypto-linked sample binaries.
Quantum is built with the following stack:
- Python 3.12: Primary application runtime.
- LIEF: Binary parsing for ELF, PE, and Mach-O inspection.
- Capstone: Disassembly of executable sections into assembly opcode streams.
- PyTorch: Model execution runtime.
- Hugging Face Transformers: Loading and tokenizing
microsoft/codebert-base. - FastAPI: API server and dashboard delivery.
- Uvicorn: ASGI server for local development and deployment.
- Pydantic: Request and response validation support through FastAPI.
BinaryProcessor loads a binary with LIEF, identifies executable sections such as .text, disassembles raw bytes with Capstone, and emits sliding windows of opcode text for downstream ML processing.
Loads microsoft/codebert-base through Hugging Face and exposes predict_crypto_risk(opcode_chunk). The current scaffold assumes a future fine-tuned classification head for:
RSAECCPQC-Safe
If a fine-tuned head or model weights are unavailable, the module falls back to a heuristic classifier so the rest of the system can still run end to end.
Coordinates extraction and inference, then aggregates results into a Quantum Risk Scorecard. If RSA or ECC appears in more than 1% of analyzed chunks, the scanner sets quantum_ready to False.
Provides:
POST /scanfor binary upload scanning/for the browser dashboard- CLI usage through
python main.py --file ./path/to/binary
Contains the dashboard frontend:
index.htmlstyles.cssapp.js
The dashboard gives a simple security-operations-style interface for file upload, scan status, compliance display, and vulnerability review.
Generates two small C programs and attempts to compile them:
- An OpenSSL RSA sample to simulate crypto-heavy behavior
- A hello-world control binary for a benign baseline
Quantum currently maps the following algorithm detections to remediation guidance:
RSA-> High Risk -> Replace with ML-KEM / KyberECC-> High Risk -> Replace with ML-DSA / DilithiumPQC-Safe-> Low Risk -> Post-quantum-ready implementation detected
{
"filename": "app.exe",
"pqc_compliance": "FAILED",
"vulnerabilities": [
{
"type": "RSA",
"confidence": 0.98,
"location": "0x401000",
"section": ".text",
"remediation": "High Risk (Replace with ML-KEM/Kyber)"
}
],
"remediation": "Update to NIST FIPS 203 (ML-KEM/Kyber)"
}./setup.sh
source .venv/bin/activatepython main.py --serveOpen:
http://localhost:8000for the dashboardhttp://localhost:8000/docsfor the API docs
python main.py --file ./test_binarypython generate_test.pyIf OpenSSL development libraries are available, this script will also produce an RSA-linked sample binary.
This repository is an initial working scaffold for the product. The binary extraction and API flow are implemented, while the ML classification layer is still set up as a baseline wrapper around CodeBERT and is ready for a real fine-tuned classification head.
- Train and attach a real classification head for binary-level crypto detection.
- Add persistent scan history and artifact management.
- Expand detections beyond RSA and ECC into classical signature and key exchange families.
- Support richer symbol-aware and control-flow-aware feature extraction.
- Add authentication and team workflows for production deployment.