Crate scrypt[][src]

This crate implements the Scrypt key derivation function as specified in [1].

If you are not using convinience functions scrypt_check and scrypt_simple it's recommended to disable scrypt default features in your Cargo.toml:

[dependencies]
scrypt = { version = "0.1", default-features = false }

Acknowledgments

This implementation is heavily based on rust-crypto's scrypt module.

References

[1] - C. Percival. Stronger Key Derivation Via Sequential Memory-Hard Functions

Modules

errors

Structs

ScryptParams

The Scrypt parameter values.

Functions

scrypt

The scrypt key derivation function.

scrypt_check

scrypt_check compares a password against the result of a previous call to scrypt_simple and returns Ok(()) if the passed in password hashes to the same value, Err(CheckError::HashMismatch) if hashes have different values, and Err(CheckError::InvalidFormat) if hashed_value has an invalid format.

scrypt_simple

scrypt_simple is a helper function that should be sufficient for the majority of cases where an application needs to use Scrypt to hash a password for storage. The result is a String that contains the parameters used as part of its encoding. The scrypt_check function may be used on a password to check if it is equal to a hashed value.