1. What is a .zsafe File?
A .zsafe file (e.g. Personal_Vault.zsafe) is an authenticated, zero-knowledge cryptographic file container. It packages arbitrary files and complex nested directories into a single portable binary file that can only be unlocked with the correct master passphrase (and optional keyfile).
Operating under the ZV3\0 STREAM AEAD container specification, a .zsafe file is bit-for-bit identical across all platforms: a vault created in Google Chrome on Windows can be opened seamlessly on an Android phone, Mac, or offline Linux laptop.
2. Why .zsafe Over Standard ZIP or Encrypted Disks?
Most everyday encryption tools suffer from significant structural vulnerabilities:
- Plain ZIP / Encrypted RAR: Even when encrypted, traditional archive formats leak metadata—file names, folder structures, and uncompressed sizes remain readable in plaintext to anyone who inspects the file.
- BitLocker / VeraCrypt Containers: Require kernel-level drivers, administrator permissions, fixed pre-allocated disk capacities, and cannot be streamed or opened directly inside a web browser.
- ZevSafe
.zsafeVaults:- Zero metadata leakage: folder structures, file names, and timestamps are sealed inside an encrypted tail manifest.
- Dynamic sizing: file size matches the actual data without pre-allocated dummy blocks.
- Direct browser execution: unlocks instantly in pure Web Crypto without root permissions.
3. The 3-Region Binary Container Structure
Every valid .zsafe container consists of three contiguous byte regions:
- 57-Byte Header: Stores container flags, salt parameters, chunk dimensions, and a 64-bit pointer to the manifest.
- STREAM AEAD Payload: The encrypted data payload, split into uniform 4 MB chunks. Each chunk is encrypted with AES-256-GCM.
- Sealed Tail Manifest Catalog: An encrypted JSON catalog storing the directory tree, decoded in under 300 ms upon authentication.
4. The 57-Byte Container Header Layout
Every .zsafe file begins with exactly 57 unencrypted header bytes (V3_HEADER_SIZE = 57):
Offset (B) | Size | Encoding | Field Name | Description
-----------+------+-----------+-----------------+----------------------------------------
0 .. 3 | 4 B | ASCII | MAGIC | Constant: "ZV3\0" (0x5A 0x56 0x33 0x00)
4 | 1 B | Uint8 | VERSION | Container schema version (0x03)
5 | 1 B | Uint8 | FLAGS | Bit 0: Keyfile 2FA; Bit 1: Duress; Bit 2: Argon2id
6 .. 9 | 4 B | Uint32 BE | CHUNK_SIZE | Default: 4,194,304 bytes (4 MB)
10 .. 41 | 32 B | Raw Bytes | SALT | CSPRNG salt for Argon2id (64MB) / PBKDF2-SHA512
42 .. 48 | 7 B | Raw Bytes | BASE_IV_PREFIX | CSPRNG 7-byte prefix for chunk IV derivation
49 .. 56 | 8 B | Uint64 BE | MANIFEST_OFFSET | Big-endian byte offset of encrypted tail catalog
5. Tamper Resistance & Chunk Authentication (AAD)
A critical flaw in naive chunked encryption schemes is chunk swapping or truncation attacks, where an attacker reorders chunks or deletes blocks.
ZevSafe eliminates this threat through Associated Authenticated Data (AAD). Before encrypting each 4 MB block, ZevSafe constructs a 42-byte AAD binding:
Chunk AAD Layout (42 Bytes):
[ Magic (4B) | Version (1B) | Salt (32B) | ChunkIndex (4B BE) | IsLast (1B) ]
Because this 42-byte buffer is authenticated by AES-256-GCM, any attempt to swap Chunk 2 with Chunk 3 or delete the final chunk causes authentication to fail immediately during decryption.
6. 100% Compatibility with Legacy .zev Archives
Prior to the .zsafe release, ZevSafe container files used the .zev extension. To avoid breaking user vaults, ZevSafe maintains 100% backward compatibility:
- Both
.zsafeand.zevfiles are accepted by drop zones, file dialogs, and PWA file handlers. - The decryption pipeline auto-detects legacy v1, v2 (
ZV2\0), and v3 (ZV3\0) vaults. - Existing
.zevarchives unlock, stream video, and unpack identically with zero conversion required.