Expand description
The on-disk format of an encrypted file.
Bytes 0..22 are frozen forever and are fed to the cipher as associated
data, so nothing in the header can be altered without invalidating the tag.
Everything from offset 22 onwards is defined by suite, which is what lets a
future cipher, a chunked mode or compression arrive without a format version
bump and without breaking existing repositories.
offset len field
0 11 magic \x00GITXCRYPT\x00
11 1 format_version
12 1 suite
13 1 flags
14 8 key_id
22 16 synthetic IV <- suite-defined
38 .. ciphertext <- suite-definedStructs§
- Header
- The parsed header of an encrypted file.
Constants§
- FLAG_
LF_ NORMALIZED - Bit 0 of
flags: the plaintext was normalised to LF before encryption. - FORMAT_
VERSION - The only format version written today.
- HEADER_
LEN - Length of the frozen header, all of which is authenticated.
- KEY_
ID_ LEN - Length of the key fingerprint carried by every file.
- MAGIC
- Leading bytes identifying our format.
- OVERHEAD
- Constant number of bytes an encrypted file adds to its plaintext.
- SIV_LEN
- Length of the synthetic IV produced by AES-SIV.
- SUITE_
AES_ 256_ SIV - AES-256-SIV (RFC 5297).
Functions§
- looks_
encrypted - Whether
contentcarries our magic.