Structs§
- Throttled
Reporter - A reporter that only forwards materially different updates.
Constants§
- CHUNK_
SIZE - 1 MB chunks — balances memory usage vs per-chunk overhead.
- EXTENSION
- HEADER_
LEN - HEADER_
V3_ LEN - V3 header: 8 (magic) + 16 (salt) + 7 (stream_nonce) = 31 bytes.
- HEADER_
V4_ LEN - V4 reuses the V3 header layout: 8 (magic) + 16 (salt) + 7 (stream_nonce) = 31 bytes.
- MAGIC
- MAGIC_
V3 - VAULTX03 file header layout (31 bytes total):
- MAGIC_
V4 - MAX_
ENCRYPTED_ FILE_ SIZE - MAX_
FILE_ SIZE - MAX_
V3_ FILE_ SIZE - EncryptorBE32 uses a 4-byte (32-bit) counter, so the maximum number of intermediate chunks is 2^32. At 1 MiB per chunk, the maximum safe file size before counter wraparound is 2^32 * 1 MiB = 2^52 bytes = 4 PiB. Encrypting a file larger than this would cause counter wraparound, reusing (key, nonce, counter) triples and catastrophically breaking GCM-SIV confidentiality and integrity.
- MAX_
V4_ FILE_ SIZE - V4 file-size limit is the same as V3 (same BE32 counter constraint).
- MIN_
PASSWORD_ LEN - Minimum passphrase length for security.
- NONCE_
LEN - SALT_
LEN - SALT_
V3_ LEN - 16-byte salt — 128-bit entropy, recommended minimum for Argon2.
- STREAM_
NONCE_ LEN - EncryptorBE32 uses 5 bytes of the 12-byte nonce (4-byte counter + 1-byte flag).
- TAG_LEN
Traits§
- Progress
Reporter - Receives best-effort progress updates from long-running crypto operations.
Functions§
- decrypt_
bytes - decrypt_
file - decrypt_
stream - Stream-decrypt from any reader to any writer. Used by the CLI for stdin/stdout piping. Does not create temp files or handle renaming.
- default_
decrypt_ output_ name - Return the default decrypted output file name for
path. - default_
encrypt_ output_ name - Return the default encrypted output file name for
path. - encrypt_
bytes - encrypt_
file - encrypt_
stream - Stream-encrypt from any reader to any writer. Used by the CLI for stdin/stdout piping. Does not create temp files or handle renaming.
- parse_
header - secure_
wipe - Attempts a 3-pass random overwrite, rename, and deletion of
path.