aboutsummaryrefslogtreecommitdiff
path: root/Documentation/file-format.md
blob: 04bd2fec6a271e7269e65924dc34b1a1562f544c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
File Format
===========

Header

	 2 bytes header version (big endian uint16, currently 2)
	16 bytes file id

Data block, default AES-GCM mode

	16 bytes GCM IV (nonce)
	1-4096 bytes encrypted data
	16 bytes GHASH

Data block, AES-SIV mode (used in reverse mode, or when explicitly enabled with `-init -aessiv`)

	16 bytes nonce
	16 bytes SIV
	1-4096 bytes encrypted data

Full block overhead = 32/4096 = 1/128 = 0.78125 %

Example: 1-byte file
--------------------

	Header     18 bytes
	Data block 33 bytes

Total: 51 bytes


Example: 5000-byte file
-----------------------

	Header       18 bytes
	Data block 4128 bytes
	Data block  936 bytes

Total: 5082 bytes