Pure Go implementation of the NaCL cryptography API with full feature parity and cross-language compatibility.
go-nacl is a pure Go implementation of the NaCL (Networking and Cryptography Library) cryptographic API. It provides all the cryptographic primitives available in the original NaCL library, including encryption, digital signatures, hashing, and authentication functions. The library solves the problem of needing a complete, compatible NaCL implementation in Go that can interoperate with other language implementations.
Go developers who need cryptographic functionality with NaCL compatibility, particularly those building systems that must interoperate with NaCL implementations in other languages or migrate existing NaCL-based systems to Go.
Developers choose go-nacl because it offers complete NaCL API coverage not available in the standard Go crypto packages, better cross-language compatibility, and a misuse-resistant design with standardized key and nonce sizes. It provides a more faithful NaCL implementation compared to golang.org/x/crypto/nacl.
Pure Go implementation of the NaCL set of API's
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implements all NaCL cryptographic primitives including secretbox, box, sign, hash, and auth, providing a full suite as stated in the README, which is more comprehensive than golang.org/x/crypto/nacl.
Designed to work seamlessly with NaCL implementations in other languages, ensuring compatibility for multi-language systems, a key focus mentioned in the project description.
Enforces 32-byte keys and 24-byte nonces throughout the API, reducing common cryptographic errors and aligning with NaCL's security-by-design philosophy.
Provides functions like nacl.Load and secretbox.EasySeal for key management and message encryption, simplifying usage as shown in the example code snippet.
Uses SUPERCOP's ref10 for crypto_sign, which prepends the entire signature, differing from current NaCL and potentially causing compatibility issues with systems expecting the standard behavior.
Changes function names and behaviors compared to golang.org/x/crypto/nacl, such as Precompute returning the shared key, which may confuse developers familiar with Go's standard packages.
Relies on golang.org/x/crypto packages, introducing dependency risks if those packages have breaking changes or versioning issues outside the project's control.