1. The Reality of Silent Bit-Rot in Storage
All digital storage media degrade over time:
- NAND Flash Memory (SSDs & USB Drives): Trapped electrons slowly leak from floating-gate or charge-trap cells, causing stored bits to flip from 1 to 0. Unpowered USB drives can experience bit rot in as little as 1 to 3 years.
- Magnetic Hard Drives: Thermal fluctuations and magnetic domain decay cause silent sector read errors.
- Cosmic Rays: High-energy atmospheric neutrons flip bits in storage controllers and memory chips.
2. The "All-or-Nothing" Dilemma in Traditional Crypto
Modern authenticated encryption (like AES-GCM or ChaCha20-Poly1305) contains a mathematical authentication tag. If even a single bit is altered or corrupted anywhere in the ciphertext, the tag check fails, and the cryptographic primitive rejects the entire payload.
In monolithic container architectures (where a 10 GB file is encrypted as a single continuous block), a single flipped bit in block 4 makes the entire 10 GB archive completely un-decryptable!
3. 4 MB Chunk Isolation: Fault Containment
ZevSafe circumvents this catastrophe through STREAM AEAD chunk isolation:
- Files are broken into autonomous 4,194,304-byte (4 MB) plaintext blocks.
- Each block is encrypted with an independent 12-byte IV and signed with its own 16-byte authentication tag.
- Fault Containment: If physical flash memory corrupts Byte 500,000,000, only Chunk 119 fails authentication. Chunks 0 through 118 and 120 through $N$ remain 100% authentic and decryptable!
4. How to Run the Deep Cryptographic Integrity Audit
Before relying on an archived vault for multi-year storage, you can run a complete cryptographic health scan in Vault Explorer:
- Unlock the vault in ZevSafe.
- Click 🩺 Audit Vault Health in the explorer toolbar.
- ZevSafe's parallel worker pool streams through every chunk in the file:
- Verifies the 57-byte container header and magic bytes.
- Verifies PBKDF2 salt length ($\ge 32$ bytes) and iteration count floor ($\ge 100,000$).
- Reconstructs 12-byte IVs and 42-byte Associated Authenticated Data (AAD) for every chunk.
- Verifies the 16-byte GCM authentication tag for each 4 MB block.
- Displays a detailed Cryptographic Scorecard showing verified chunk count, byte integrity percentage, and bit-rot status.
5. The Emergency Salvage Workflow
If a damaged vault with corrupted sectors is detected:
// In js/stream-unpacker.js:
try {
const chunkPlaintext = await decryptChunk(chunkIndex, ciphertext, tag);
salvagedStream.write(chunkPlaintext);
} catch (authTagError) {
console.warn(`[Salvage Engine] Chunk ${chunkIndex} authentication failed. Quarantining block.`);
// Quarantine corrupted chunk, log byte range, and continue with next chunk
quarantinedRanges.push({ chunkIndex, offset: chunkIndex * 4194304 });
}
The Salvage Engine isolates the damaged chunks, replaces missing bytes with null filler markers, rescues all surviving files, and downloads a clean, reconstructed ZIP archive.