Expand description
§RustCrypto: yescrypt
Pure Rust implementation of the yescrypt password-based key derivation function.
§⚠️ Security Warning
The implementation contained in this crate has never been independently audited!
USE AT YOUR OWN RISK!
Note that this crate is in an early stage of implementation and may contain bugs or features which do not work correctly, potentially resulting in miscomputed outputs which do not match the ones produced by the reference implementation.
We suggest before using yescrypt params other than Params::default
to ensure that password hashes
produced by this crate match the ones produced by the reference implementation.
§Minimum Supported Rust Version (MSRV) Policy
MSRV increases are not considered breaking changes and can happen in patch releases.
The crate MSRV accounts for all supported targets and crate feature combinations, excluding explicitly unstable features.
§License
Licensed under either of:
-Apache License, Version 2.0 -MIT license
at your option.
§Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
§Usage
§Password Hashing
NOTE: the simple
crate feature must be enabled (on-by-default)
let password = b"pleaseletmein"; // don't actually use this as a password!
let salt = b"WZaPV7LSUEKMo34."; // unique per password, ideally 16-bytes and random
let password_hash = yescrypt::yescrypt(password, salt, &Default::default())?;
assert_eq!(&password_hash[..3], "$y$");
§Key Derivation Function (KDF)
let password = b"pleaseletmein"; // don't actually use this as a password!
let salt = b"WZaPV7LSUEKMo34."; // unique per password, ideally 16-bytes and random
let mut output = [0u8; 32]; // can be sized as desired
yescrypt::yescrypt_kdf(password, salt, &Default::default(), &mut output)?;
Structs§
- Error
- Error type.
- Flags
- Flags for controlling the operation of
yescrypt
. - Params
yescrypt
algorithm parameters.
Functions§
- yescrypt
simple
- yescrypt password hashing function.
- yescrypt_
kdf - yescrypt Key Derivation Function (KDF)
Type Aliases§
- Result
- Result type for the
yescrypt
crate.