Skip to content

Lamport one-time signature scheme library with Merkle's approach for smaller signatures.

Notifications You must be signed in to change notification settings

Capitalisk/lite-lamport

Repository files navigation

lite-lamport

Lamport one-time signature scheme library.

Installation

npm install lite-lamport

Usage

Basic

const LiteLamport = require('lite-lamport');

let lamport = new LiteLamport();

// Generate private key and public key
let { privateKey, publicKey } = lamport.generateKeys();

let message = 'hello world';

// Sign message
let signature = lamport.sign(message, privateKey);

// Verify message; returns true or false
lamport.verify(message, signature, publicKey);

Generate keys from from seed

const LiteLamport = require('lite-lamport');

let lamport = new LiteLamport();

// Generate random secret seed
let seed = lamport.generateSeed();

// Generate private key and public key from a seed with index as second argument
let { privateKey, publicKey } = lamport.generateKeysFromSeed(seed, 0);

Works on Node.js and in the browser.

License

MIT

About

Lamport one-time signature scheme library with Merkle's approach for smaller signatures.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published