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

    5.0.1 • Public • Published

    mceliece

    Overview

    The Classic McEliece post-quantum asymmetric cypher compiled to WebAssembly using Emscripten. A simple JavaScript wrapper is provided to make McEliece easy to use in web applications.

    The default parameter set is mceliece8192128 (roughly 256-bit strength).

    Example Usage

    import {mceliece} from 'mceliece';
    
    const keyPair /*: {privateKey: Uint8Array; publicKey: Uint8Array} */ =
    	await mceliece.keyPair()
    ;
    
    const {cyphertext, secret} /*: {cyphertext: Uint8Array; secret: Uint8Array} */ =
    	await mceliece.encrypt(keyPair.publicKey)
    ;
    
    const decrypted /*: Uint8Array */ =
    	await mceliece.decrypt(cyphertext, keyPair.privateKey) // same as secret
    ;
    
    console.log(keyPair);
    console.log(secret);
    console.log(cyphertext);
    console.log(decrypted);
    

    Changelog

    Breaking changes in major versions:

    5.0.0:

    • Switched from McBits to Classic McEliece. For backwards compatibility with previous versions of this package, use mceliece-legacy.

    4.0.0:

    • Cyphertext generated by mceliece 4.x is incompatible with that of mceliece 3.x, and vice versa:

      • Upgraded to McBits 2.0 and switched symmetric cypher from Salsa20 to ChaCha20.

      • Fixed a bug that sometimes caused invalid output.

      • Decreased maximum plaintext size from 403 to 106 (for consistency with ntru, as well as smaller output).

    3.0.0:

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

    2.0.0:

    • Switched to McBits from HyMES.

    • Removed some undocumented functions as part of minor API cleanup.

    Credits

    Thanks to Shane Curran for donating the npm package name!

    Install

    npm i mceliece

    DownloadsWeekly Downloads

    45

    Version

    5.0.1

    License

    MIT

    Unpacked Size

    139 kB

    Total Files

    9

    Last publish

    Collaborators

    • cyphinc