Skip to content
forked from cyph/sidh.js

JavaScript wrapper for a WebAssembly build of SIDH.

License

Notifications You must be signed in to change notification settings

tty0482/sidh.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

  • Upgraded to SIDH 2.0.

About

JavaScript wrapper for a WebAssembly build of SIDH.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 43.6%
  • C 29.4%
  • Makefile 27.0%