FAQ
Frequently asked questions
Short answers first; each links to the page with the detail where there is one.
What is hsh?
hsh is a free, open-source password hashing library for Rust. It hashes passwords with Argon2id, bcrypt, scrypt or PBKDF2 under one policy, stores them as PHC strings, and rehashes old ones as users sign in. See the features.
Is hsh quantum-resistant?
hsh does not claim to be. It uses the established password-hashing functions Argon2id, bcrypt, scrypt and PBKDF2. The old version of this site said otherwise; that claim was not supported.
Which algorithm should I use?
Argon2id, the default in Policy::owasp_minimum_2025(). Use PBKDF2 if you need FIPS 140-3, and bcrypt or scrypt to keep compatibility with existing systems. See the algorithms.
Do I have to migrate existing hashes in a batch?
No. verify_and_upgrade verifies existing bcrypt, scrypt, PBKDF2 and Argon2 hashes, and returns a new hash under your policy when a user signs in, which you save. See the migration guide.
Is hsh FIPS 140-3 validated?
No. With the fips feature, a FIPS policy hashes with PBKDF2 inside the AWS-LC FIPS module through aws-lc-rs; the validation belongs to that module. Without the feature, a FIPS policy refuses to hash. See the FIPS mode.
Can the pepper live in a cloud KMS?
Not yet. The AWS, Google Cloud, Azure and HashiCorp Vault providers are stubs in 0.0.10. LocalPepper, which keeps the keys in your process, works today.
Why does a long bcrypt password fail?
bcrypt only reads 72 bytes. Rather than hash a truncated password, hsh rejects it, unless you turn on pre-hashing in the bcrypt parameters.
Does it work without the standard library?
No. hsh needs std for the operating system's random-number generator.
Why is crates.io at 0.0.10 when the repository says 0.0.12?
The 0.0.12 release workflow failed, so the hsh library and hsh-cli were not published at 0.0.12, while hsh-kms and hsh-digest were. Use 0.0.10 of all four.
What does it cost, and under which licence?
Nothing. hsh is free software under the Apache License 2.0 or the MIT licence, at your option.