A Rust implementation of Leslie Lamport's eponymous signature scheme, providing a method of digitally signing data through the use of crypotgraphic hashes. Notably, this scheme is believed to be secure even in the face of attack by quantum computers.
TODO
```rust use lamport_ots::KeyPair; use sha2::Sha256;
// Generate a randomized Public/Private KeyPair
let keypair = KeyPair::
// Use that KeyPair to generate a signature for passed data let signature = keypair.sign(b"Hello world!");
// That signature can now verify the signed data assert!(signature.verify(b"Hello world!")); assert!(!signature.verify(b"Hello moon!")); ```
Since lamport_ots
expects byte-data for signing and verifying, working with files (or any Read data) will require that data to first be read into a buffer.
```rust use lamport_ots::KeyPair; use sha2::Sha256;
use std::fs::File; use std::io::Read;
// Generate a randomized Public/Private KeyPair
let keypair = KeyPair::
// Read the desired file into a buffer let mut f = File::open("myfile.txt").unwrap(); let mut buffer = Vec::new(); f.readto_end(&mut buffer);
// Sign the buffer let signature = keypair.sign(&buffer);
// That signature can now verify the buffers contents assert!(signature.verify(&buffer)); ```
This crate makes use of the rand and RustCrypto digest crates. Further, it is intended for use with any of RustCrypto's numerous hash functions, or any other hashing algorithm which implements their digest
trait.
This crate has been in no way vetted for security by any competent authority, and thus is not intended for any serious use without prior inspection. Use at your own risk.
This software distributed under the MIT License