Modules§
Structs§
- Aad
- The additionally authenticated data (AAD) for an opening or sealing operation. This data is authenticated but is not encrypted.
- Encrypt
Error - Why
encryptcould not seal a plaintext. - Encryption
KeyError - Why
get_encryption_keycould not derive a key: Argon2 rejected the password or the salt, such as a salt that is too short. - Less
Safe Key - Immutable keys for use in situations where
OpeningKey/SealingKeyandNonceSequencecannot reasonably be used. - Unbound
Key - An AEAD key without a designated role or nonce sequence.
Enums§
- Decrypt
Error - Why
decryptcould not open a ciphertext. - Encrypted
Read Error - Why
encrypted_readcould not read a file. - Encrypted
Write Error - Why
encrypted_writecould not write a file.
Constants§
- NONCE_
LEN - All the AEADs we support use 96-bit nonces.
Functions§
- argon2 🔒
- Constructs Argon2 with default params, easier if the weak crypto flag is set for testing
- decrypt
- Decrypts a
ciphertextusingkey. - encrypt
- Encrypt
plaintextusingkey. - encrypted_
read - Reads encrypted data from a file
- encrypted_
write - Write
dataencrypted to afilewith a randomnoncethat will be encoded in the file - get_
encryption_ key - Key used to encrypt and authenticate data stored on the filesystem with a user password.
- get_
random_ nonce - Get a random nonce.
- random_
salt - Generates a B64-encoded random salt string of the recommended 16 byte length