How the encryption works
For anyone who wants to check; you don't need it to use Locker. The code is client/js/encryption.js; the extension carries an identical copy, kept identical by a test. AES-256-GCM, HKDF and SHA-2 come from your browser's Web Crypto; scrypt (RFC 7914, absent from Web Crypto) is Locker's own code. No third-party crypto library.
The link secret
Each Locker gets a fresh 256-bit secret from the system's secure random generator, written in base64url (43 characters) after # and a UTC-day namespace prefix:
https://your-locker/#n1-<day>-<tag>.<43-character-secret>
Browsers never send the part after #, so it never reaches the server or its logs. It can still appear in history, extensions, the clipboard and wherever you paste it. Locker removes it from the address bar once open; copies made elsewhere remain.
Two values from one secret
HKDF-SHA-512, salt "PrivacySafe Locker PLK3 key derivation" plus a NUL and the namespace, with a different label per output:
| Output | Label | Size | Used for |
|---|---|---|---|
| Public storage identifier | "public storage identifier" | 128 bits | Naming the Locker on the server |
| File key | "file-encryption AES-256-GCM" | 256 bits | Encrypting and decrypting |
The identifier reveals nothing about the key.
The file format (PLK3)
- A 24-byte header:
PLK3, the record size (1 MB), the metadata length, an 8-byte random nonce prefix, and the record count. - Encrypted metadata: name, type, real size, padded size.
- Encrypted records: the padded file in 1 MB pieces.
Each is encrypted with AES-256-GCM:
- Nonce: the 8-byte prefix plus the record number. Keys are unique per Locker, so a nonce never repeats under a key.
- Authenticated data: the header plus the record number. Changing, reordering, removing or adding records, or editing the header, fails decryption.
- Tag: 128 bits per record.
Records let large files stream and damage show up at the first bad record. The full specification is in CRYPTOGRAPHY.md in the source, checked by an independent decryptor.
Hiding sizes
File size: Padmé zero padding, at least 64 KB, at most about 3% for larger files; encrypted and checked like the file. Name length: metadata is padded to 256, 1,024 or 4,096 bytes.
Passphrases
Stretched with scrypt (N = 2^17, r = 8, p = 1; 128 MB per guess).
- Link and passphrase: the scrypt salt comes from the link secret (label "passphrase salt"); the key comes from both (label "file-encryption AES-256-GCM with passphrase"). The recipient is asked for the passphrase before downloading.
- Passphrase only: the link holds a random locator and salt but no key, so the key rests on the passphrase alone. Four words or emojis are weak offline; this mode needs explicit acknowledgment. Prefer link and passphrase.
Passphrases are normalized (capitals, spaces and punctuation ignored), never stored or sent.
Sending the key separately
A link without its secret, plus the 43-character secret alone. The recipient's browser checks the key belongs to that Locker before downloading.
Short links
A short code maps to the public identifier. The secret stays after #, which survives the redirect, so the server never sees it.
On the recipient's side
Their browser derives the key, downloads, checks the header and every record, and shows or saves the file only if all checks pass. Files that could run code are always downloaded, never opened in the page.
Why it resists quantum computers
Only symmetric cryptography protects a stored Locker (AES-256-GCM, HKDF-SHA-512, scrypt, SHA-2), and no key goes through a public-key exchange, the part quantum computers could break. Grover's algorithm leaves AES-256 about 128 bits. That covers stored files against "record now, decrypt later"; the HTTPS or Tor connection is a separate layer, and a weak passphrase stays weak.
Local Transfer
Nearby (beta): WebRTC (DTLS) plus per-direction AES-256-GCM records keyed from private pairing codes; both users confirm eight matching emojis before any file details are sent. Network addresses may be visible. Camera codes: AES-256-GCM under a key stretched from the words (four by default, up to 24) with PBKDF2-SHA-256 (600,000 rounds); recorded codes allow offline guessing. Enhanced mode uses a separate private 256-bit key QR. See Local Transfer.