Crates.io | rivest_cipher |
lib.rs | rivest_cipher |
version | 0.1.0 |
source | src |
created_at | 2022-12-22 14:03:01.004651 |
updated_at | 2022-12-22 14:03:01.004651 |
description | Simple module with Rivest Cipher implemntation |
homepage | |
repository | https://github.com/bobaxix/rivest_cipher |
max_upload_size | |
id | 743906 |
size | 15,543 |
Simple Rust module with Rivest Cipher implementation.
cargo add rivest_cipher
use rivest_cipher::schemes::rc5;
let key: [u8; 64] = { ... };
let plaintext: [u8; 16] = { ... };
let encryptor: Rc5<u32> = rc5::setup::<u32>(&key, 12);
let ciphertext: Vec<u8> = encryptor.encrypt(&plaintext).unwrap();
assert_eq!(plaintext.as_slice(), encryptor.decrypt(&ciphertext).unwrap().as_slice());