Skip to content

LockHTML v1.2.0

Choose a tag to compare

@drsamonline drsamonline released this 20 Oct 13:25
· 26 commits to main since this release

LockHTML v1.2.0

Large files, solved. A chunked streaming container that works at constant memory.

Highlights

  • ๐Ÿ—‚๏ธ Streaming container (--stream) โ€” the ciphertext goes into a sidecar .bin, encrypted in fixed-size chunks, so reading and decryption cost ~O(chunk size) instead of O(file size). Multi-gigabyte files now work.
  • ๐Ÿงฎ Why it matters: the embedded container holds ~3.7ร— the file size in memory and breaks around 250โ€“300 MB. The streaming sidecar is raw ciphertext (no base64), so it is only ~16 bytes per chunk larger than the original.
  • ๐Ÿ”’ Sound chunking, not naive chunking: per-chunk nonces (base_iv || uint32_be(index)), the chunk index bound as Additional Authenticated Data, and a whole-file HMAC over the metadata and every chunk tag โ€” so reordering, duplication, truncation and metadata tampering are all detected.
  • ๐Ÿ–ฅ๏ธ GUI support โ€” tick โ€œStreaming bundle (large files)โ€ to create one; the unlock tab prompts for the .bin.
  • ๐Ÿ“– docs/DESIGN.md โ€” the size limits, the memory arithmetic and the two containers, written out in full.

Neither container touches the network. โ€œStreamingโ€ here means memory, not the internet โ€” you can lock a 20 GB file on a plane with Wi-Fi off.

Usage

# Large file -> viewer + sidecar
lockhtml lock holiday.mp4 --pin 4821 --stream
lockhtml unlock holiday.locked.html --pin 4821 --data holiday.locked.bin -o holiday.mp4
Embedded (default) Streaming (--stream)
Files the recipient gets 1 2 (.html + .bin)
Practical size ceiling ~250โ€“300 MB Limited by disk
Memory to encrypt/decrypt ~3.7ร— file size ~O(chunk size)

Live GUI

๐Ÿ‘‰ https://drsamonline.github.io/lockhtml/

Verification

43 unit tests, plus an end-to-end run in a real headless Chrome covering both containers โ€” Argon2id/PBKDF2, keyfiles, signatures, watermark, decoy PIN, view limits, and for streaming: multi-chunk, tampered sidecar, truncated container and missing data file. Files locked by the browser are decrypted by the Python core and vice versa. All of this runs in CI.

Security note

The PIN (and keyfile) provide real encryption. The streaming MAC is keyed by the PIN-derived key, so it protects integrity but not authenticity โ€” only an Ed25519 signature proves who produced the file. View limits, expiry, watermarking and one-time view remain browser-enforced deterrents. See SECURITY.md and docs/DESIGN.md.