pub fn encrypt<'a>(
plaintext: &[u8],
passphrase: &[u8],
) -> PyResult<Cow<'a, [u8]>>
Expand description
Encrypts plaintext
and into a newly allocated bytes
.
This uses the recommended Argon2 parameters according to the OWASP Password Storage Cheat Sheet. This also uses Argon2id as the Argon2 type and version 0x13 as the Argon2 version.
ยงErrors
Returns an error if the Argon2 context is invalid.