Encryption Flow
This document details the cryptographic operations that secure your content in SHIELD.Overview
SHIELD uses a symmetric encryption model where the same key encrypts and decrypts content. The key itself is never transmitted to any server—it’s embedded in the URL fragment and stays in the browser.Encryption Algorithm
AES-GCM-256
We use AES-GCM (Galois/Counter Mode) with a 256-bit key:- Confidentiality: AES encryption provides strong data protection
- Authentication: GCM mode includes built-in authentication (no separate MAC needed)
- Performance: Hardware-accelerated in modern browsers
- Standard: NIST-approved, widely audited
Key Generation
Random Key Generation
IV Generation
Encryption Process
Step-by-Step
Output Format
The encrypted payload sent to IPFS:| Bytes | Content | Size |
|---|---|---|
| 0-11 | IV | 12 bytes |
| 12-(n-16) | Ciphertext | variable |
| (n-15)-n | Auth Tag | 16 bytes |
Decryption Process
URL Fragment Encoding
The secret key is encoded for the URL fragment:Why URL Fragment?
Never Sent to Server
Browsers don’t include the fragment in HTTP requests. The key stays client-side.
No Server Access
Even SHIELD’s servers cannot see or log the decryption key.
Base64url Encoding
Security Properties
Confidentiality
- 256-bit keys: Brute-force infeasible (2^256 possibilities)
- Unique IVs: Same content encrypts differently each time
- Authenticated encryption: Tampering is detected
Authentication
- GCM tag: 128-bit authentication tag prevents tampering
- Contract verification: Policy must be valid before decryption
Forward Secrecy
- Per-content keys: Each link has a unique key
- No key storage: Keys only exist in shared links
- Irrecoverable: Lost links cannot be regenerated
Threat Model
| Threat | Mitigation |
|---|---|
| Server compromise | Server never sees keys or plaintext |
| Man-in-the-middle | HTTPS + contract verification |
| Link interception | Recipients authenticate with wallet |
| Brute force | 256-bit keys, rate limiting |
| Replay attacks | On-chain attempt tracking |
| Tampered content | GCM authentication tag |

