This library generates one-time Lamport keypairs to be used for one-time message signing.
This also generates Merkle keytrees that can be used to sign muliple messages.
NOTE:
Lamport keypair generation, signing and verification:
let keypair = new LamportKeyPair();
// signing
let message = 'this is the message that I want to sign';
let signatureObj = keypair.sign(message);
// verification
keypair.verify(message, signatureObj); // true
message = 'this is a message I did not sign';
keypair.verify(message, signatureObj); // false
Merkle keytree generation, signing and verification:
// constructor takes in the number of Lamport keypairs you want this tree to maintain
let keytree = new MerkleKeyTree(4);
// signing
let message = 'this is another message that I want to sign';
let signatureObj = keytree.sign(message);
// verification
keytree.verify(message, signatureObj); // true
message = 'this is a message I did not sign';
keytree.verify(message, signatureObj); // false
MIT