A Rust implementation of the Strobe protocol framework
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
benches
kat
src
.gitignore
.travis.yml
Cargo.toml
LICENSE-APACHE
LICENSE-MIT
README.md

README.md

strobe-rs

Build Status Version Docs

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.

Example

A simple program that encrypts and decrypts a message:

extern crate strobe_rs;
use strobe_rs::{SecParam, Strobe};

fn main() {
    let orig_msg = b"Hello there".to_vec();
    let mut rx = Strobe::new(b"correctnesstest".to_vec(), SecParam::B256);
    let mut tx = Strobe::new(b"correctnesstest".to_vec(), 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);
}

TODO

  • Add benchmarks
  • Contribute an asm impelmentation of Keccak-f[1600] to tiny-keccak and expose a feature flag that lets strobe-rs users choose which implementation they prefer.
  • Put more asserts in the code like the Python implementation does. Not sure if this is a great idea though

License

Licensed under either of

at your option.

Warning

This code has not been audited in any sense of the word. Use at your own discretion.