Function orion::default::pbkdf2
[−]
[src]
pub fn pbkdf2(
password: &[u8],
salt: &[u8]
) -> Result<Vec<u8>, UnknownCryptoError>
PBKDF2 with HMAC-SHA512. Uses 512000 iterations with an output length of 64 bytes.
Exceptions:
An exception will be thrown if:
- The length of the secret key is less than 64
Usage example:
use orion::default; use orion::util; // Salts are limited to being 64 in length here. let salt = util::gen_rand_key(64).unwrap(); let derived_password = default::pbkdf2("Secret password".as_bytes(), &salt);