Post-Quantum Secure Multi-Cloud Distributed Storage — FastAPI Backend
- FastAPI — async Python API framework
- Reed-Solomon (4+2) — pure-Python GF(2^8) erasure coding
- AES-256-GCM — symmetric encryption (client-side, frontend)
- ML-KEM-768 — post-quantum KEM (simulated; swap in
liboqsfor production) - PostgreSQL — relational store with JSONB shard maps
qvault-backend/
├── main.py # FastAPI app + endpoints
├── shard_manager.py # RS(4+2) encoder + multi-cloud dispatch (CORE MODULE)
├── models.py # Pydantic request/response schemas
├── schema.sql # Complete PostgreSQL schema + seed data
└── requirements.txt
pip install -r requirements.txt
uvicorn main:app --reload --port 8000API docs: http://localhost:8000/docs
POST /upload-shard
Content-Type: multipart/form-data
Headers:
X-AES-IV : 24-char hex (96-bit GCM IV) [required]
X-Vault-Shield-ID : UUID of PQ shield [optional]
X-KEM-Capsule : Base64 ML-KEM-768 capsule bytes [optional]
X-Owner-ID : UUID of authenticated user [optional]
Body:
file: <AES-256-GCM encrypted binary ciphertext>
Ciphertext (bytes)
│
▼
RS Encoder (GF(2^8))
│
├── shard_0 (DATA) ─┐
├── shard_1 (DATA) ─┤── AWS us-east-1
├── shard_2 (DATA) ─┤
├── shard_3 (DATA) ─┤── GCP europe-west1
├── shard_4 (PARITY) ─┤
└── shard_5 (PARITY) ─┘── Azure central-us
Reconstruction: any 4 of 6 shards → RS decode → original ciphertext
Fault tolerance: 1 entire cloud provider can fail with full recovery
| Table | Purpose |
|---|---|
users |
Auth identities + PQ public key fingerprints |
postquantum_shields |
ML-KEM-768 shield registry |
vault_files |
File metadata + AES IV + shield reference |
shard_maps |
Junction: file → RS distribution (JSONB) |
shards |
Individual shard URIs, status, KEM capsule hash |
forensics_audit_log |
Immutable tamper-evident chain-of-custody log |