Module devolutions_crypto::password_hash
source · Expand description
Module for password hashing and verification. Use this if you need to store user passwords.
You can use this module to hash a password and validate it afterward. This is the recommended way to verify a user password on login.
use devolutions_crypto::password_hash::{hash_password, PasswordHashVersion};
let password = b"somesuperstrongpa$$w0rd!";
let hashed_password = hash_password(password, 10000, PasswordHashVersion::Latest);
assert!(hashed_password.verify_password(b"somesuperstrongpa$$w0rd!"));
assert!(!hashed_password.verify_password(b"someweakpa$$w0rd!"));
Re-exports
pub use super::PasswordHashVersion;
Structs
- A versionned password hash. Can be used to validate a password without storing the password.
Functions
- Creates a
PasswordHash
containing the password verifier.