Crate bessie

Source
Expand description

Bessie is an authenticated, chunked cipher based on BLAKE3. It’s still in the design stages, and it’s not suitable for production use.

§Examples

Encrypt a message.

let key = bessie::generate_key();
let ciphertext: Vec<u8> = bessie::encrypt(&key, b"hello world");

Decrypt that message.

let plaintext: Vec<u8> = bessie::decrypt(&key, &ciphertext)?;
assert_eq!(b"hello world", &plaintext[..]);

Modules§

testing
Functions that take a nonce from the caller, mainly for testing

Structs§

DecryptReader
An incremental decrypter supporting std::io::Read and std::io::Seek.
EncryptWriter
An incremental encrypter supporting std::io::Write.
Error
An opaque decryption error.

Constants§

CHUNK_LEN
KEY_LEN
NONCE_LEN
TAG_LEN

Functions§

ciphertext_len
Compute the length of a ciphertext, given the length of a plaintext.
decrypt
Decrypt a message and return the plaintext as Result of Vec<u8>.
decrypt_to_slice
Decrypt a message, write the plaintext to an existing slice, and return a Result.
encrypt
Encrypt a message and return the ciphertext as a Vec<u8>.
encrypt_to_slice
Encrypt a message and write the ciphertext to an existing slice.
generate_key
Create a new 32-byte key from a cryptographically secure random number generator.
plaintext_len
Compute the length of a plaintext, given the length of a ciphertext.