how to decrypt the "AES128" data in mql4 called by JAVA
Seems ok to me, the problem is probably in your Java code.
Alain Verleyen:
Seems ok to me, the problem is probably in your Java code.
Seems ok to me, the problem is probably in your Java code.
Please help me , can you show me your java code, i want to use the AES128 between on MQL4 and JAVA.
thank you very much.
ehongyao123:
This is a forum about mql4/mql5, not Java.
Please help me , can you show me your java code, i want to use the AES128 between on MQL4 and JAVA.
thank you very much.
used CryptEncode Base64 can be decode in JAVA.
but i used AES128 encode the string "1234", key is "1234567812345678". then to hex, the result is: N0tfT8tiE0k+KDDzEOoRxA== but this result can not be decrypt in java. please help me~!
the code is:
string text="1234";
string keystr="1234567812345678";
uchar src[],dst[],key[];
//--- prepare key
StringToCharArray(keystr,key);
StringToCharArray(text, src);
uchar rs[];
CryptEncode(CRYPT_AES128, src, key, dst);
CryptEncode(CRYPT_BASE64, dst, key, rs);
PrintFormat("Initial data: size=%d, string='%s'",ArraySize(rs),CharArrayToString(rs));