Crate private_box

source ·

Structs

PublicKey for asymmetric authenticated encryption
SecretKey for asymmetric authenticated encryption

Constants

Number of bytes in a PublicKey.
Number of bytes in a SecretKey.

Functions

Attempt to decrypt a private-box message, using your secret key. If you were an intended recipient then the decrypted message is returned as Ok(Vec<u8>). If it was not for you, then Err(()) will be returned.
Takes the message you want to encrypt, and an array of recipient public keys. Returns a message that is encrypted to all recipients and openable by them with private_box::decrypt. The number of recipients must be between 1 and 7.
libsodium must be initialised before calling encrypt or decrypt. If you’re using other libsodium based libraries that already initialise libsodium, you can omit the call to init. init is provided as a convenience function and the code is only: