[−][src]Crate bincode_aes
bincode_aes
bincode_aes
wraps bincode. It encrypts data as it is encoded, and decrypts the data as it is decoded.
Using Basic Functions
extern crate bincode_aes; fn main() { let key = bincode_aes::random_key().unwrap(); let bc = bincode_aes::with_key(key); let target: Option<String> = Some("hello world".to_string()); let mut encoded: Vec<u8> = bc.serialize(&target).unwrap(); let decoded: Option<String> = bc.deserialize(&mut encoded).unwrap(); assert_eq!(target, decoded); }
Structs
BincodeCryptor | public struct used for encrypted serialization |
EncryptedData | wrapped/strong type for serialized ciphertext |
IV | wrapped/strong type for initialization vector |
Key | wrapped/strong type for crypto key |
Enums
CryptorError | potential BincodeCryptor error types |
Functions
create_key | creates a chosen AES key |
random_key | creates a random AES key |
with_key | Returns a keyed BincodeCryptor (~= constructor) |