argon2

A pure-Rust implementation of the Argon2 password hashing function

Library
Cargo
v0.6.0
915 stars
MIT OR Apache-2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
57 /100 Fair
Development Activity 64
Maintenance 16
Community 60
Maturity 60
Momentum 28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
81 /100 Excellent
Architecture 85
Code Quality 88
Innovation 80
Learning Curve 70

argon2 is a pure-Rust implementation of Argon2, the memory-hard password hashing function that won the Password Hashing Competition in 2015. It implements all three algorithmic variants — Argon2d (GPU-cracking resistant), Argon2i (side-channel resistant), and Argon2id (the recommended hybrid default) — and integrates with the RustCrypto password-hash crate for PHC string encoding/decoding and trait-based password verification.

The crate is part of the RustCrypto password-hashes workspace, which also houses PBKDF2, scrypt, bcrypt-pbkdf, Balloon hashing, SHA-crypt, and yescrypt implementations sharing a common PasswordVerifier/PasswordHash (PHC string) interface. It supports no_std environments (including without alloc), making it usable in embedded targets as well as standard server-side authentication code.

What You Get

  • All three Argon2 variants (Argon2d, Argon2i, and the default Argon2id hybrid)
  • Optional integration with the password-hash crate for PHC string encoding/parsing and a common PasswordVerifier trait shared with pbkdf2, scrypt, and other RustCrypto hashers
  • no_std support, including alloc-free configurations for embedded/constrained targets
  • Optional parallel feature (via rayon) for multi-threaded hashing and a zeroize feature for secure memory wiping of sensitive buffers
  • Configurable Params for memory cost, time cost, and parallelism tuning per OWASP recommendations

Common Use Cases

  • Hashing and verifying user passwords for authentication in a Rust web service or CLI tool
  • Building a multi-algorithm password verifier that can check hashes produced by Argon2, PBKDF2, or scrypt against a single PHC-format string
  • Deriving encryption keys from a low-entropy passphrase (e.g. for at-rest file/database encryption) using Argon2’s memory-hard KDF properties
  • Embedded or constrained targets that need password/key hashing without a standard allocator (no_std, no-alloc builds)

Under The Hood

Architecture: The crate is organized around algorithm.rs (Argon2 core: block filling, mixing, and the d/i/id variant dispatch), block.rs (the 1KB Argon2 memory block type and operations over it), memory.rs (the working-memory matrix the algorithm iterates over), blake2b_long.rs (the variable-output Blake2b hash used internally by Argon2), params.rs (memory/time/parallelism cost parameters and validation), and error.rs/version.rs; lib.rs ties these into the public Argon2 struct implementing the optional password-hash crate’s PasswordHasher/PasswordVerifier traits. Tech Stack: Rust 2024 edition (MSRV 1.85), no_std-first with alloc as an additive feature; depends on base64ct (constant-time base64 for PHC strings) and blake2 for the internal hash primitive, with optional rayon (parallel feature) and zeroize (secure memory wiping) as opt-in features. Code Quality: Ships an extensive [lints.clippy]/[lints.rust] block enforcing missing_docs, unwrap_used warnings, cast-safety lints, and undocumented-unsafe-block checks — a notably strict lint posture for a security-sensitive crate — plus a tests/ directory with known-answer vectors; CI badges reference a dedicated argon2.yml workflow. API Design: The crate offers both a minimal low-level API (Argon2::new(...).hash_password(...)) and, through the shared password-hash trait objects, a pluggable multi-algorithm verifier pattern (as shown in the repo’s own README) that lets callers check a PHC hash string against Argon2, PBKDF2, or scrypt without knowing in advance which algorithm produced it — a deliberate ergonomic win for migrating between hashing schemes.

Used by 16 apps in this directory

Rust
98%

Stalwart

Collaboration

15,268

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
88
Repo Health
81
Technical
65
Dependency
Built with
Rust 98%
Updated 1 weeks ago
Rust
98%

Stalwart

Collaboration

15,268

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
88
Repo Health
81
Technical
65
Dependency
Built with
Rust 98%
Updated 1 weeks ago
Rust
98%

Stalwart

Collaboration

15,268

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
88
Repo Health
81
Technical
65
Dependency
Built with
Rust 98%
Updated 1 weeks ago
Rust
93%
Other

Tabby

AI Code Assistants

33,924

Self-hosted AI coding assistant — run GitHub Copilot-grade code completion on your own hardware with no cloud dependency.

View details
55
Repo Health
78
Technical
61
Dependency
Built with
Rust 93%
Updated 4 months ago
TypeScript
67%
Apache 2.0

tabularis

Databases · Developer Tools

5,270

Open-source desktop SQL workspace with built-in PostgreSQL, MySQL, and SQLite drivers, SQL notebooks, a visual query builder, and a built-in MCP server for AI agents like Claude and Cursor.

View details
84
Repo Health
89
Technical
66
Dependency
Built with
TypeScript 67%
Rust 31%
Updated 5 days ago
Rust
66%
Apache 2.0

Temps

Analytics · Devops · Monitoring

865

A self-hosted Rust PaaS that replaces Vercel, Sentry, PostHog, Pingdom, Resend, and E2B with one binary — plus 440+ CLI operations agents like Claude Code can drive directly.

View details
81
Repo Health
86
Technical
66
Dependency
Built with
Rust 66%
TypeScript 33%
Updated 6 days ago
Rust
83%
AGPL 3.0

Vaultwarden

Password Manager · Security

69,556

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
89
Repo Health
69
Technical
69
Dependency
Built with
Rust 83%
Updated 1 weeks 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