decrypt method

String decrypt({
  1. required String data_base64,
  2. String? newKey,
  3. String? iv,
})

Implementation

String decrypt({
  required String data_base64,
  String? newKey,
  String? iv,
}) {
  iv ??= defaultIv;
  newKey ??= defaultKey;

  final encrypter = Encrypter(
    AES(
      Key.fromUtf8(newKey),
      mode: AESMode.ctr,
    ),
  );

  return encrypter.decrypt64(data_base64, iv: IV.fromBase64(iv));
}