Download MetaTrader 5

how to decrypt the "AES128" data in mql4 called by JAVA

To add comments, please log in or register
ehongyao123
81
ehongyao123  

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)); 

 


Alain Verleyen
Moderator
35125
Alain Verleyen  
Seems ok to me, the problem is probably in your Java code.
ehongyao123
81
ehongyao123  
Alain Verleyen:
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. 

Alain Verleyen
Moderator
35125
Alain Verleyen  
ehongyao123:

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. 

This is a forum about mql4/mql5, not Java.
To add comments, please log in or register