Struct orion::pbkdf2::Pbkdf2 [] [src]

pub struct Pbkdf2 {
    pub password: Vec<u8>,
    pub salt: Vec<u8>,
    pub iterations: usize,
    pub length: usize,
    pub hmac: ShaVariantOption,
}

PBKDF2 (Password-Based Key Derivation Function 2) as specified in the RFC 8018.

Fields

Methods

impl Pbkdf2
[src]

PBKDF2 (Password-Based Key Derivation Function 2) as specified in the RFC 8018.

Usage examples:

Generating derived key:

use orion::pbkdf2::Pbkdf2;
use orion::util::gen_rand_key;
use orion::options::ShaVariantOption;

let password = gen_rand_key(16);
let salt = gen_rand_key(16);

let dk = Pbkdf2 {
    password: password,
    salt: salt,
    iterations: 10000,
    length: 64,
    hmac: ShaVariantOption::SHA512
};

dk.pbkdf2_compute();

[src]

PBKDF2 function. Return a derived key.

Trait Implementations

impl Drop for Pbkdf2
[src]

[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl Send for Pbkdf2

impl Sync for Pbkdf2