encryptWithBytes function
加密 对list进行加密,keyList是加密用的key
Implementation
List<int> encryptWithBytes(List<int> list, List<int> keyList) {
final Key key = Key(Uint8List.fromList(keyList));
Encrypter encrypter = Encrypter(AES(key, mode: AESMode.ecb, padding: null));
final encrypted = encrypter.encryptBytes(list);
// print(encrypted.bytes);
print('加密结果:' + int2basse16(encrypted.bytes));
return encrypted.bytes;
}