Function crypto_wasi::scrypt
source · pub fn scrypt(
password: impl AsRef<[u8]>,
salt: impl AsRef<[u8]>,
n: usize,
r: usize,
p: usize,
keylen: usize
) -> Result<Vec<u8>, CryptoErrno>
Expand description
Provides a synchronous scrypt implementation.
Scrypt is a password-based key derivation function that is designed to be expensive computationally and memory-wise in order to make brute-force attacks unrewarding.
The salt
should be as unique as possible.
It is recommended that a salt is random and at least 16 bytes long.
See NIST SP 800-132 for details.
When passing strings for password
or salt
,
please consider caveats when using strings as inputs to cryptographic APIs.