encryptBytes abstract method

Future<Uint8List> encryptBytes({
  1. required Uint8List plainBytes,
  2. required String key,
  3. String? iv,
})

Encrypts plainBytes and returns [16-byte IV][ciphertext].

When iv is provided it is used as the IV; otherwise a random IV is generated. The IV is always prepended to the returned bytes so that decryptBytes can reconstruct it without out-of-band information.

Implementation

Future<Uint8List> encryptBytes({required Uint8List plainBytes, required String key, String? iv});