Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jondubois/simple-lamport
Lamport one-time signature scheme library.
https://github.com/jondubois/simple-lamport
Last synced: 27 days ago
JSON representation
Lamport one-time signature scheme library.
- Host: GitHub
- URL: https://github.com/jondubois/simple-lamport
- Owner: jondubois
- Created: 2020-09-02T21:58:54.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-01-30T20:46:01.000Z (almost 4 years ago)
- Last Synced: 2024-11-07T15:09:27.410Z (3 months ago)
- Language: JavaScript
- Size: 122 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# simple-lamport
Lamport one-time signature scheme library.## Installation
```bash
npm install simple-lamport
```## Usage
### Basic
```js
const SimpleLamport = require('simple-lamport');let lamport = new SimpleLamport();
// 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
```js
const SimpleLamport = require('simple-lamport');let lamport = new SimpleLamport();
// 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