Crate argon_hash_password

Crate argon_hash_password 

Source
Expand description

Functions for creating hashed passwords with salt using argon2

§Create a hashed password with salt

let (hash, salt) = argon_hash_password::create_hash_and_salt("PlaintextPassword").unwrap();

The hash and salt can then be stored

§Check a Hash

let check = argon_hash_password::check_password_matches_hash("PlaintextPassword", hash, salt).unwrap();
match check {
    true => println!("Correct plaintext password provided"),
    false => println!("Incorrect plaintext password provided"),
}

Functions§

check_password_matches_hash
Check that password and salt matches generated hash
create_hash_and_salt
Given a plaintext password return a password hash and a generated salt
gen_session_id
Generate a secure 128-bit session ID of alphanumeric characters
hash_and_verify
Given a plaintext password and a SaltString, return the hash of the password
parse_saltstring
verify_password_len
Verify that the password matches a certain length and the confirmation password provided