Lisk
$1.28 -1.33%
LSK · 184w

SIDH post quantum cryptography in JavaScript

sidh.js Overview

The SIDH post-quantum asymmetric cipher compiled to WebAssembly using Emscripten. The specific implementation in use is from Microsoft Research. A simple JavaScript wrapper is provided to make SIDH easy to use in web applications.

The parameters are configured to 128-bit strength. (More specifically, the security level is 128 quantum bits and 192 classical bits.)

SECURITY NOTE: the scheme is NOT secure when using static keys. See Remark 1 of this paper.

Example Usage (async () => { const localKeyPair /*: {privateKey: Uint8Array; publicKey: Uint8Array} */ = await sidh.keyPair() ; const remoteKeyPair /*: {privateKey: Uint8Array; publicKey: Uint8Array} */ = await sidh.keyPair() ; const localSecret /*: Uint8Array */ = await sidh.secret(remoteKeyPair.publicKey, localKeyPair.privateKey) ; const remoteSecret /*: Uint8Array */ = await sidh.secret(localKeyPair.publicKey, remoteKeyPair.privateKey) ; // localSecret and remoteSecret are equal console.log(localKeyPair); console.log(remoteKeyPair); console.log(localSecret); console.log(remoteSecret); })();

Note: This library only handles generating shared secrets; you'll need to handle key derivation and symmetric encryption from there.

Changelog

Breaking changes in major versions:

4.0.0:

As part of upgrading from asm.js to WebAssembly (with asm.js included as a fallback), the API is fully asynchronous.

3.0.0:

Removed some undocumented functions as part of minor API cleanup.

2.0.0:

Go to github.com
Recent news
LSK -1.33% · twitter.com · 14h

Blog Post: Building the Smart Transport Project

We have just published @casparroelofs's blog post about the Smart Transport project as part of his participation in the #Lisk Builders program.It demonstrates how a hardware wallet can be used to secu...