Skip to content

fazliberkordek/quantum-suit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quantum Suit

A post-quantum cryptography (PQC) testing framework that simulates quantum algorithms and evaluates cryptographic threat posture. Use it to assess which cryptosystems in your stack are vulnerable to quantum attacks — and what to migrate to before Cryptographically-Relevant Quantum Computers (CRQCs) arrive.


What It Does

  • Simulates quantum algorithms — Shor's, Grover's, Simon's, Bernstein-Vazirani, QFT
  • Analyzes 21 cryptosystems — RSA, ECC, AES, SHA, Kyber, Dilithium, Falcon, SPHINCS+
  • Models lattice attacks — BKZ cost estimation for LWE/RLWE parameters
  • Evaluates PQXDH protocols — hybrid post-quantum handshake analysis
  • Probes live systems — Matrix homeserver connectivity and key size validation
  • Interactive dashboard — run all tests from the browser with real-time results

Stack

Layer Technology
Backend Python 3.11+, FastAPI, Uvicorn
Simulation NumPy, SciPy, SymPy
Validation Pydantic v2
Frontend Vanilla JS, Tailwind CSS (CDN)
Testing pytest, pytest-asyncio

Prerequisites

  • Python 3.11 or higher
  • pip

Setup

1. Clone the repository

git clone <repo-url>
cd quantum-suit

2. Create a virtual environment

python -m venv .venv
source .venv/bin/activate        # macOS / Linux
.venv\Scripts\activate           # Windows

3. Install dependencies

pip install -r requirements.txt

Running the Server

uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
URL Description
http://localhost:8000/dashboard Interactive test dashboard
http://localhost:8000/docs Swagger UI (auto-generated)
http://localhost:8000/redoc ReDoc API reference
http://localhost:8000/health Health check

Running Tests

pytest tests/ -v

Project Structure

quantum-suit/
├── app/
│   ├── main.py                   # FastAPI app — all 18 endpoints
│   ├── models/
│   │   └── schemas.py            # Pydantic request/response models
│   ├── algorithms/               # Quantum algorithm simulations
│   │   ├── shors.py              # Integer factorization (Shor's)
│   │   ├── grovers.py            # Unstructured search (Grover's)
│   │   ├── simons.py             # Hidden XOR period finding
│   │   ├── bernstein_vazirani.py # Hidden bitstring recovery
│   │   └── qft.py                # Quantum Fourier Transform
│   ├── analysis/                 # Threat analysis modules
│   │   ├── pqc_analyzer.py       # NIST PQC threat assessment
│   │   ├── lattice.py            # LWE/RLWE attack cost estimation
│   │   └── pqxdh.py              # Hybrid handshake analysis
│   └── probe/                    # Live system probing
│       ├── matrix_probe.py       # Matrix homeserver audit
│       └── handshake_probe.py    # PQXDH key size validation
├── frontend/
│   └── index.html                # Dashboard UI
├── tests/
│   └── test_algorithms.py        # Integration tests
└── requirements.txt

API Reference

Health

Method Endpoint Description
GET / Status + algorithm catalog
GET /health Health check
GET /dashboard Serves the frontend

Quantum Algorithms

Method Endpoint Description
POST /algorithms/shors Factor an integer (Shor's algorithm)
POST /algorithms/grovers Quantum search speedup estimation
POST /algorithms/simons Hidden XOR period finding
POST /algorithms/bernstein-vazirani Hidden bitstring recovery
POST /algorithms/qft Quantum Fourier Transform on a state vector

Threat Analysis

Method Endpoint Description
POST /analysis/pqc Evaluate cryptosystems against quantum threats
POST /analysis/lattice BKZ attack cost for LWE/RLWE parameters
POST /analysis/pqxdh Hybrid protocol threat assessment

Live Probing

Method Endpoint Description
POST /probe/matrix Matrix homeserver connectivity audit
POST /probe/pqxdh-handshake Validate PQXDH handshake key sizes

Example Requests

Factor a semiprime with Shor's algorithm:

curl -X POST http://localhost:8000/algorithms/shors \
  -H "Content-Type: application/json" \
  -d '{"n": 15}'

Assess RSA-2048 and AES-256 threat levels:

curl -X POST http://localhost:8000/analysis/pqc \
  -H "Content-Type: application/json" \
  -d '{"cryptosystems": ["RSA-2048", "AES-256"]}'

Estimate Grover's speedup for a 128-bit keyspace:

curl -X POST http://localhost:8000/algorithms/grovers \
  -H "Content-Type: application/json" \
  -d '{"n_qubits": 128}'

Supported Cryptosystems

Category Systems
Classical asymmetric RSA-1024, RSA-2048, RSA-4096, ECC-P256, ECC-P384, ECC-P521
Classical symmetric AES-128, AES-192, AES-256
Hash functions SHA-256, SHA-512
NIST PQC (KEM) KYBER-512, KYBER-768, KYBER-1024
NIST PQC (signatures) DILITHIUM-2, DILITHIUM-3, DILITHIUM-5, FALCON-512, FALCON-1024
Hash-based signatures SPHINCS+-128, SPHINCS+-256

Threat Levels

Level Meaning
critical Broken by near-term quantum computers
high Significantly weakened by quantum attacks
medium Reduced but not broken security margin
low Minimal quantum impact
none Quantum-resistant

Notes

  • No database — all computation is stateless and in-memory
  • CORS is open (all origins) — suitable for local development
  • The frontend requires no build step; it loads Tailwind from CDN
  • To probe a live Matrix homeserver, point /probe/matrix at your server's URL

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors