aesEncode static method

String aesEncode({
  1. required String content,
  2. required String key,
})

aes加密

Implementation

static String aesEncode({required String content, required String key}) {
  final secretKey = encrypt.Key.fromUtf8(key);
  final encrypter = encrypt.Encrypter(
    encrypt.AES(secretKey, mode: encrypt.AESMode.ecb),
  );
  final encrypted = encrypter.encrypt(content);

  return encrypted.base64;
}