You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit provides a comprehensive explanation of the system's
triple-layer encryption model across documentation and UI.
Changes include:
- Detailed breakdown of client-side (AES-GCM-256), server-side key,
and database encryption layers in README, security page,
and dedicated documentation files.
- Clarification of security properties and attacker capabilities.
- Addition of 'Encryption & Security' section in ARCHITECTURE.md.
- Creation of a new dedicated ENCRYPTION.md document.
Copy file name to clipboardExpand all lines: README.md
+32-6Lines changed: 32 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,9 +35,33 @@
35
35
<h3>Zero-Trust • Edge-Native • Unbreakable</h3>
36
36
</div>
37
37
38
-
### 🔒 Layer 1: The Vault (D1 Database Storage)
39
-
> **Encrypted Storage**
40
-
Files are stored encrypted in Cloudflare D1 database. The encrypted blobs are stored alongside metadata, with cryptographic enforcement preventing early access.
38
+
### 🔒 Layer 1: The Vault (Encrypted D1 Database Storage)
39
+
> **Triple-Layer Encryption**
40
+
41
+
**All seals are encrypted in the database with multiple security layers:**
42
+
43
+
1.**Client-Side Encryption (AES-GCM-256)**
44
+
- Your content is encrypted in your browser BEFORE sending to server
45
+
- Uses split-key architecture: Key A (client) + Key B (server)
46
+
- Encrypted blob stored as base64 in D1 database
47
+
48
+
2.**Server-Side Key Encryption**
49
+
- Key B is encrypted with `MASTER_ENCRYPTION_KEY` before database storage
50
+
- Master key stored as environment secret (never in database)
51
+
- Uses HKDF key derivation for additional security
52
+
53
+
3.**Database Contents (All Encrypted)**
54
+
- ✅ Encrypted blob (AES-GCM-256 ciphertext)
55
+
- ✅ Encrypted Key B (AES-GCM-256 with master key)
56
+
- ✅ IV (public, needed for decryption)
57
+
- ✅ Metadata (unlock time, timestamps)
58
+
- ❌ NO plaintext content ever stored
59
+
60
+
**What an attacker with database access CANNOT do:**
61
+
- Decrypt without Key A (in URL hash, never sent to server)
62
+
- Decrypt without master encryption key (environment secret)
63
+
- Modify unlock time (cryptographically signed)
64
+
- Access content before unlock time (server enforces time-lock)
41
65
42
66
### 🤝 Layer 2: The Handshake (Split-Key Crypto)
43
67
> **Trust-Minimized**
@@ -162,10 +186,12 @@ sequenceDiagram
162
186
**❌ NO.** The unlock time is stored in the database when you create the seal. API requests can't modify it.
163
187
164
188
### "What if I steal Key B from the database?"
165
-
**⚠️ PARTIAL.** Key B is encrypted with a master key. Even if you steal it, you still need:
166
-
1. The master encryption key (environment secret)
189
+
**❌ NO.** Key B is encrypted with a master key before storage. Even if you steal the encrypted Key B from the database, you still need:
190
+
1. The master encryption key (environment secret, not in database)
167
191
2. Key A (stored in the URL hash, never sent to server)
168
-
3. Both keys to decrypt
192
+
3. Both decrypted keys to decrypt the content
193
+
194
+
**Database breach impact:** Attacker gets encrypted blobs and encrypted keys, but cannot decrypt without master key and Key A.
169
195
170
196
### "Can I brute-force the encryption?"
171
197
**❌ NO.** AES-GCM-256 with cryptographically random keys. Would take billions of years with current technology.
<p>All seals are stored encrypted in Cloudflare's edge database with triple-layer encryption: client-side AES-GCM-256, server-side key encryption, and database encryption at rest. NO plaintext content is ever stored.</p>
<p>All seals encrypted with AES-GCM-256 client-side, Key B encrypted with master key server-side, and database encryption at rest. Zero plaintext storage.</p>
0 commit comments