6.3 Opening

A reader MUST make these checks, in this order, before it derives a key, and MUST treat a sealed secret that fails any of them as malformed:

  1. It is at least 68 bytes long, and its first 8 bytes are PEIOSEAL.
  2. version is 1, kdf is 1, and cipher is 1.
  3. salt_len is 16.
  4. memory is at most 1,048,576 KiB, passes is from 1 through 16, and lanes is from 1 through 16.

A reader MUST also treat as malformed any parameters its Argon2 implementation refuses, such as memory below 8 KiB for each lane.

The reader then derives the key as §6.2 does, with the recorded parameters and salt, and decrypts with the recorded nonce and the header as associated data.

A reader MUST report a failure to decrypt as one error, meaning that the passphrase is wrong or the sealed secret has been altered. It MUST NOT say which.

Edit this page