This library implements the Skip Ratchet paper. Skip ratchet is a data structure for deriving keys that maintain backward secrecy. Unlike hash chains, this data structure is capable of efficiently making large leaps in hash count.
use skip_ratchet::Ratchet;
let mut ratchet = Ratchet::new();
ratchet.inc_by(10);
println!("{}", ratchet.derive_key());
use skip_ratchet::Ratchet;
let mut old_ratchet = Ratchet::new();
old_ratchet.inc_by(5);
let mut recent_ratchet = old.clone();
recent_ratchet.inc_by(10);
for revision in recent_ratchet.previous(&old_ratchet, 10) {
println!("{:?}", String::from(&revision));
}
-
Clone the repository.
git clone https://github.com/WebNativeFileSystem/rs-skip-ratchet.git
-
Change directory
cd rs-skip-ratchet
-
Run tests
cargo test --release