CloudCipher delivers enterprise-grade zero-knowledge cloud file storage. Files are encrypted client-independently of cloud provider security using AES-256-GCM, protected via RSA-OAEP 3072-bit key wrapping, authenticated with RSA-PSS digital signatures, and tracked in a SHA-256 Merkle-style hash chain for verifiable tamper-evidence.
Key Features • Architecture • Cryptographic Design • Getting Started • API Reference
- 🔐 Zero-Knowledge Architecture: The server never stores user passwords or raw RSA private keys in plaintext. The private key is encrypted at rest using a key derived on the client via PBKDF2-HMAC-SHA256 (310,000 iterations).
- ⚡ Hybrid Encryption Pipeline:
- Every file receives a freshly generated, cryptographically random 256-bit AES key.
- A unique 96-bit initialization vector (nonce) is generated per encryption operation.
- Symmetrically encrypted file payload is stored alongside a 128-bit GCM authentication tag to block any silent tampering.
- The AES key is wrapped (encrypted) with the user's 3072-bit RSA public key via RSA-OAEP.
- 🔏 Non-Repudiation with Digital Signatures: Uploaded files have their SHA-256 hash digitally signed using the owner's RSA private key (RSA-PSS), proving authenticity upon retrieval.
- 🔄 Secure Key Re-Wrapping for Sharing: File sharing unwraps the file AES key in volatile memory and re-encrypts it directly with the recipient's RSA public key, enabling sharing without re-uploading large file payloads or exposing private keys.
- 🔗 Tamper-Evident Merkle Hash Chain: Every upload, download, share, and delete event is cryptographically linked:
log_hash = SHA-256(prev_log_hash || row_data) A verification endpoint walks the chain from genesis and instantly identifies any altered or deleted audit row. - 🚨 Rule-Based Anomaly Detection: Real-time rate monitoring flags excessive download velocity (>5 files in 60s) to detect and log rapid data exfiltration attempts.
- 🛡️ Defense-in-Depth: Supabase Row-Level Security (RLS) policies enforce database table isolation independently of application-level authorization.
| Component | Primitive / Standard | Purpose |
|---|---|---|
| Symmetric Cipher | AES-256-GCM |
Authenticated file payload encryption with integrity tagging |
| Asymmetric Cipher | RSA-OAEP (3072-bit) |
Symmetric AES key wrapping & zero-knowledge transfer |
| Key Derivation | PBKDF2-HMAC-SHA256 |
310,000 rounds + 16-byte random salt for password hardening |
| Digital Signature | RSA-PSS (SHA-256) |
Non-repudiation and cryptographic author verification |
| File Digest | SHA-256 |
Verification of integrity between client and server |
| Audit Log Chain | SHA-256 Chained Hash |
Merkle-style tamper-evident ledger validation |
CloudCipher/
├── backend/
│ ├── routes/
│ │ ├── audit.py # Hash-chain auditing & anomaly detection
│ │ ├── files.py # Encrypted upload, download, and delete
│ │ └── shares.py # RSA key re-wrapping & received shares
│ ├── auth.py # Zero-knowledge JWT & key-unwrapping middleware
│ ├── config.py # Supabase admin client & configuration
│ ├── crypto_utils.py # Core cryptography engine (pyca/cryptography)
│ ├── main.py # FastAPI application entrypoint
│ ├── schema.sql # Postgres DDL & Row-Level Security policies
│ └── test_cloudcipher.py # Automated cryptographic invariant tests
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ │ ├── Auth.tsx # High-tech login & zero-knowledge signup
│ │ │ ├── Dashboard.tsx # File repository, upload zone, & metrics
│ │ │ └── Modals.tsx # Key re-wrapping share & audit chain timeline
│ │ ├── api.ts # Authenticated fetch wrapper
│ │ ├── crypto.ts # Browser Web Crypto API (PBKDF2 & SHA-256)
│ │ └── App.tsx # Session management & routing
│ ├── vite.config.ts # Vite configuration
│ └── tailwind.config.js # TailwindCSS configuration
├── .env.example # Environment variables template
├── .gitignore # Protects secrets & dependencies
└── README.md # Project documentation