This demo implements privacy-by-design controls to demonstrate end-to-end encryption with minimal data collection.
| Principle | Implementation |
|---|---|
| Zero-knowledge architecture | Plaintext never leaves the client device. The server only receives encrypted ciphertext. |
| Data minimization | Only encrypted payloads traverse the network. No plaintext or metadata about message content is stored. |
| Access control | API key authentication (X-API-Key header) prevents unauthorized access to decryption endpoints. |
| Integrity protection | Rate limiting (20 req/15min on /decrypt) prevents abuse and resource exhaustion. |
| Confidentiality by default | TLS recommended in production; libsodium sealed-box encryption ensures confidentiality in transit. |
client/)| Control | Technology | Purpose |
|---|---|---|
| Client-side encryption | libsodium-wrappers |
Sealed-box (crypto_box_seal) ensures only the server can decrypt |
| Public key injection | .env variables |
Prevents client-side tampering with recipient identity |
| No plaintext storage | React state only | Messages never written to localStorage, sessionStorage, or IndexedDB |
server/)| Control | Technology | Purpose |
|---|---|---|
| API key authentication | Custom middleware + constant-time comparison | Prevents unauthorized decryption requests |
| Rate limiting | express-rate-limit |
Limits to 100 req/15min global, 20 req/15min on /decrypt |
| CORS restrictions | Origin whitelist (ALLOWED_ORIGINS) |
Restricts which domains can access the API |
| Security headers | helmet |
Enforces HSTS, X-Frame-Options, X-Content-Type-Options, etc. |
| No ciphertext persistence | In-memory only | Decrypted plaintext discarded after response |
βββββββββββββββ ββββββββββββββββ βββββββββββββββ β Browser ββββββΆβ Server βββββββ User β β β β β β β β β’ Input β β β’ Auth β β β’ Enters β β β’ Encrypt β β β’ Decrypt β β Message β β β’ Send β β β’ Response β β β’ Receives β β βββββββ ββββββΆβ Result β βββββββββββββββ ββββββββββββββββ βββββββββββββββ β β β Plaintext Encrypted Decrypted remains in ciphertext plaintext browser only only in transit displayed to user
| Data Type | Collected? | Notes |
|---|---|---|
| Plaintext messages | β No | Never transmitted or stored |
| User identity | β No | No accounts, emails, or PII |
| Ciphertext logs | β No | Server does not persist request bodies |
| IP addresses | β No | Not logged (only transient console warning on auth failures) |
| Session cookies | β No | Stateless API, no sessions |
This is a demonstration project and has the following limitations. Planned mitigations are tracked in ROADMAP.md.
| Limitation | Mitigation for Production | Roadmap Item |
|---|---|---|
API key stored in .env |
Use secure secrets management (AWS Secrets Manager, HashiCorp Vault) | Secure secrets management |
| No key rotation | Implement periodic key regeneration + versioning | Key rotation with versioning |
| No audit trail | Add signed, immutable logging (e.g., to append-only storage) | Audit logging (ciphertext hashes + timestamps) |
| No client-side authentication | Add user auth (OAuth, JWT) before allowing encryption access | Client-side user authentication |
| No HTTPS enforcement | Deploy behind reverse proxy (nginx, Cloudflare) with TLS | HTTPS / TLS enforcement |
π‘ Tip: If deploying beyond demo purposes, review all items in Production Hardening before go-live.
| Regulation | Relevance | Status |
|---|---|---|
| GDPR Art. 25 (Privacy-by-design) | Applies if processing EU residentsβ data | β Implemented for demo |
| CCPA/CPRA | Applies if selling/handling California consumer data | β No PII collected |
| SOC 2 | Required for enterprise SaaS providers | β οΈ Not applicable (demo only) - see SOC 2 groundwork for future plans |
2026-10-12 β Added cross-references to ROADMAP.md for limitations and compliance notes.
For questions about this privacy design or suggestions for improvement, please open an issue in the repository.
Contact: GitHub Issues