1. System Overview
AMPCrypt is a zero-trust cryptographic application designed to encrypt payloads client-side before transmission or local storage. Operating inside isolated Web Worker contexts or native desktop runtimes, AMPCrypt ensures that raw cryptographic material never leaves RAM in unencrypted form.
2. Encrypted Binary File Format
Files encrypted by AMPCrypt prepend a 48-byte binary header containing magic signature byte verification and cryptographic salt parameters:
// Binary Header Layout (Big-Endian)
[0..7] : Magic Bytes ("AMPCRYPT")
[8..23] : PBKDF2 Salt (16 bytes)
[24..35] : AES-GCM Initialization Vector IV (12 bytes)
[36..47] : Reserved Extension Bytes (12 bytes)
[48..N] : AES-256-GCM Ciphertext Payload
3. Cipher Specification
- Primitive: AES-256-GCM (NIST SP 800-38D)
- KDF: PBKDF2 with SHA-256, 600,000 iterations
- Key Shares: Shamir's Secret Sharing over Galois Field GF(2^8)
4. Web Worker IPC Protocol
Background Web Workers communicate with main threads via transferrable ArrayBuffer messages:
{
"type": "ENCRYPT",
"payload": {
"fileData": ArrayBuffer,
"passphrase": "your-secret-passphrase",
"salt": "random-hex-salt-32bytes"
}
}