encryptBytes method

Uint8List encryptBytes({
  1. required List<int> data,
  2. String? key,
  3. String? iv,
})

Implementation

Uint8List encryptBytes({
  required List<int> data,
  String? key,
  String? iv,
}) {
  iv ??= this.iv;
  key ??= this.key;
  final encrypter = Encrypter(AES(Key.fromUtf8(key)));
  return encrypter.encryptBytes(data, iv: IV.fromBase64(iv)).bytes;
}