@gibme/crypto
    Preparing search index...

    @gibme/crypto

    Standalone Cryptography Library

    A standalone cryptographic primitive wrapper library that can be included in various projects across a variety of development environments, including:

    • Node.js >= 22.x (native C++ addon)
    • WASM
    • Javascript (asm.js)

    It wraps gibme-c/crypto and exposes much of the functionality of that package to the supported development environments.

    Note: Due to the size of the resulting WASM/Javascript module(s), only English mnemonic words are compiled by default.

    Note: If you are looking to use this package in a browser, please read the browser directions below for a lighter installation path and minimal package size.

    • Hashing (Argon2d/i/id, SHA-256, Keccak, Blake2b, and more)
    • Key derivation and HD keys (BIP32/BIP44/SLIP-0010)
    • Mnemonic seed generation and restoration
    • Digital signatures (Ed25519, ring signatures, CLSAG, Triptych)
    • Range proofs (Bulletproofs, Bulletproofs+)
    • RingCT (Pedersen commitments, pseudo commitments, amount masking)
    • Multisig support
    • Automatic module selection: native C++ addon > WASM > asm.js fallback

    Prebuilds of the Node.js native addon module and WASM/JS binaries are included with the npm-distributed package. If a prebuild for your platform does not exist, the native addon will be compiled automatically via CMake.

    • Node.js >= 22.x
    • Compiler supporting C++17 (gcc/clang/MSVC)
    yarn add @gibme/crypto
    
    npm install @gibme/crypto
    
    import Crypto from '@gibme/crypto';

    const crypto = await Crypto.init();
    const Crypto = require('@gibme/crypto').default;

    const crypto = await Crypto.init();

    By default, the library selects the best available module (native > WASM > JS). You can override this:

    import Crypto from '@gibme/crypto';

    const crypto = await Crypto.init();

    // Force WASM module
    await Crypto.force_wasm_library();

    // Force JS (asm.js) module
    await Crypto.force_js_library();

    The package provides subpath exports for directly importing specific module loaders:

    import Crypto from '@gibme/crypto/wasm'; // WASM loader
    import Crypto from '@gibme/crypto/asm'; // asm.js loader
    import Crypto from '@gibme/crypto/node'; // Native addon loader

    For browser environments, use the dedicated browser package which provides a lighter installation without the native C++ addon.

    yarn add @gibme/crypto-browser
    
    npm install @gibme/crypto-browser
    
    import Crypto from '@gibme/crypto-browser';

    const crypto = await Crypto.init();
    const Crypto = require('@gibme/crypto-browser').default;

    const crypto = await Crypto.init();

    Full TypeScript/JS API documentation is available at gibme-npm.github.io/crypto.

    External references are provided via libraries in the Public Domain (Unlicense), MIT, and/or BSD from their respective parties.

    This wrapper library is provided under the BSD-3-Clause license found in the LICENSE file.

    Please make sure when using this library that you follow the licensing requirements set forth in all licenses.