A pure-JavaScript high-level API wrapper for Emscripten-compiled libsodium cryptographic routines.
js-nacl is a JavaScript library that provides a high-level API to libsodium cryptographic functions, compiled via Emscripten. It allows developers to perform secure operations like encryption, digital signatures, and hashing directly in JavaScript environments without needing native bindings. The library solves the problem of accessing reliable, modern cryptography in pure JavaScript for both browser and Node.js applications.
JavaScript developers who need to implement cryptography in web or Node.js applications without relying on native modules or server-side processing. It's particularly useful for projects requiring end-to-end encryption, secure messaging, or data integrity verification.
Developers choose js-nacl because it offers a clean, well-documented JavaScript interface to the battle-tested libsodium library, ensuring cryptographic correctness. Its pure-JavaScript nature eliminates compilation and compatibility issues across platforms, while providing a comprehensive set of modern cryptographic primitives.
Pure-Javascript High-level API to Emscripten-compiled libsodium routines. -- MOVED TO https://git.leastfixedpoint.com/tonyg/js-nacl
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Wraps Emscripten-compiled libsodium, eliminating native dependencies and enabling consistent crypto operations in both browsers and Node.js without compilation hassles, as highlighted in the README's cross-platform support.
Offers a full range of libsodium functions including crypto_box, crypto_sign, and hashing, based on modern algorithms like Ed25519, ensuring robust security for various use cases.
Enforces separation between strings and Uint8Arrays with encoding utilities like encode_utf8 and decode_utf8, reducing common bugs in crypto implementations by handling binary data correctly.
The README provides extensive examples, configuration options, and warnings, such as detailed usage for crypto_box and nonce handling, making it easier for developers to implement correctly.
Each instantiation creates a private heap that may not be efficiently garbage collected, and the README acknowledges memory leak issues that require careful management and testing.
Requires window.crypto.getRandomValues and has documented failures in Safari 5.1.x, limiting its use in older or restricted environments without fallbacks.
The API uses a callback or promise-based instantiation with configuration dictionaries, adding complexity compared to simpler synchronous libraries, as noted in the version history with API changes.
The library has undergone API changes, with deprecated aliases like crypto_sign_keypair_from_seed still present but slated for removal, risking future breaking changes for existing code.