• Stars
    star
    564
  • Rank 75,996 (Top 2 %)
  • Language
    C
  • License
    Other
  • Created over 7 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A lightweight, secure, easy-to-use crypto library suitable for constrained environments.

Build status CodeQL scan Financial Contributors on Open Collective Coverity Scan Build Status TrustInSoft CI

libhydrogen

The Hydrogen library is a small, easy-to-use, hard-to-misuse cryptographic library.

Features:

  • Consistent high-level API, inspired by libsodium. Instead of low-level primitives, it exposes simple functions to solve common problems that cryptography can solve.
  • 100% built using just two cryptographic building blocks: the Curve25519 elliptic curve, and the Gimli permutation.
  • Small and easy to audit. Implemented as one tiny file for every set of operation, and adding a single .c file to your project is all it takes to use libhydrogen in your project.
  • The whole code is released under a single, very liberal license (ISC).
  • Zero dynamic memory allocations and low stack requirements (median: 32 bytes, max: 128 bytes). This makes it usable in constrained environments such as microcontrollers.
  • Portable: written in standard C99. Supports Linux, *BSD, MacOS, Windows, and the Arduino IDE out of the box.
  • Can generate cryptographically-secure random numbers, even on Arduino boards.
  • Attempts to mitigate the implications of accidental misuse, even on systems with an unreliable PRG and/or no clock.

Non-goals:

  • Having multiple primitives serving the same purpose, even to provide compatibility with other libraries.
  • Networking -- but a simple key exchange API based on the Noise protocol is available, and a STROBE-based transport API will be implemented.
  • Interoperability with other libraries.
  • Replacing libsodium. Libhydrogen tries to keep the number of APIs and the code size down to a minimum.

The documentation is maintained in the libhydrogen wiki.

The legacy libhydrogen code (leveraging XChaCha20, SipHashX, BLAKE2SX, Curve25519) remains available in the v0 branch.

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

More Repositories

1

libsodium

A modern, portable, easy to use crypto library.
C
11,796
star
2

dsvpn

A Dead Simple VPN.
C
5,068
star
3

piknik

Copy/paste anything over the network.
Go
2,342
star
4

minisign

A dead simple tool to sign files and verify digital signatures.
C
1,856
star
5

libsodium.js

libsodium compiled to Webassembly and pure JavaScript, with convenient wrappers.
HTML
899
star
6

pure-ftpd

Pure FTP server
C
589
star
7

libsodium-php

The PHP extension for libsodium.
C
546
star
8

swift-sodium

Safe and easy to use crypto for iOS and macOS
C
507
star
9

edgedns

A high performance DNS cache designed for Content Delivery Networks
Rust
490
star
10

libpuzzle

A library to quickly find visually similar images
C
262
star
11

iptoasn-webservice

Web service to map IP addresses to AS information, using iptoasn.com
Rust
254
star
12

dnsblast

A simple and stupid load testing tool for DNS resolvers
C
233
star
13

as-wasi

An AssemblyScript API layer for WASI system calls.
TypeScript
232
star
14

wasm-crypto

A WebAssembly (via AssemblyScript) set of cryptographic primitives for building authentication and key exchange protocols.
TypeScript
214
star
15

rust-jwt-simple

A secure, standard-conformant, easy to use JWT implementation for Rust.
Rust
204
star
16

rust-bloom-filter

A fast Bloom filter implementation in Rust
Rust
187
star
17

encpipe

The dum^H^H^Hsimplest encryption tool in the world.
C
182
star
18

Pincaster

A fast persistent nosql database with a HTTP/JSON interface, not only for geographical data.
C
171
star
19

blacknurse

BlackNurse attack PoC
C
170
star
20

libsodium-doc

Gitbook documentation for libsodium
Shell
164
star
21

UCarp

