decode static method

String decode(
  1. dynamic cipherText
)

Implementation

static String decode(cipherText) {
  try {
    final key = Key.fromUtf8(Dox().config.appKey);
    final iv = IV.fromLength(16);
    final encrypter = Encrypter(AES(key));
    final decrypted = encrypter.decrypt64(cipherText, iv: iv);
    return utf8.decode(base64.decode(decrypted));
  } catch (error) {
    print(error);
    return '';
  }
}