0.0.10 • Published 4 years ago

asymmetric-diffie-hellman v0.0.10

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

asymmetric diffie hellman

Asymmetric key echange

This package was designed as a placeholder for a future quantum-resistant key exchange algorithm once that is proven-secure.

Installation

npm install 

Usage

First we'll need to import the package

import {KeyPair} from 'asymmetric-diffie-hellman';

Generating a keypair

Let's generate a key pair for the sender (alice) and the receiver (bob)

const Alice = new KeyPair();
const Bob   = new KeyPair();

Getting the public key to share

const AlicePublic = Alice.pubkey;
const BobPublic   = Bob.pubkey;

Generating encryption key seed for transmitting

When transmitting a message from Alice to Bob, Alice will need to include the new key generated in a non-encrypted manner. Using this new key, Bob can generate the same secret as Alice had when encrypting the message.

const AliceTx = Alice.keyExchange(BobPublic);

// Include AliceTx.key in the non-encrypted part of your message
// Use AliceTx.secret to generate the encryption key for your symmetric encryption algorithm

Generating encryption key seed for receiving

const BobRx = Bob.keyExchange(AliceTx.key);

// Use BobRx.secret to generate the encryption key for your symmetric encryption algorith
0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago