Post-Quantum Cryptography Key Agreement Algorithm
🏠 Homepage
npm i newhope-ts
yarn add newhope-ts
yarn test
const newHopeAlice = new NewHope();
newHopeAlice.generateKeyPair();
const sharedRandomness = newHopeAlice.sharedRandomness;
const newHopeBob = new NewHope();
newHopeBob.sharedRandomness = sharedRandomness;
newHopeBob.generateKeyPair();
// newHopeBob.vector = errorDistribution;
const aliceShared = newHopeAlice.generateSharedSecret(
newHopeBob.publicKey,
Encoding.MATRIX
);
newHopeBob.vector = newHopeAlice.vector;
const bobShared = newHopeBob.generateSharedSecret(
newHopeAlice.publicKey,
Encoding.MATRIX
);
console.log("Alice");
console.log(aliceShared.toString());
console.log("Bob");
console.log(bobShared.toString());
if (aliceShared.toString() === bobShared.toString()) {
console.log("Success!");
} else {
console.log("Failed");
}
👤 CuteWisp [email protected]
- Website: Cutewisp.com
- Github: @sweatpotato13
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator