main2 function
void
main2()
Implementation
void main2() {
// final plainText = '01010112345600FFFFFFFFFFFFFFFFFF';
final plainText = [
0x01,
0x01,
0x01,
0x12,
0x34,
0x56,
0x00,
0xFF,
0xFF,
0xFF,
0xFF,
0xFF,
0xFF,
0xFF,
0xFF,
0xFF
];
// final plainText = 0x01010112345600FFFFFFFFFFFFFFFFFF.toRadixString(16);
// final key = Key.fromUtf8('C60A52C6F23E3BF23B523E0A523E0AF2');
Uint8List l = Uint8List.fromList([
0xC6,
0x0A,
0x52,
0xC6,
0xF2,
0x3E,
0x3B,
0xF2,
0x3B,
0x52,
0x3E,
0x0A,
0x52,
0x3E,
0x0A,
0xF2
]);
final Key key = Key(l);
// final iv = IV.fromLength(16);
// final iv = IV.allZerosOfLength(0);
final encrypter = Encrypter(AES(key, mode: AESMode.ecb, padding: null));
// Encrypted
// final encrypted = encrypter.encrypt(plainText, iv: iv);
// final decrypted = encrypter.decrypt(encrypted, iv: iv);
// final encrypted = encrypter.encrypt(plainText);
// final encrypted = encrypter.encryptBytes(plainText);
// final decrypted = encrypter.decrypt(encrypted);
// final decrypted = encrypter.decryptBytes(encrypted);
final encrypted = Encrypted(Uint8List.fromList([
97,
92,
248,
53,
81,
130,
111,
80,
93,
246,
119,
214,
158,
51,
227,
236
]));
final decrypted = encrypter.decryptBytes(encrypted);
print('decrypted');
// print(decrypted);
// print(encrypted.base64);
// print(encrypted.base16);
// print(encrypted.bytes);
}