#hash #password #argon2 #hashing #argon

argon_hash_password

Helper functions for common argon2 password hashing requirements

3 releases

0.1.2 Jan 21, 2023
0.1.1 Jan 21, 2023
0.1.0 Dec 22, 2022

#1086 in Cryptography

Download history 14/week @ 2023-01-26 15/week @ 2023-02-02 10/week @ 2023-02-09 16/week @ 2023-02-16 4/week @ 2023-02-23 23/week @ 2023-03-02 12/week @ 2023-03-09 12/week @ 2023-03-16 34/week @ 2023-03-23 16/week @ 2023-03-30 23/week @ 2023-04-06 3/week @ 2023-04-13 16/week @ 2023-04-20 18/week @ 2023-04-27 18/week @ 2023-05-04 35/week @ 2023-05-11

87 downloads per month
Used in ecrypt

Custom license

6KB
99 lines

Argon Hash Password

Helper functions for common argon2 password hashing requirements

Create a hashed password with salt

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

The hash and salt can then be stored

Check a Hash

let check = argon_hash_password::check_password_matches("PlaintextPassword", hash, salt);

match check {
  true => println!("Correct plaintext password provided"),
  false => println!("Incorrect plaintext password provided"),
}

lib.rs:

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"),
}

Dependencies

~1MB
~19K SLoC