encryptBytes static method

Uint8List encryptBytes(
  1. Uint8List byteData,
  2. String textKey
)

Implementation

static Uint8List encryptBytes(
  Uint8List byteData,
  String textKey,
) {
  final encryptionPassword = _getModifiedPasswordFrom(textKey.safeSubString(0, 4)!);
  final iv = IV.fromUtf8(_getModifiedIvPasswordFrom(textKey));
  final encrypter = Encrypter(AES(Key.fromUtf8(encryptionPassword), mode: AESMode.cbc));

  return (encrypter.encryptBytes(byteData, iv: iv).bytes);
}