Expand description

strobe-rs

This is a no_std 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].

Here is a simple program that encrypts and decrypts a message:

// Transmitter initializes their STROBE instance with a public context string
let mut tx = Strobe::new(b"correctnesstest", SecParam::B128);
// Receiver initializes their STROBE instance with a public context string
let mut rx = Strobe::new(b"correctnesstest", SecParam::B128);

// Transmitter keys their instance
tx.key(b"the-combination-on-my-luggage", false);
// Receiver keys their instance
rx.key(b"the-combination-on-my-luggage", false);

// Transmitter encrypts a message in place
let mut msg = b"Attack at dawn".to_vec();
tx.send_enc(msg.as_mut_slice(), false);

// Rename for clarity. `msg` has been encrypted in-place.
let mut ciphertext = msg;

// Receiver takes the message and decrypts it in place
rx.recv_enc(ciphertext.as_mut_slice(), false);

// Rename for clarity again
let round_trip_msg = ciphertext;

// Ensure that the sent message was the one received
assert_eq!(&round_trip_msg, b"Attack at dawn");

Structs

An empty struct that just indicates that MAC verification failed
The main Strobe object. This is currently limited to using Keccak-f[1600] as the internal permutation function. For more information on this object, the protocol specification is a great resource.

Enums

Security parameter. Choice of 128 or 256 bits.

Constants

Version of Strobe that this crate implements.