Function botan::derive_key_from_password

source ·
pub fn derive_key_from_password(
    algo: &str,
    out_len: usize,
    passphrase: &str,
    salt: &[u8],
    param1: usize,
    param2: usize,
    param3: usize,
) -> Result<Vec<u8>>
Expand description

Password based key derivation function

§Examples

let mut rng = botan::RandomNumberGenerator::new().unwrap();
let salt = rng.read(10).unwrap();
let key = botan::derive_key_from_password("Scrypt", 32, "passphrase", &salt, 8192, 8, 1).unwrap();
assert_eq!(key.len(), 32);