Metadata-Version: 2.4
Name: quantumshield-proxy
Version: 1.0.0
Summary: Zero-code-change Post-Quantum Cryptography (ML-KEM-768 / Kyber) Reverse Proxy
Author-email: Hemanth <dev@quantumshield.io>
Project-URL: Homepage, https://github.com/hemanth/Ccp_QuantumShield
Project-URL: Bug Tracker, https://github.com/hemanth/Ccp_QuantumShield/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Topic :: Security :: Cryptography
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: flask>=3.0.0
Requires-Dist: flask-cors>=4.0.0
Requires-Dist: liboqs-python>=0.10.0
Requires-Dist: cryptography>=42.0.0
Requires-Dist: requests>=2.31.0

# QuantumShield — Backend

Python Flask backend for the QuantumShield post-quantum cryptography demo.

## Structure

```
backend/
├── app.py                    # Flask entry point — all routes
├── classical_encryptor.py    # RSA-2048 encrypt/decrypt + timing
├── pqc_encryptor.py          # CRYSTALS-Kyber-768 via liboqs + timing
├── quantum_simulator.py      # Shor's Algorithm simulation
├── benchmark_engine.py       # 1000 transaction benchmarking
├── vulnerability_scanner.py  # Algorithm risk classification
├── migration_wizard.py       # 5-step migration plan + PDF export
├── transaction_factory.py    # Synthetic dataset loader
├── data/
│   └── mock_transactions.json  # 1000 synthetic UPI transactions
├── requirements.txt
├── .env.example
└── .gitignore
```

## Setup

```bash
pip install -r requirements.txt
```

## Run

```bash
python app.py
# Flask running on http://localhost:5000
```

## API Endpoints

| Method | Endpoint              | Description                        |
|--------|-----------------------|------------------------------------|
| GET    | /api/health           | Health check                       |
| POST   | /api/encrypt/rsa      | Encrypt with RSA-2048              |
| POST   | /api/encrypt/kyber    | Encapsulate with Kyber-768         |
| POST   | /api/gateway/pay      | Full payment gateway simulation    |
| GET    | /api/attack/rsa       | Shor's attack on RSA               |
| GET    | /api/attack/kyber     | Shor's attack on Kyber             |
| GET    | /api/benchmark?n=100  | Run N transaction benchmark        |
| POST   | /api/scan             | Vulnerability scan an algorithm    |
| POST   | /api/migrate          | Generate 5-step migration plan     |
| POST   | /api/report           | Download PDF migration report      |

## Test individually

```bash
python transaction_factory.py   # M1
python classical_encryptor.py   # M3
python pqc_encryptor.py         # M4
python quantum_simulator.py     # M5
python vulnerability_scanner.py # M8a
python migration_wizard.py      # M8b
python benchmark_engine.py      # M9
```
