This is a relatively barebones implementation of the Strobe protocol framework in pure Rust. It is intended to be used as a library to build other protocols and frameworks. This implementation currently only supports Keccak-f[1600] as the internal permutation function, which is the largest possible block size, so big deal.
A simple program that encrypts and decrypts a message:
```rust extern crate strobers; use strobers::{SecParam, Strobe};
fn main() { let origmsg = b"Hello there".tovec(); let mut rx = Strobe::new(b"correctnesstest".tovec(), SecParam::B256); let mut tx = Strobe::new(b"correctnesstest".tovec(), SecParam::B256);
rx.key(b"the-combination-on-my-luggage".to_vec(), None, false);
tx.key(b"the-combination-on-my-luggage".to_vec(), None, false);
let ciphertext = rx.send_enc(orig_msg.clone(), None, false);
let decrypted_msg = tx.recv_enc(ciphertext, None, false);
assert_eq!(orig_msg, decrypted_msg);
} ```
subtle
for MAC verificationLicensed under either of
at your option.
This code has not been audited in any sense of the word. Use at your own discretion.