encrypbody method

Map<String, String> encrypbody(
  1. dynamic bodystr
)

Implementation

Map<String, String> encrypbody(bodystr) {
  final key = Key.fromUtf8(genH().substring(0, 32));
  final iv = IV.fromUtf8(genH().substring(0, 16));
  final encrypter = Encrypter(AES(key, mode: AESMode.cbc));
  final encrypted = encrypter.encrypt(bodystr, iv: iv);
  var result = {"encrypData": encrypted.base64};
  // print(result);
  return result;
}