1.0.5 • Published 7 years ago

mceliece-js v1.0.5

Weekly downloads
1
License
BSD-2-Clause
Repository
github
Last release
7 years ago

mceliece.js

Overview

The McEliece post-quantum asymmetric cipher compiled to pure JavaScript using Emscripten. The specific implementation in use is INRIA's HyMES. A simple wrapper is provided to make McEliece easy to use in web applications.

The parameters are configured to slightly above 128-bit strength.

Example Usage

const keyPair /*: {privateKey: Uint8Array; publicKey: Uint8Array} */ =
	mceliece.keyPair()
;

const plaintext /*: Uint8Array */ =
	new Uint8Array([104, 101, 108, 108, 111, 0]) // "hello"
;

const encrypted /*: Uint8Array */ =
	mceliece.encrypt(plaintext, keyPair.publicKey)
;

const decrypted /*: Uint8Array */ =
	mceliece.decrypt(encrypted, keyPair.privateKey) // same as plaintext
;

Note: McEliece generally shouldn't be used to directly encrypt your data; in most cases, you'll want to pair it with a symmetric cipher and use it to encrypt symmetric keys.

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago