A zero-trust encrypted document vault with AES-256-GCM encryption, role-based access, and comprehensive audit logging.
- Zero-Knowledge Encryption: Files are encrypted with AES-256-GCM before storage.
- Mandatory Password Protection: User-defined passwords for extra security layer.
- Secure Uploads: Chunked processing, MIME-type validation, and malware-resistant storage.
- Role-Based Access: Strict ownership controls (users can only access their own files).
- Audit Logging: Immutable logs for every access, upload, download, and modification.
- Device Trust: Track and manage trusted devices.
- Backend: Python, FastAPI, SQLAlchemy
- Database: SQLite (Local), PostgreSQL (Production compatible)
- Security: Argon2 (Hashing), Cryptography (AES-GCM), PyJWT
- Frontend: HTML5, CSS3, JavaScript (Vanilla)
-
Clone the repository:
git clone https://github.com/your-username/secure-vault.git cd secure-vault -
Create Virtual Environment:
python -m venv venv # Windows: .\venv\Scripts\activate # Mac/Linux: source venv/bin/activate
-
Install Dependencies:
pip install -r requirements.txt
-
Configure Environment: Copy
.env.exampleto.env:cp .env.example .env
Modify
.envvalues as needed (e.g., SECRET_KEY). -
Run the Server:
python -m uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
-
Access the App: Open http://localhost:8000
Important: This application uses SQLite (a file-based database) and Local File Storage (uploaded_files/) by default.
Serverless platforms like Vercel have read-only filesystems. To deploy on Vercel, you MUST configure external services:
- Database: Use an external PostgreSQL provider (e.g., Neon, Supabase, Render).
- Update
DATABASE_URLin.env.
- Update
- File Storage: Use an S3-compatible object storage (e.g., AWS S3, Cloudflare R2).
- Code modifications required to replace local file operations with S3 API.
Recommended for Demo: Deploy on Render or Railway (using persistent disk) if you wish to keep the SQLite architecture.
- Encryption:
AES-256-GCMwith unique IV/Salt per file. - Key Derivation:
Argon2idfor password hashing and key generation. - Transport: Enforce HTTPS in production.
- No Plaintext: Server never stores user passwords or unencrypted file content.
Built for the Secure Digital Document Vault Project.