File / text encryption
Protected plaintext begins with one record-type byte.
| Type | Value |
|---|---|
| Metadata | 0x01 |
| Data | 0x02 |
| End | 0x03 |
Record 0 contains metadata. No bytes may follow the final record.
Both formats use a 60-byte public header and the same cryptographic foundation. V2 adds Zstandard compression and folder support.
The full header is included in the authenticated associated data for every record.
| Field | Size | V1 / V2 |
|---|---|---|
| Magic | 8 bytes | GCRYPT01 / GCRYPT02 |
| Version | 2 | 1 / 2 |
| KDF ID | 1 | 1 = Argon2id |
| AEAD ID | 1 | 1 = XChaCha20-Poly1305 |
| Argon m_cost | 4 | KiB |
| Argon t_cost | 4 | passes |
| Argon p_cost | 4 | parallelism |
| Chunk size | 4 | bytes |
| Salt | 16 | random |
| Nonce prefix | 16 | random |
Protected plaintext begins with one record-type byte.
| Type | Value |
|---|---|
| Metadata | 0x01 |
| Data | 0x02 |
| End | 0x03 |
Record 0 contains metadata. No bytes may follow the final record.
Encrypted metadata also includes source type, compression algorithm, and compression level. A folder is serialized into an internal TAR stream before compression.
key_256 = Argon2id(
password,
salt,
header_parameters
)
nonce[0..16] = nonce_prefix
nonce[16..24] = record_index u64 LE
AAD =
header_60_bytes
||
record_index_u64_le
This cryptographically binds every record to its public parameters and its position.
ENCRYPT in V0.1.0 continues to produce V1, while COMPRESS + ENCRYPT continues to produce V2. A future reader must inspect Magic + Version before performing any key derivation.