@epicinium/clavem
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

@epicinium/clavem

An implementation of Ed25519 by SUPERCOP ref10.

Build StatusLicensePackage Version

Table of Contents

Installation

$ npm install --save @epicinium/clavem

Usage

generateKeyPair([seed])

Generate a new asymmetric key pair of the Ed25519.

Definition

function generateKeyPair(seed?: Buffer = crypto.randomBytes(32)): Promise<{ publicKey: Buffer; privateKey: Buffer }>;

Example

const { publicKey, privateKey } = await generateKeyPair();

sign(message, publicKey, privateKey)

Calculate the signature on the passed message and keys.

Definition

function sign(message: Message, publicKey: Buffer, privateKey: Buffer): Promise<Buffer>;

Example

const signature = await sign('Hello, world!', publicKey, privateKey);

verify(message, signature, publicKey)

Verify the provided data using the given message and signature.

Definition

function verify(message: Message, signature: Buffer, publicKey: Buffer): Promise<boolean>;

Example

const isVerified = await verify('Hello, world!', signature, publicKey);

if (isVerified) {
    // ...
} else {
    // ...
}

Contributing

Requisites

Trivia

clavem means key in the Latin Language.

License

MIT Licensed.

Dependents (1)

Package Sidebar

Install

npm i @epicinium/clavem

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

76 kB

Total Files

11

Last publish

Collaborators

  • cichol