generateEncryptionKey static method

Uint8List generateEncryptionKey()

Implementation

static Uint8List generateEncryptionKey() {
  final keyLength = 32; // 256 bits
  final secureRandom = Random.secure();
  final List<int> randomBytes = List<int>.generate(keyLength, (_) => secureRandom.nextInt(256));
  return Uint8List.fromList(randomBytes);
}