2015-12-19 14:41:39 +01:00
|
|
|
File Format
|
|
|
|
===========
|
|
|
|
|
|
|
|
Header
|
|
|
|
|
|
|
|
2 bytes header version (big endian uint16, currently 2)
|
|
|
|
16 bytes file id
|
|
|
|
|
2019-01-04 19:31:41 +01:00
|
|
|
Data block, default AES-GCM mode
|
2015-12-19 14:41:39 +01:00
|
|
|
|
|
|
|
16 bytes GCM IV (nonce)
|
|
|
|
1-4096 bytes encrypted data
|
|
|
|
16 bytes GHASH
|
|
|
|
|
2019-01-05 02:10:03 +01:00
|
|
|
Data block, AES-SIV mode (used in reverse mode, or when explicitly enabled with `-init -aessiv`)
|
2019-01-04 19:31:41 +01:00
|
|
|
|
|
|
|
16 bytes nonce
|
|
|
|
16 bytes SIV
|
|
|
|
1-4096 bytes encrypted data
|
|
|
|
|
2021-08-26 08:43:41 +02:00
|
|
|
Data block, XChaCha20-Poly1305 (enabled via `-init -xchacha`)
|
2015-12-19 14:41:39 +01:00
|
|
|
|
2021-08-26 08:43:41 +02:00
|
|
|
24 bytes nonce
|
|
|
|
1-4096 bytes encrypted data
|
|
|
|
16 bytes Poly1305 tag
|
|
|
|
|
|
|
|
Full block overhead (AES-GCM and AES-SIV mode) = 32/4096 = 1/128 = 0.78125 %
|
|
|
|
|
|
|
|
Full block overhead (XChaCha20-Poly1305 mode) = 40/4096 = \~1 %
|
|
|
|
|
|
|
|
Example: 1-byte file, AES-GCM and AES-SIV mode
|
|
|
|
----------------------------------------------
|
2015-12-19 14:41:39 +01:00
|
|
|
|
|
|
|
Header 18 bytes
|
|
|
|
Data block 33 bytes
|
|
|
|
|
|
|
|
Total: 51 bytes
|
|
|
|
|
2021-08-26 08:43:41 +02:00
|
|
|
Example: 5000-byte file, , AES-GCM and AES-SIV mode
|
|
|
|
---------------------------------------------------
|
2015-12-19 14:41:39 +01:00
|
|
|
|
|
|
|
Header 18 bytes
|
|
|
|
Data block 4128 bytes
|
|
|
|
Data block 936 bytes
|
|
|
|
|
|
|
|
Total: 5082 bytes
|
2021-08-26 08:43:41 +02:00
|
|
|
|
|
|
|
Example: 1-byte file, XChaCha20-Poly1305 mode
|
|
|
|
----------------------------------------------
|
|
|
|
|
|
|
|
Header 18 bytes
|
|
|
|
Data block 41 bytes
|
|
|
|
|
|
|
|
Total: 59 bytes
|
|
|
|
|
|
|
|
Example: 5000-byte file, XChaCha20-Poly1305 mode
|
|
|
|
----------------------------------------------
|
|
|
|
|
|
|
|
Header 18 bytes
|
|
|
|
Data block 4136 bytes
|
|
|
|
Data block 944 bytes
|
|
|
|
|
|
|
|
Total: 5098 bytes
|