talira

argon2 (RustCrypto)

Pure Rust implementation of the Argon2 password hashing function.

open sourceMIT OR Apache-2.0self-hostablefree

The argon2 crate from the RustCrypto project implements Argon2, the winner of the Password Hashing Competition and RFC 9106, in pure Rust: Argon2d, Argon2i and Argon2id (the default). It hashes and verifies passwords as PHC strings through the password-hash crate's traits, so stored hashes carry their algorithm and parameters, and it also derives raw keys from passwords. It works without the standard library (no_std), and can zero secrets in memory when they are dropped (the zeroize feature).

Problems it solves

  • hash user passwords in my Rust web app so a database leak doesn't expose them
  • store passwords with Argon2id instead of bcrypt or SHA-256 in a Rust server
  • verify a password against a stored PHC string like $argon2id$v=19$m=19456,t=2,p=1$...
  • derive an encryption key from a passphrase in Rust
  • a password hashing library in pure Rust with no C dependencies or OpenSSL
  • build email and password sign-in for a Loco or Axum app
  • hash passwords in a no_std or embedded Rust target

Features

  • Argon2d, Argon2i and Argon2id (default)
  • PHC string hashing and verification via the password-hash traits
  • raw key derivation (hash_password_into)
  • configurable memory, time and parallelism parameters
  • no_std support
  • optional zeroize of secrets
  • pure Rust, no C code

Capabilities

Has official SDKsplan not known