Use sodium to generate random bytes

This commit is contained in:
Vishnu Mohandas 2020-09-28 23:06:04 +05:30
parent a089fd1e3b
commit a7944a3f93

View file

@ -151,11 +151,7 @@ class CryptoUtil {
}
static Uint8List getSecureRandomBytes({int length = 32}) {
return SecureRandom(length).bytes;
}
static String getSecureRandomString({int length = 32}) {
return SecureRandom(length).base64;
return Sodium.randombytesBuf(length);
}
static Uint8List scrypt(Uint8List plainText, Uint8List salt) {