jedisct1/libhydrogen
FreeA lightweight, secure, easy-to-use crypto library suitable for constrained environments.
About jedisct1/libhydrogen
The Hydrogen library is a small, easy-to-use, hard-to-misuse cryptographic library designed for constrained environments. It exposes a consistent high-level API inspired by libsodium, built using only the Curve25519 elliptic curve and the Gimli permutation. The code is implemented as one tiny file per set of operations, making it simple to audit and integrate. It requires zero dynamic memory allocations and has low stack requirements (median 32 bytes, maximum 128 bytes), enabling use on microcontrollers and embedded systems. Written in portable C99, it supports Linux, *BSD, macOS, Windows, and the Arduino IDE out of the box. The library can generate cryptographically secure random numbers even on Arduino boards and attempts to mitigate the implications of accidental misuse. It is released under the permissive ISC license.
Key Features
Pros & Cons
- Very small footprint and low resource usage
- Hard to misuse by design, with built-in safety mitigations
- Single liberal license (ISC) simplifies integration
- Supports Arduino and other constrained platforms without external dependencies
- Only two cryptographic building blocks, reducing attack surface
- No interoperability with other crypto libraries or protocols
- Limited to Curve25519 and Gimli; no fallback or alternative primitives
- Networking not included (though key exchange based on Noise is available)
- Not intended to replace more feature-rich libraries like libsodium
- No official releases or versioning on GitHub (no releases published)