decryptAES256 method

Future<String> decryptAES256({
  1. required String cipherText,
  2. String? key,
})

Implementation

Future<String> decryptAES256({
  required String cipherText,
  String? key,
}) async {
  try {
    final String keyword = key ?? WaterbusSdk.privateMessageKey;

    if (keyword.isEmpty) return cipherText;

    final String message = await Aes256Gcm.decrypt(cipherText, keyword);

    return message;
  } catch (e) {
    return cipherText;
  }
}