Cryptographic Specification

Zero-Knowledge Security Architecture

VanishShare is built on a fundamental principle: our servers should never possess the mathematical capability to decrypt your data. Here is how we enforce zero-knowledge isolation.

The Three Cryptographic Pillars

🧮

1. Web Crypto AES-256-GCM

Encryption is executed in the browser sandbox using the W3C Web Crypto API. Each secret receives a cryptographically secure 256-bit symmetric key, and every encryption uses a fresh random 96-bit initialization vector (IV). GCM's authentication tag makes any modified ciphertext fail to decrypt.

🔗

2. URL Hash Key Isolation

Per RFC 3986 Section 3.5, the URI fragment identifier (the portion following #) is handled exclusively client-side. Web browsers strictly refuse to send hash fragments in HTTP requests. Thus, the decryption key never touches our web servers or proxy access logs.

🛡️

3. PBKDF2 & Key Wrapping

When an optional passphrase is set, the 256-bit master key is wrapped with a key derived by PBKDF2 with HMAC-SHA-256 and 600,000 iterations (aligned with OWASP recommendations) from the passphrase and a random 128-bit salt per secret. An additional AES-GCM verifier makes a wrong passphrase fail in the browser, before the email verification starts.

📦

4. Fixed-Bucket Payload Padding

To prevent passive eavesdroppers from inferring payload contents via ciphertext size fingerprinting (e.g., distinguishing an SSH key from a certificate), messages and files encrypted in the browser are padded to fixed bucket sizes (4KB, 16KB, 64KB, 128KB, 200KB) before encryption.

End-to-End Cryptographic Flow

Step-by-step lifecycle from encryption to permanent destruction:

1

Key Generation & Payload Padding

window.crypto.subtle.generateKey yields an exportable AES-GCM 256-bit symmetric master key (K_master). Payloads are padded into standard fixed bucket sizes to prevent length leakage.

2

Client-Side Encryption

Padded payload bytes are encrypted with K_master and a random 12-byte initialization vector (IV). If a passphrase is set, K_master is wrapped via PBKDF2 (600,000 iterations).

3

Server Storage (Ciphertext Only)

The browser sends the encrypted ciphertext, the recipient email addresses and the expiration settings (TTL, max download limits). The server stores the ciphertext and settings and keeps the addresses only as salted HMAC digests keyed with a server secret; it needs the raw addresses briefly to check them and to email codes. The key (or, with a passphrase, the passphrase-wrapped key) goes into the link after # and never reaches the server.

4

MFA & Local Decryption

Recipient opens the link and enters one of the recipient email addresses; the server emails a 6-digit one-time code, valid for 5 minutes with 3 attempts. Only after a correct code does the server release the ciphertext. The browser takes K_master from the hash fragment, decrypts locally, and zeroes the decrypted buffers after use.

5

Irreversible Destruction

When the last allowed download is released, the database record is hard-deleted in the same transaction and the encrypted file right after. An expired secret can no longer be retrieved and is deleted when its link is next opened; for unopened secrets the deployment can enable background cleanup (a Firestore TTL policy, typically within a day of expiry, and a 31-day storage lifecycle rule). Deleted data can remain recoverable, as ciphertext only, during the cloud provider's recovery windows (Cloud Storage soft delete, Firestore point-in-time recovery if enabled).

Threat Model & Mitigations

Threat VectorPotential ImpactVanishShare Mitigation
Compromised Database / StorageAttacker acquires all stored rowsAttacker obtains AES-256 ciphertexts, keyed HMACs of recipient addresses and metadata. Decrypting without the link's key is computationally infeasible, and the address digests cannot be checked without the server's HMAC secret.
Network Eavesdropping / ISP InspectionAttacker monitors HTTP / TLS trafficHTTPS in transit (TLS is terminated by Google's front end, which sets the TLS version) with an HSTS header, and hash fragment keys are never included in HTTP requests (RFC 3986). Request metadata such as IP addresses and timing stays visible.
Server Rogue Admin / Insider ThreatAdmin inspects memory & logsPlaintext and decryption keys are never transmitted to or processed by the server. Recipient addresses pass through it in transit. Someone who can change the deployed code could serve JavaScript that captures keys, a limit shared by every browser-based zero-knowledge service.
Brute-Force Passphrase AttackAnyone holding the share link guesses the passphrase offline (no server or OTP involved)PBKDF2 with 600,000 iterations (OWASP standard) slows each guess, and passphrases must be at least 12 characters. Weak passphrases remain guessable: use several random words or a generated passphrase.
Ciphertext Size FingerprintingPassive observer guesses file type by lengthFixed-bucket padding (4KB, 16KB, 64KB, 128KB, 200KB) masks exact payload lengths; only the bucket is visible.
Link Crawler / Bot Pre-Fetch DoSChat bots burn 1-time view slotsOpening a link only returns metadata and never counts a download; the ciphertext is released and the download counted only after a POST with a valid emailed code.

Experience Zero-Knowledge Sharing

Create an encrypted, self-destructing secret in seconds.

Generate Encrypted Secret