Backup format

Last updated: September 14, 2026

Your backups belong to you, and must stay yours even without us. The format of .sigbak archives is public, and a small open-source program decrypts them on a computer with your backup key. If Sigillarium were to disappear, your documents would remain readable.

1. Decrypting a backup on a computer

  1. Install Python 3.
  2. Install the cryptography library: pip install cryptography
  3. Download the program sigbak_decrypt.py.
  4. Run it with your archive and an output folder:
python sigbak_decrypt.py backup.sigbak my-documents

The program asks for your backup key at the keyboard (it is not shown on screen), then extracts each document into the folder. It checks the integrity of each one: a damaged document is reported and skipped, the others are extracted. The program only reads the archive and sends nothing over the Internet.

Exit code: 0 if the archive is intact, 1 if documents are missing or the archive is incomplete, 2 on error (wrong key, invalid file).

2. Format specification, version 1

This section is for people who want to check the format or write their own reader.

2.1 Backup key

2.2 Key derivation

okm            = HKDF-SHA256(key, header salt, "Sigillarium archive v1", 64)   (RFC 5869)
encryption_key = okm[0..32]
check_key      = okm[32..64]

2.3 Header (56 bytes, plaintext)

BytesContent
0–5SIGBAK (ASCII)
6format version: 1
7key derivation: 1 = HKDF-SHA256
8–39random salt (32 bytes)
40–55key check: HMAC-SHA256(check_key, bytes 0–39), truncated to 16 bytes

2.4 Records

After the header, until the end of the file: type (1 byte) · ciphertext length L, tag included (4 bytes, big-endian) · nonce (12 bytes) · AES-256-GCM (encryption_key), ciphertext followed by the 16-byte tag.

Associated data of the record at index n (0 for the first): header (56) ‖ n (4, big-endian) ‖ type (1) ‖ L (4, big-endian). A record that is moved, removed or taken from another archive therefore fails authentication.

TypeNameDecrypted content
0x01INFOJSON: {"createdAt": "<ISO 8601 UTC>"}
0x02METAJSON: document metadata
0x03DATAdocument bytes
0x7FENDJSON: {"entries": <number of documents>}

Sequence: INFO, then (META, DATA) for each document, then END.

2.5 Metadata (META)

name, fileType (MIME type), createdAt, modifiedAt (or null), description (or null), tags, sha256 (of the DATA bytes), size, and metadata (optional). A reader ignores unknown fields, and must never use name as a file path as is.

2.6 Damaged archive

2.7 Test vector

archive_v1_sample.sigbak — 1,078 bytes, SHA-256 01b1eb4ac4aca12d32f0a482d76ec5dc5ec1b2f90e64ad64fcc16b1b8c478dbb. Key: 000G-40R4-0M30-E209-185G-R38E-1W73 (bytes 00 to 0F). It contains photo.jpg (300 bytes) and a document named ../note.txt, a deliberately hostile name that a correct reader must not use as a path.

2.8 Limits of version 1