ring

Safe, fast, small cryptographic primitives for Rust, built on verified assembly from BoringSSL

Library
Cargo
v0.17.14
4,104stars
Apache-2.0 AND ISC

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
72/100Good
Development Activity68
Maintenance40
Community80
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
80/100Excellent
Architecture85
Code Quality88
Innovation84
Learning Curve62

ring is a Rust cryptography library providing safe, fast implementations of the core primitives most applications actually need: AEAD encryption (AES-GCM, ChaCha20-Poly1305), digital signatures (Ed25519, ECDSA, RSA), key agreement (X25519, ECDH), HKDF, HMAC, PBKDF2, and cryptographically secure random number generation. Rather than reimplementing crypto from scratch, much of its performance-critical C and assembly code is derived from BoringSSL (itself a Google fork of OpenSSL), giving it the benefit of that code’s extensive scrutiny while wrapping it in a memory-safe, misuse-resistant Rust API.

Despite its README describing itself dismissively as “an experiment,” ring is foundational infrastructure in the Rust ecosystem: it underlies rustls (and therefore reqwest, hyper-rustls, and much of the modern Rust TLS stack), with over 625 million cumulative crates.io downloads and 4,000+ GitHub stars. Its narrow, curated set of algorithms is a deliberate design choice — it deliberately omits legacy or exotic primitives to reduce the attack surface exposed to API consumers.

What You Get

  • AEAD ciphers: AES-128/256-GCM and ChaCha20-Poly1305 for authenticated encryption
  • Digital signatures: Ed25519, ECDSA (P-256/P-384), and RSA (PKCS#1 and PSS) signing and verification
  • Key agreement: X25519 and ECDH over NIST curves
  • HKDF, HMAC, and PBKDF2 for key derivation and password-based key stretching
  • A cryptographically secure random number generator (SystemRandom) sourced from the OS
  • Hand-optimized assembly for x86, x86_64, ARM, and AArch64 targets for performance-critical paths

Common Use Cases

  • Implementing TLS via rustls, which uses ring as its default cryptography provider
  • Signing and verifying JWTs or other tokens with Ed25519 or ECDSA in a Rust backend service
  • Encrypting data at rest or in transit with AES-GCM or ChaCha20-Poly1305 without hand-rolling nonce handling
  • Deriving encryption keys from passwords or shared secrets via PBKDF2 or HKDF in authentication systems

Under The Hood

Architecture — ring’s src directory is organized by primitive: aead for authenticated encryption, digest for hash functions, ec and rsa for asymmetric key handling, hkdf.rs/hmac.rs/pbkdf2.rs for key derivation, and rand.rs for secure randomness, with a polyfill module smoothing over no_std and MSRV gaps. Underneath the safe Rust surface, performance-critical routines call into C and hand-written assembly (in crypto/ and per-architecture .S files) largely sourced from BoringSSL, glued together via bssl.rs and a custom build script (build/main.rs) that compiles and links the native code per target.

Tech Stack — Roughly even split between Assembly (46%) and Rust (42%), with a smaller C component (7%); requires Rust 1.85+ and targets no_std environments in addition to full std. The links = "ring_core_..." key in Cargo.toml and versioned symbol prefixing exist specifically to let multiple incompatible versions of ring coexist safely within one dependency tree — an unusual but deliberate mitigation against symbol collisions in native code.

Code Quality — Testing spans dedicated tests/ integration files plus 36 files with inline #[test] functions, backed by CAVP (Cryptographic Algorithm Validation Program) test vectors under cavp/ for validating primitive correctness against NIST-published vectors. A SIDE-CHANNELS.md document explicitly enumerates known limitations of the library’s side-channel mitigations rather than overselling its guarantees, and a documented security policy governs vulnerability reporting — both signs of a security-conscious engineering culture uncommon even among crypto libraries.

API Design — ring intentionally exposes a narrow surface: a handful of well-chosen algorithms per primitive category rather than the sprawling algorithm agility of libraries like OpenSSL, which reduces misuse but means it lacks some legacy or niche algorithms by design. The API favors explicit, hard-to-misuse types (e.g. distinct UnboundKey/LessSafeKey for AEAD) over generic byte-slice functions, pushing safety decisions into the type system at some cost to first-time ergonomics.

Used by 6 apps in this directory

Svelte
46%
MIT

Cryptgeon

File Storage · Security

1,506

Self-destructing encrypted notes and files that vanish after viewing — the server never sees your keys.

View details
80
Repo Health
80
Technical
74
Dependency
Built with
Svelte46%
TypeScript30%
Rust14%
Updated 1 months ago
Rust
87%
MIT

fabro

Developer Tools · Devops

1,516

Define AI agent workflows as code graphs, route tasks across any LLM, and intervene only where it matters.

View details
81
Repo Health
83
Technical
70
Dependency
Built with
Rust87%
TypeScript11%
Updated yesterday
Rust
72%
Other

iii

Developer Tools · Devops

18,604

Compose, extend, and observe every backend service in real time using three primitives: Workers, Functions, and Triggers.

View details
86
Repo Health
85
Technical
69
Dependency
Built with
Rust72%
TypeScript17%
Updated yesterday
Rust
77%
AGPL 3.0

Spacedrive

File Storage · Collaboration

38,790

One file manager for all your devices and clouds — powered by a Virtual Distributed File System built in Rust.

View details
60
Repo Health
84
Technical
65
Dependency
Built with
Rust77%
TypeScript20%
Updated 3 weeks ago
Rust
98%

Stalwart

Collaboration

14,255

All-in-one secure mail and collaboration server covering IMAP, JMAP, SMTP, CalDAV, CardDAV, and WebDAV in a single memory-safe Rust binary.

View details
89
Repo Health
81
Technical
68
Dependency
Built with
Rust98%
Updated yesterday
Rust
83%
AGPL 3.0

Vaultwarden

Password Manager · Security

65,652

Unofficial Bitwarden-compatible server in Rust — run the full Bitwarden ecosystem on a Raspberry Pi using every official client you already have, without the multi-container overhead.

View details
83
Repo Health
69
Technical
80
Dependency
Built with
Rust83%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search