Skip to main content

Class: Pbkdf2

Implementation of the password based key derivation function 2.

Table of contents

Methods

Constructors

Methods

sha256

Static sha256(password, salt, iterations, keyLength): Uint8Array

Derive a key from the parameters using Sha256.

Parameters

NameTypeDescription
passwordUint8ArrayThe password to derive the key from.
saltUint8ArrayThe salt for the derivation.
iterationsnumberNumer of iterations to perform.
keyLengthnumberThe length of the key to derive.

Returns

Uint8Array

The derived key.


sha512

Static sha512(password, salt, iterations, keyLength): Uint8Array

Derive a key from the parameters using Sha512.

Parameters

NameTypeDescription
passwordUint8ArrayThe password to derive the key from.
saltUint8ArrayThe salt for the derivation.
iterationsnumberNumer of iterations to perform.
keyLengthnumberThe length of the key to derive.

Returns

Uint8Array

The derived key.

Constructors

constructor

new Pbkdf2()