Expand description
§Pasta - Password Storage
Making passwords painless
This is a library designed to make secure password storage easy.
For a more comprehensive introduction, see the homepage
§Examples
The basic functionality for computing password hashes is:
extern crate libpasta;
// We re-export the rpassword crate for CLI password input.
use libpasta::rpassword::*;
fn main() {
let password = prompt_password_stdout("Please enter your password:").unwrap();
let password_hash = libpasta::hash_password(password);
println!("The stored password is: '{}'", password_hash);
}§Supported formats
libpasta attempts to support some legacy formats. For example, the bcrypt
format $2y$....
Re-exports§
pub use config::Config;
Modules§
- config
- Configuration
- errors
libpastaerrors.- hashing
- Password hashing functionality
- key
- The
keymodule is for managing key sources. - primitives
Primitiveinlibpastarefers to the raw hashing algorithms as implemented in many libraries.- rpassword
- Re-export rpassword for convenience.
- sod
- Module to define the Static or Dynamic
Sodenum.
Enums§
- Hash
Update - On migrating a hash with the password entered, we reach three possible states:
Functions§
- hash_
password - Generates a default hash for a given password.
- migrate_
hash - Migrate the input hash to the current recommended hash.
- verify_
password - Verifies the provided password matches the inputted hash string.
- verify_
password_ update_ hash - Verifies a supplied password against a previously computed password hash,
and performs an in-place update of the hash value if the password verifies.
Hence this needs to take a mutable
Stringreference.