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:
- It is at least 68 bytes long, and its first 8 bytes are
PEIOSEAL. versionis1,kdfis1, andcipheris1.salt_lenis16.memoryis at most 1,048,576 KiB,passesis from 1 through 16, andlanesis 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.