Type alias Pbkdf2DeriveKeyParams

Pbkdf2DeriveKeyParams: {
    hash: "SHA-256" | "SHA-384" | "SHA-512";
    iterations: number;
    length: number;
    password: Uint8Array;
    salt: Uint8Array;
}

The object that should be passed into Pbkdf2.deriveKey(), when using the PBKDF2 algorithm.

Type declaration

  • hash: "SHA-256" | "SHA-384" | "SHA-512"

    A string representing the digest algorithm to use. This may be one of:

    • 'SHA-256'
    • 'SHA-384'
    • 'SHA-512'
  • iterations: number

    A Number representing the number of iterations the hash function will be executed in deriveKey(). This impacts the computational cost of the deriveKey() operation, making it more resistant to dictionary attacks. The higher the number, the more secure, but also slower, the operation. Choose a value that balances security needs and performance for your application.

  • length: number

    The desired length of the derived key in bits. To be compatible with all browsers, the number should be a multiple of 8.

  • password: Uint8Array

    The password from which to derive the key, represented as a Uint8Array.

  • salt: Uint8Array

    The salt value to use in the derivation process, as a Uint8Array. This should be a random or pseudo-random value of at least 16 bytes. Unlike the password, salt does not need to be kept secret.