UCARP allows a couple of hosts to share common virtual IP addresses in order to provide automatic failover. It is a portable userland implementation of the secure and patent-free Common Address Redundancy Protocol (CARP, OpenBSD's alternative to the patents-bloated VRRP).
M4
164
star
22

bitbar-dnscrypt-proxy-switcher

BitBar plugin to control dnscrypt-proxy usage
Shell
148
star
23

charm

A really tiny crypto library.
C
148
star
24

witx-codegen

WITX code and documentation generator for AssemblyScript, Zig, Rust and more.
Rust
127
star
25

siphash-js

A Javascript implementation of SipHash-2-4
JavaScript
122
star
26

rust-ed25519-compact

Small, wasm-friendly, zero-dependencies Ed25519 and X25519 implementation for Rust.
Rust
118
star
27

rsign2

A command-line tool to sign files and verify signatures in pure Rust.
Rust
112
star
28

go-minisign

Minisign verification library for Golang.
Go
103
star
29

rust-nats

A simple NATS client library for Rust
Rust
102
star
30

was-not-wasm

A hostile memory allocator to make WebAssembly applications more predictable.
Rust
81
star
31

webassembly-benchmarks

Libsodium WebAssembly benchmarks results.
79
star
32

zigly

The easiest way to write services for Fastly's Compute@Edge in Zig.
Zig
78
star
33

rust-minisign

A pure Rust implementation of the Minisign signature tool.
Rust
78
star
34

zig-charm

A Zig version of the Charm crypto library.
Zig
73
star
35

rust-sthash

Very fast cryptographic hashing for large messages.
Rust
65
star
36

vtun

A mirror of VTUN, with some changes
C
63
star
37

iptrap

A simple, but damn fast sinkhole
Rust
62
star
38

openssl-wasm

OpenSSL 3 compiled for WebAssembly/WASI (up-to-date, maintained)
C
58
star
39

rust-ffmpeg-wasi

ffmpeg libraries precompiled for WebAsembly/WASI, as a Rust crate.
Rust
57
star
40

libsodium-signcryption

Signcryption using libsodium.
C
57
star
41

wasmsign

A tool to add and verify digital signatures to/from WASM binaries
Rust
56
star
42

boringssl-wasm

BoringSSL for WebAssembly/WASI
Zig
56
star
43

blobcrypt

Authenticated encryption for streams and arbitrary large files using libsodium
C
54
star
44

rust-coarsetime

Time and duration crate optimized for speed
Rust
52
star
45

rust-siphash

SipHash (2-4, 1-3 + 128 bit variant) implementations for Rust
Rust
48
star
46

6Jack

A framework for analyzing/testing/fuzzing network applications.
C
46
star
47

rust-hyperloglog

A HyperLogLog implementation in Rust.
Rust
46
star
48

zig-minisign

Minisign reimplemented in Zig.
Zig
45
star
49

libchloride

Networking layer for libsodium, based on CurveCP
C
44
star
50

rust-qptrie

A qp-trie implementation in Rust
Rust
42
star
51

minicsv

A tiny, fast, simple, single-file, BSD-licensed CSV parsing library in C.
C
39
star
52

libaegis

Portable C implementations of the AEGIS family of high-performance authenticated encryption algorithms.
C
38
star
53

spake2-ee

A SPAKE2+ Elligator Edition implementation for libsodium 1.0.16+
C
36
star
54

massresolver

Mass DNS resolution tool
C
36
star
55

rust-privdrop

A simple Rust crate to drop privileges
Rust
34
star
56

PureDB

PureDB is a portable and tiny set of libraries for creating and reading constant databases.
C
33
star
57

cpace

A CPace PAKE implementation using libsodium.
C
32
star
58

libclang_rt.builtins-wasm32.a

The missing libclang_rt.builtins-wasm32.a file to compile to WebAssembly.
32
star
59

c-ipcrypt

ipcrypt implementation in C
C
31
star
60

aegis-X

The AEGIS-128X and AEGIS-256X high performance ciphers.
Zig
30
star
61

rust-dnsclient

A simple and secure DNS client crate for Rust.
Rust
29
star
62

fastly-terrarium-examples

Example code you can run in Fastly Terrarium: https://www.fastlylabs.com/
C
28
star
63

rust-xoodyak

Xoodyak, a lightweight and versatile cryptographic scheme implemented in Rust.
Rust
28
star
64

rust-geoip

GeoIP bindings for Rust
Rust
28
star
65

rust-minisign-verify

A small Rust crate to verify Minisign signatures.
Rust
27
star
66

libsodium-xchacha20-siv

Deterministic/nonce-reuse resistant authenticated encryption scheme using XChaCha20, implemented on libsodium.
C
27
star
67

whatsmyresolver

A tiny DNS server that returns the client (resolver) IP
Go
26
star
68

libsodium-sys-stable

Sodiumoxide's libsodium-sys crate, but that installs stable versions of libsodium.
Rust
26
star
69

spritz

A C implementation of Spritz, a spongy RC4-like stream cipher and hash function.
C
25
star
70

metrohash-c

C version of the MetroHash function
C
25
star
71

rust-hmac-sha256

A small, self-contained SHA256 and HMAC-SHA256 implementation.
Rust
25
star
72

rust-clockpro-cache

CLOCK-Pro cache replacement algorithm for Rust
Rust
24
star
73

rust-blind-rsa-signatures

RSA blind signatures in Rust
Rust
24
star
74

PHP-OAuth2-Provider

Skyrock OAuth2 server
PHP
23
star
75

openssl-family-bench

A quick benchmark of {Open,Libre,Boring}SSL
C
23
star
76

dnssector

A DNS library for Rust.
Rust
23
star
77

system-tuning-for-crypto

System tuning recommendations for running cryptographic applications
23
star
78

hashseq

A simple proof of work, mainly designed to mitigate DDoS attacks.
C
23
star
79

rust-cpace

A Rust implementation of CPace, a balanced PAKE.
Rust
23
star
80

rust-aegis

AEGIS cipher for Rust.
Rust
22
star
81

randen-rng

A port of the Google Randen fast backtracking-resistant random generator to the C language.
C
21
star
82

Blogbench

A filesystem benchmark tool that simulates a realistic load
C
21
star
83

vue-dnsstamp

DNS Stamp calculator component for VueJS
Vue
21
star
84

yaifo

YAIFO [remote OpenBSD installer] for OpenBSD-current
Shell
21
star
85

supercop

Always up-to-date mirror of the SUPERCOP cryptographic benchmark.
C
21
star
86

ratelimit

Plug-and-play IP rate limiter in C
C
21
star
87

draft-aegis-aead

The AEGIS cipher family - Draft.
20
star
88

go-hpke-compact

A small and easy to use HPKE implementation in Go.
Go
20
star
89

ipgrep

Extract, defang, resolve names and IPs from text
Python
20
star
90

Simple-Comet-Server

HTTP long-polling server and javascript client library.
Python
19
star
91

simpira384

An AES-based 384 bit permutation.
C
18
star
92

PHP-WebDAV-extension

The PHP WebDAV extension allows easy access to remote resources with PHP through the DAV protocol.
Shell
18
star
93

zig-rocca-s

An implementation of the ROCCA-S encryption scheme.
Zig
17
star
94

c-blind-rsa-signatures

Blind RSA signatures for OpenSSL/BoringSSL.
C
17
star
95

nonce-extension

Make AES-GCM safe to use with random nonces, for any practical number of messages.
Rust
16
star
96

rust-sealed_box

Sealed boxes implementation for Rust/WebAssembly.
Rust
16
star
97

zig-eddsa-key-blinding

A Zig implementation of EdDSA signatures with blind keys.
Zig
16
star
98

js-base64-ct

Safe Base64 encoding/decoding in pure JavaScript.
TypeScript
16
star
99

dlog

A super simple logger for Go. Supports stderr, logfiles, syslog and windows event log.
Go
16
star
100

aes-stream

A fast AES-PRF based secure random-number generator
C
15
star