diffie-hellman-ts
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Diffie Hellman Key Exchange

Simple implementation of DHKE using typescript

the prime and the generator number are from RFC 3526

Instaling

using NPM:

npm i diffie-hellman-ts

using Yarn:

yarn add diffie-hellman-ts

How to use

import { Client } from 'diffie-hellman-ts'
const alice = new Client()
const bob = new Client()

const alicePublicsNumber = alice.generatePublicNumber()
const bobPublicsNumber = bob.generatePublicNumber()

const aliceBobSharedKey = alice.generateSharedSecret(bobPublicsNumber)
//const aliceBobSharedKey = bob.generateSharedSecret(alicePublicsNumber)

The Client class accept a MODP group id (https://tools.ietf.org/html/rfc3526) to use as generator number and prime number.
The default id is 14.

Package Sidebar

Install

npm i diffie-hellman-ts

Weekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

12 kB

Total Files

7

Last publish

Collaborators

  • willyandan