List<int> key128bit=[
122,140,235,87,
10,140,37,178,
172,182,154,240,
211,126,138,11
];
List<int> encodeIV=[
0,0,0,0,
1,1,1,1,
2,2,2,2
];
String plaintext='a sample plaintext'; // utf-8 encoded in AesCrypt.encrypt()
AesCrypt encrypter=AesCrypt(
mode: ModeAES.gcm,
padding: PaddingAES.pkcs7, // Setting this to "none" results in an exception
key: base64.encode(key128bit)
);
String result=encrypter.encrypt(plaintext, iv: base64.encode(encodeIV));
dev.log("plain.length=${plaintext.length}");
dev.log("result.length=${base64.decode(result).length}");
dev.log(base64.decode(result).toString());
[log] plain.length=18
[log] result.length=32
[log] [57, 126, 210, 236, 146, 205, 233, 139, 16, 45, 193, 146, 164, 250, 98, 165, 147, 120, 153, 51, 116, 146, 11, 111, 218, 175, 8, 183, 211, 164, 245, 44]
Encrypting the same string (in utf-8) with the same key and the same IV in Firefox using subtle.crypto (but setting tag-length to 96 bits) results in the following byte sequence:
[ 57 126 210 236 146 205 233 139 16 45 193 146 164 250 98 165 147 120 73 255 75 137 95 252 156 90 215 157 98 122 ]
The sequences match for the first 18 bytes after which they diverge - if I understand it correctly, they should be identical (to the shortest length).
If I can provide any more information or help in any other way, just ask.