Я хочу преобразовать ниже FLEX код в Android / Java
Код:
var cbc:CBCMode = new CBCMode(new AESKey(keyByteArray), Crypto.getPad("pkcs5"));
cbc.IV = Hex.toArray(ivHex);
var msgByteArray:ByteArray = new ByteArray();
msgByteArray = Hex.toArray(encHex);
cbc.decrypt(msgByteArray);
Android:
SecretKeySpe c skey = new SecretKeySpe c (byteArray, "AES");
// Cipher ci = Cipher.getInstance("AES/CBC/PKCS5Padding");
/* ci.init(DECRYPT_MODE, skey, new IvParameterSpec(Hex.decode(first16BitResult)));
byte[] decrypted = ci.doFinal(Hex.decode(after16BitResult));
showLog(Arrays.toString(decrypted));*/
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
// cipher.init (DECRYPT_MODE, skey, новый IvParameterSpe c (Hex.decode (after16BitResult)) );
// InflaterInputStream inflaterStream =new InflaterInputStream(new CipherInputStream(new ByteArrayInputStream(Hex.decode(first16BitResult)), cipher));
// return IOUtils.toByteArray(inflaterStream);