aesEncoded static method

String aesEncoded(
  1. String content,
  2. String secKey
)

aes加密函数

Implementation

static String aesEncoded(String content,String secKey) {

  //加密key
  final key = encrypt.Key.fromUtf8(secKey);
  //偏移量
  final iv = encrypt.IV.fromUtf8(_iv);
  //ecb
  final encrypter = encrypt.Encrypter(
      encrypt.AES(key, mode: encrypt.AESMode.ecb, padding: 'PKCS7'));
  //加密
  final encrypted = encrypter.encrypt(content, iv: iv);
  return encrypted.base64;

}