Skip to content

DineshRajput21/react-native-dh-keys

Repository files navigation

react-native-dh-keys

Getting started

$ npm install react-native-dh-keys --save

Mostly automatic installation

$ react-native link react-native-dh-keys

Usage

import DHKeys from 'react-native-dh-keys';

//Create Client Public and Private keys using P and G values
DHKeys.getEncodedPublicKeyFromPg(P, G,).then(({ clientPrivateKey, clientPublicKey }) => {
	console.log(`Private Key:  ${clientPrivateKey}  Public Key: ${clientPublicKey}`)
});

//In order to generate Shared key
// third param p is only for ios
DHKeys.getSharedSecretHex(serverPublicKey, clientPrivateKey, P).then((sharedKey) => {
console.log(`Shared Key:  ${sharedKey}`);
});

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published