Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

eckey-util

drunken00529ISC1.0.4

Eckey privateKey, publicKey and sign verify

Eckey, Sign, Verify, EC, Elliptic, curve, Cryptograhpy

readme

ECKey utils

Elliptic curve signature, public and private key generation and public key verification are realized. Signature algorithm ECDSA

npm i eckey-util --save

Create private key

const ECKey = require('eckey-util')
ECKey.createPrivate()

Get public key

ECKey.getPublicKey(privateKey)

Sign

let signed = ECKey.sign('Hello world!', privateKey)

SignHash

let signed = ECKey.signHash(ECKey.createHash('Hello world!'), privateKey)

Verify

ECKey.verify('Hello world!', signed, publicKey)

VerifyHash

ECKey.verifyHash(ECKey.createHash('Hello world!'), Buffer.from(signed, 'hex'), publicKey)