https://github.com/samuelschlesinger/blake3-lamport-signatures
An implementation of Lamport/Merkle signatures in Rust using the BLAKE3 hash function.
https://github.com/samuelschlesinger/blake3-lamport-signatures
cli cryptography lamport-signature-scheme merkle-signature-scheme rust rust-lang signature
Last synced: 2 months ago
JSON representation
An implementation of Lamport/Merkle signatures in Rust using the BLAKE3 hash function.
- Host: GitHub
- URL: https://github.com/samuelschlesinger/blake3-lamport-signatures
- Owner: SamuelSchlesinger
- Created: 2022-01-29T20:57:28.000Z (over 3 years ago)
- Default Branch: bankroll
- Last Pushed: 2023-05-03T16:48:15.000Z (about 2 years ago)
- Last Synced: 2025-02-28T09:21:06.897Z (3 months ago)
- Topics: cli, cryptography, lamport-signature-scheme, merkle-signature-scheme, rust, rust-lang, signature
- Language: Rust
- Homepage:
- Size: 29.3 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# blake3-lamport-signatures
[](https://github.com/SamuelSchlesinger/blake3-lamport-signatures/actions/workflows/rust.yml)
Lamport, as well as Lamport-Merkle, signatures implemented using the `blake3`
cryptographic hash function. This is an incredibly inefficient digital
signature protocol and shouldn't be used under almost all circumstances, its
main benefit being its simplicity and flexibility.Lamport keypairs should only be used to sign one message, while you can specify a
number of messages to support in a Lamport-Merkle keypair.```rust
use blake3_lamport_signatures::lamport;let private_key = lamport::PrivateKey::generate()?;
let public_key = private_key.public_key();
let message = b"Yeah, I said it";
let signature = private_key.sign(message);assert!(public_key.verify(message, &signature));
use blake3_lamport_signatures::merkle;
// generate a Merkle-Lamport private key capable of signing 100 messages
let mut private_key = merkle::PrivateKey::generate(100);
let public_key = private_key.public_key();
let message = b"And I'll say it again!";
let signature = private_key.sign(message);assert!(public_key.verify(message, &signature);
```## Communication
There is a natural two-party verified communication protocol associated with
lamport signatures. Alice and Bob start with preshared `PublicKey`s, and each
time they send a message, they include the `PublicKey` for the next message.## Merkle Signer
There is an included program to generate and use Merkle signatures in
`blake3-merkle-signer`. The API is:```
Usage: signerCommands:
key-gen
sign
verify
help Print this message or the help of the given subcommand(s)Options:
-h, --help Print help
```## Acknowledgements
Leslie Lamport is a really cool dude.