]> git.proxmox.com Git - proxmox-backup.git/blame - docs/file-formats.rst
docs: ransom ware: fix some typos commented in review
[proxmox-backup.git] / docs / file-formats.rst
CommitLineData
998b827a
DM
1File Formats
2============
3
85e139b7
DM
4.. _pxar-format:
5
998b827a
DM
6Proxmox File Archive Format (``.pxar``)
7---------------------------------------
8
998b827a
DM
9.. graphviz:: pxar-format-overview.dot
10
ec07a280
DM
11
12.. _data-blob-format:
13
e57aa36d
DM
14Data Blob Format (``.blob``)
15----------------------------
ec07a280 16
2bc1250c
DW
17The data blob format is used to store small binary data. The magic number
18decides the exact format:
ec07a280
DM
19
20.. list-table::
21 :widths: auto
22
23 * - ``[66, 171, 56, 7, 190, 131, 112, 161]``
24 - unencrypted
25 - uncompressed
26 * - ``[49, 185, 88, 66, 111, 182, 163, 127]``
27 - unencrypted
28 - compressed
29 * - ``[123, 103, 133, 190, 34, 45, 76, 240]``
30 - encrypted
31 - uncompressed
32 * - ``[230, 89, 27, 191, 11, 191, 216, 11]``
33 - encrypted
34 - compressed
35
2bc1250c
DW
36The compression algorithm used is ``zstd``. The encryption cipher is
37``AES_256_GCM``.
ec07a280
DM
38
39Unencrypted blobs use the following format:
40
41.. list-table::
42 :widths: auto
43
44 * - ``MAGIC: [u8; 8]``
45 * - ``CRC32: [u8; 4]``
46 * - ``Data: (max 16MiB)``
47
2bc1250c
DW
48Encrypted blobs additionally contain a 16 byte initialization vector (IV),
49followed by a 16 byte authenticated encryption (AE) tag, followed by the
50encrypted data:
ec07a280
DM
51
52.. list-table::
53
54 * - ``MAGIC: [u8; 8]``
55 * - ``CRC32: [u8; 4]``
400e90cf 56 * - ``IV: [u8; 16]``
ec07a280
DM
57 * - ``TAG: [u8; 16]``
58 * - ``Data: (max 16MiB)``
b488f850
DM
59
60
61.. _fixed-index-format:
62
e57aa36d
DM
63Fixed Index Format (``.fidx``)
64-------------------------------
b488f850
DM
65
66All numbers are stored as little-endian.
67
68.. list-table::
69
70 * - ``MAGIC: [u8; 8]``
71 - ``[47, 127, 65, 237, 145, 253, 15, 205]``
72 * - ``uuid: [u8; 16]``,
73 - Unique ID
74 * - ``ctime: i64``,
75 - Creation Time (epoch)
76 * - ``index_csum: [u8; 32]``,
2bc1250c 77 - SHA-256 over the index (without header) ``SHA256(digest1||digest2||...)``
b488f850
DM
78 * - ``size: u64``,
79 - Image size
80 * - ``chunk_size: u64``,
81 - Chunk size
82 * - ``reserved: [u8; 4016]``,
2bc1250c 83 - Overall header size is one page (4096 bytes)
b488f850 84 * - ``digest1: [u8; 32]``
2bc1250c 85 - First chunk digest
b488f850 86 * - ``digest2: [u8; 32]``
2bc1250c 87 - Second chunk digest
b488f850 88 * - ...
2bc1250c 89 - Next chunk digest ...
b488f850
DM
90
91
92.. _dynamic-index-format:
93
e57aa36d
DM
94Dynamic Index Format (``.didx``)
95--------------------------------
b488f850
DM
96
97All numbers are stored as little-endian.
98
99.. list-table::
100
101 * - ``MAGIC: [u8; 8]``
102 - ``[28, 145, 78, 165, 25, 186, 179, 205]``
103 * - ``uuid: [u8; 16]``,
104 - Unique ID
105 * - ``ctime: i64``,
106 - Creation Time (epoch)
107 * - ``index_csum: [u8; 32]``,
2bc1250c 108 - SHA-256 over the index (without header) ``SHA256(offset1||digest1||offset2||digest2||...)``
b488f850
DM
109 * - ``reserved: [u8; 4032]``,
110 - Overall header size is one page (4096 bytes)
111 * - ``offset1: u64``
112 - End of first chunk
113 * - ``digest1: [u8; 32]``
2bc1250c 114 - First chunk digest
b488f850
DM
115 * - ``offset2: u64``
116 - End of second chunk
117 * - ``digest2: [u8; 32]``
2bc1250c 118 - Second chunk digest
b488f850 119 * - ...
2bc1250c 120 - Next chunk offset/digest