aes256EncryptBytesAsStream method

Future<Stream<List<int>>> aes256EncryptBytesAsStream({
  1. required FlutterAesGcm algorithm,
  2. required String rawKey,
  3. required int rawKeyLength,
  4. required Stream<List<int>> data,
})

Implementation

Future<Stream<List<int>>> aes256EncryptBytesAsStream({
  required FlutterAesGcm algorithm,
  required String rawKey,
  required int rawKeyLength,
  required Stream<List<int>> data,
}) async {

  final secretKey = await _deriveKey(rawKey, rawKeyLength, [], 5);
  final encryptedStream = await algorithm.encryptStream(
      data,
      secretKey: secretKey,
      nonce: [],
      onMac: (mac){}
  );
  return encryptedStream;
}