decrypt256Str function

String decrypt256Str(
  1. String fullResponse
)

Implementation

String decrypt256Str(String fullResponse){

  String ivFromResponse = fullResponse.substring(0, 16);
  String encryptedResponse = fullResponse.substring(16);

  final key = encrypt.Key.fromUtf8("5PbpCqeioHQ3MWj6dJVeluXDE7UttN8P");
  final iv = encrypt.IV.fromUtf8(ivFromResponse);
  //final encrypter = encrypt.Encrypter(encrypt.AES(key,mode:encrypt.AESMode.cbc));
  final encrypter = encrypt.Encrypter(encrypt.AES(key, mode: encrypt.AESMode.cbc)); //, padding: 'PKCS7'

  final encrypted = encrypt.Encrypted.fromBase64(encryptedResponse);
  final decrypted = encrypter.decrypt(encrypted, iv: iv);

  return decrypted;
}