Generic Output Feedback (OFB) mode implementation.
This crate implements OFB as a synchronous stream cipher.
Warning
This crate does not provide any authentification! Thus ciphertext integrity is not verified, which can lead to serious vulnerabilities!
Examples
extern crate aes;
extern crate ofb;
extern crate hex_literal;
use Aes128;
use Ofb;
use ;
type AesOfb = ;
let key = b"very secret key.";
let iv = b"unique init vect";
let plaintext = b"The quick brown fox jumps over the lazy dog.";
let ciphertext = hex!;
let mut buffer = plaintext.to_vec;
// create cipher instance
let mut cipher = new_var.unwrap;
// apply keystream (encrypt)
cipher.apply_keystream;
assert_eq!;
// and decrypt it back
new_var.unwrap.apply_keystream;
assert_eq!;
// OFB mode can be used with streaming messages
let mut cipher = new_var.unwrap;
for chunk in buffer.chunks_mut
assert_eq!;