Technical details
Technical details
class StrongKey extends Key {
StrongKey.fromPassPhrase(String passPhrase) : super.fromUtf8(passPhrase);
Key secureStretch(Uint8List salt) {
return stretch(256, iterationCount: 100000, salt: salt);
}
@override
Key stretch(int desiredKeyLength, {int iterationCount = 100, Uint8List salt}) {
final params = Pbkdf2Parameters(salt, iterationCount, desiredKeyLength);
final pbkdf2 = PBKDF2KeyDerivator(Mac('SHA-512/HMAC'))..init(params);
return Key(pbkdf2.process(bytes));
}
static Uint8List get generateSalt => SecureRandom(256).bytes;
}Last updated
Was this helpful?