Skip to main content

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

The key is generated using the browser’s cryptographically secure random number generator (CSPRNG).

IV Generation

Each encryption uses a unique IV, never reused with the same key.

Encryption Process

Step-by-Step

Output Format

The encrypted payload sent to IPFS:

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