Overview of libhydrogen cryptographic library
masterlibhydrogen is a small, easy-to-use, and hard-to-misuse cryptographic library designed for simplicity and security. It provides a consistent high-level API inspired by libsodium, focusing on solving common cryptographic problems rather than exposing low-level primitives.
Key Features
- High-level API: Designed to prevent common cryptographic mistakes.
- Minimalist Core: Built using only two building blocks: the Curve25519 elliptic curve and the Gimli permutation.
- Extremely Lightweight: Zero dynamic memory allocations and very low stack requirements (median: 32 bytes, max: 128 bytes), making it suitable for microcontrollers.
- Easy Integration: Implemented as a single
.cfile per set of operations; adding a single file to your project is sufficient for use. - Portable: Written in standard C99. Supports Linux, *BSD, MacOS, Windows, and the Arduino IDE.
- Secure Randomness: Capable of generating cryptographically-secure random numbers even on constrained hardware like Arduino boards.
- Resilient: Designed to mitigate accidental misuse even on systems with unreliable PRGs or no clock.
Non-goals
- Providing multiple primitives for the same purpose.
- Networking (though a Noise-based key exchange API is available).
- Interoperability with other libraries.
- Replacing libsodium (libhydrogen prioritizes minimal API surface and code size).