This package has been deprecated

Author message:

Renamed to "mceliece".

mceliece-js
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

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.

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i mceliece-js

      Weekly Downloads

      0

      Version

      1.0.5

      License

      BSD-2-Clause

      Last publish

      Collaborators

      • cyphinc