6.1 Binary Format

A sealed secret is a secret encrypted under a key derived from a passphrase, in a self-describing blob: it records everything needed to open it except the passphrase. The certificate authority keeps its private keys in sealed secrets, and so do Peios Signed Objects' key files.

This chapter specifies version 1, identified by the magic PEIOSEAL. It says nothing of what the secret is: a caller seals whatever bytes it holds and gives them meaning itself.

Unlike the rest of this document, every multi-byte integer in a sealed secret is big-endian.

6.1.1 Layout #

OffsetSizeFieldValue
08magicASCII PEIOSEAL
81version1
91kdf1, Argon2id version 0x13
104memoryArgon2 memory in KiB, uint32
144passesArgon2 passes, uint32
184lanesArgon2 lanes, uint32
221salt_len16
2316saltArgon2 salt
391cipher1, AES-256-GCM
4012nonceAES-GCM nonce
52nciphertextThe secret, encrypted; as long as the secret
52 + n16tagThe AES-GCM authentication tag

The first 52 bytes are the header. A sealed secret is at least 68 bytes long: the header and the tag around an empty ciphertext, which is valid.

The kdf and cipher enumerations are closed for version 1. A value other than 1 in either is not a version 1 sealed secret.

Edit this page