PQC1 Binary Format · Zero RAM Persistence · Multi-Layer Abuse Defense

Security Architecture & Cryptographic Specification

Transparent documentation of the PQC1 binary container layout, hybrid post-quantum primitives, anti-brute-force controls, and 10-second offline memory wiping.

CONTAINER FORMAT

PQC1 Ciphertext Binary Layout

Every encryption generates a fresh 16-byte salt, 7-byte stream nonce prefix, and random 32-byte DEK. All 1,220 header bytes are bound as AES-256-GCM AAD on every chunk.

0..19 (19 B) Magic "PQC1" + chunk size & random nonce prefix
19..44 (25 B) Argon2id cost params + 16 B random salt
44..52 (8 B) Derived public-key fingerprint ID
52..1220 (1,168 B) ML-KEM-768 + X25519 HPKE encapsulated DEK
1220..EOF (var) Chunked AES-256-GCM authenticated payload
Byte Offset Length Field Cryptographic Purpose
0..4 4 B Magic Fixed header "PQC1" identifying a valid container
4..8 4 B Version & Suite Version 1 · AES-256-GCM · Hybrid PQ Passphrase Mode (3)
8..19 11 B Chunk & Nonce Prefix 1 MiB stream chunk size + 7-byte CSPRNG nonce prefix
19..44 25 B Argon2id Params & Salt 64 MiB RAM, 3 iterations, 4 lanes + 16-byte random salt
44..52 8 B Key Fingerprint ID First 8 bytes of SHA-256(public key) for fast wrong-password rejection
52..1220 1168 B PQ HPKE Encapsulation RFC 9180 MLKEM768-X25519 + HKDF-SHA256 + AES-256-GCM wrapping 32 B DEK
1220..EOF Variable STREAM AEAD Chunks Per-chunk counter + final-chunk tag preventing truncation or reordering
SECURITY CONTROLS

Server Hardening & Offline Client Boundaries

Web Server Security Controls

  • Instant RAM Zeroing: No database, no temp files, and no access logs; plaintext and password byte slices are wiped immediately before returning.
  • Anti-Brute-Force & Rate Limiting: Token-bucket per-IP rate limits, global Argon2id concurrency cap, and automatic probe bans using HMAC-hashed IPs in RAM (no cleartext IPs stored).
  • Safe Downloads & Traversal Guards: Blocks '..', encoded slashes, NUL bytes, symlinks, and reserved device names; serves binaries strictly from preloaded in-memory allowlists.
  • Strict CSP & Cross-Origin Defense: Per-request cryptographic CSP nonces, Trusted Types enforcement, Sec-Fetch-Site checks, and Origin verification.

Offline Decryption Client Guarantees & Notes

  • Compile-Time Air-Gap Verification: Automated AST tests verify zero 'net/*' imports in the decryption engine; progressive cooldown delays throttle repeated wrong passwords.
  • Verify-Before-Display Integrity: Full PQC1 ciphertext authentication completes in memory before a single byte of plaintext is shown.
  • 10-Second Auto-Delete: Synchronized Go vault timer and UI countdown wipe RAM and clear the window/terminal at 10s; CLI refuses pipe/file redirection.
  • Operational Hygiene: In-memory wiping cannot prevent external phone cameras, OS screen recorders, or clipboard history managers—always decrypt on a trusted machine.