Module iop_keyvault::encrypt
source · [−]Expand description
A thin integration of Argon2i
and XChaCha20Poly1305
algorithms from the orion
crate to encrypt/decrypt in-memory blobs with a password.
Functions
Decrypts the ciphertext with a password. The format of the ciphertext is defined by the encrypt()
function. Only the matching
password will decrypt the ciphertext.
Encrypts the plaintext with a password. Make sure the password is not weak. Make sure to generate an exactly 24-byte random nonce for each call otherwise there is a chance of weakening the key if the same nonce is used more than once. The ciphertext returned will be 40 bytes longer than the plaintext.