pbkdf2DeriveKey static method

List<int> pbkdf2DeriveKey({
  1. required List<int> password,
  2. required List<int> salt,
  3. required int iterations,
  4. HashFunc? hash,
  5. int? dklen,
})

Derive a key from a password using PBKDF2 algorithm

Implementation

static List<int> pbkdf2DeriveKey(
    {required List<int> password,
    required List<int> salt,
    required int iterations,
    HashFunc? hash,
    int? dklen}) {
  final hashing = (hash ?? () => SHA512());

  return PBKDF2.deriveKey(
      mac: () => HMAC(hashing, password),
      salt: salt,
      iterations: iterations,
      length: dklen ?? hashing().getDigestLength);
}