The pure-Rust password hashing library running on Argon2.
The pure-Rust password hashing library running on Argon2.
This is a purely Rust-based library that provides both variants of the state-of-the-art Argon2 hashing algorithm, suitable for password hashing and password-based key derivation.
Via cargo:
$ cd $PROJECT_ROOT
$ cargo install --features "simd"From git:
$ git clone https://github.com/bryant/argon2rs $ARGON_DIR && cd $ARGON_DIR
$ cargo build --features "simd"From examples/helloworld.rs:
extern crate argon2rs;
pub fn main() {
let (password, salt) = ("argon2i!", "delicious salt");
println!("argon2i_simple(\"{}\", \"{}\"):", password, salt);
for byte in argon2rs::argon2i_simple(&password, &salt).iter() {
print!("{:02x}", byte);
}
println!("");
}outputs:
argon2i_simple("argon2i!", "delicious salt"):
e254b28d820f26706a19309f1888cefd5d48d91384f35dc2e3fe75c3a8f665a6There are two variants of Argon2 that differ in the manner by which reference indices are computed during block-filling rounds. Argon2d does this in a faster but data-dependent fashion that could be vulnerable to side-channel attacks, whereas Argon2i ("i" denoting independence from plaintext input) works slower but is immune to such attacks and is therefore the preferred choice for password hashing.
MatrixBlock, Matrix.Our primary benchmarks are single- and multi-threaded runs of Argon2i with default parameters against the reference implementation. In order to compile and run this, first pull in the C sources:
$ git submodule init
$ git submodule update benches/cargon/phc-winner-argon2and then benchmark with Cargo as usual:
…"Argon2: The Memory-Hard Function for Password Hashing and Other Applications"
No open issues yet, or sync has not completed.