RustCrypto: belt-ctr
Generic implementation of the belt-ctr block mode of operation.
Mode functionality is accessed using traits from the cipher crate.
⚠️ Security Warning: Hazmat!
This crate does not ensure ciphertexts are authentic! Thus ciphertext integrity is not verified, which can lead to serious vulnerabilities! AEADs provide simple authenticated encryption, which is much less error-prone than manual integrity verification.
Example
use hex;
use ;
let key = &;
let iv = &;
let plaintext: & = b"hello world! this is my plaintext.";
let ciphertext: & = &hex!;
let mut cipher: BeltCtr = new_from_slices.unwrap;
// encrypt in-place
let mut buf = plaintext.clone;
cipher.apply_keystream;
assert_eq!;
cipher.seek;
cipher.apply_keystream;
assert_eq!;
License
Licensed under either of:
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.