6.2 Sealing
To seal a secret under a passphrase, a producer:
- Draws a fresh 16-byte
saltand a fresh 12-bytenoncefrom a cryptographically secure random number generator. - Chooses Argon2 parameters,
memory,passesandlanes, within the bounds of §6.3. - Writes the header of §6.1 with those values.
- Derives a 32-byte key with Argon2id, version 0x13 (RFC 9106), from
the passphrase's bytes as the password and
saltas the salt, with no secret value and no associated data. - Encrypts the secret with AES-256-GCM under that key and
nonce, with the whole 52-byte header as the associated data, and appends the ciphertext and the 16-byte tag to the header.
A producer MUST draw a new salt and a new nonce for every seal, including when it seals the same secret under the same passphrase again.
A producer SHOULD use 65,536 KiB of memory, 3 passes and 4 lanes, the second recommended option of RFC 9106 §4, unless it has measured that the machine that opens the secret can afford more.
The passphrase's bytes are used as they are given. Turning typed text into those bytes is §6.4's.