#password-hashing #hashing #password #password-hash

no-std password-auth

Password authentication library with a focus on simplicity and ease-of-use, including support for Argon2, PBKDF2, and scrypt password hashing algorithms

6 releases (1 stable)

1.1.0-pre.0 Feb 8, 2024
1.0.0 Sep 4, 2023
0.3.0 Jun 25, 2023
0.2.0 Jun 24, 2023
0.0.0 Nov 13, 2022

#918 in Authentication

Download history 357/week @ 2024-01-03 341/week @ 2024-01-10 486/week @ 2024-01-17 789/week @ 2024-01-24 682/week @ 2024-01-31 1222/week @ 2024-02-07 988/week @ 2024-02-14 1204/week @ 2024-02-21 1274/week @ 2024-02-28 1415/week @ 2024-03-06 1012/week @ 2024-03-13 1231/week @ 2024-03-20 1168/week @ 2024-03-27 1053/week @ 2024-04-03 1248/week @ 2024-04-10 965/week @ 2024-04-17

4,678 downloads per month
Used in 3 crates

MIT/Apache

86KB
1.5K SLoC

RustCrypto: Password Authentication

crate Docs Build Status Apache2/MIT licensed Rust Version Project Chat

Password authentication library with a focus on simplicity and ease-of-use, with support for Argon2, PBKDF2, and scrypt password hashing algorithms.

Documentation

About

password-auth is a high-level password authentication library with a simple interface which eliminates as much complexity and user choice as possible.

It wraps pure Rust implementations of multiple password hashing algorithms maintained by the RustCrypto organization, with the goal of providing a stable interface while allowing the password hashing algorithm implementations to evolve at a faster pace.

Usage

The core API consists of two functions:

  • generate_hash: generates a password hash from the provided password. The
  • verify_password: verifies the provided password against a password hash, returning an error if the password is incorrect.

Behind the scenes the crate uses the multi-algorithm support in the password-hash crate to support multiple password hashing algorithms simultaneously. By default it supports Argon2 (using the latest OWASP recommended parameters 8), but it can also optionally support PBKDF2 and scrypt by enabling crate features.

When multiple algorithms are enabled, it will still default to Argon2 for generate_hash, but will be able to verify password hashes from PBKDF2 and scrypt as well, if you have them in your password database.

Minimum Supported Rust Version

Rust 1.65 or higher.

Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump.

SemVer Policy

  • All on-by-default features of this library are covered by SemVer
  • MSRV is considered exempt from SemVer as noted above

License

Licensed under either of:

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0.6–1.1MB
~23K SLoC