deriveKey static method
Creates an derived key from a secret
, salt
, iterations
, keylen
and
hmacLength
.
Implementation
static Uint8List deriveKey(String secret, List<int> salt,
{int iterations = defaultIterations,
int keylen = defaultKeyLength,
hmacLength = 64}) {
var derivator = PBKDF2KeyDerivator(HMac(SHA256Digest(), hmacLength))
..init(Pbkdf2Parameters(Uint8List.fromList(salt), iterations, keylen));
return derivator.process(Uint8List.fromList(secret.codeUnits));
}