Function botan::pbkdf[][src]

pub fn pbkdf(
    algo: &str,
    out_len: usize,
    passphrase: &str,
    salt: &[u8],
    iterations: usize
) -> Result<Vec<u8>>

Password based key derivation function

Note currently only PBKDF2 is supported by this interface. For PBKDF2, iterations >= 100000 is recommended.

Examples

let rng = botan::RandomNumberGenerator::new().unwrap();
let salt = rng.read(10).unwrap();
let key = botan::pbkdf("PBKDF2(SHA-256)", 32, "passphrase", &salt, 10000).unwrap();
assert_eq!(key.len(), 32);