StringToCharArray(_tohash,src);
should be
StringToCharArray(_tohash,src,0,StringLen(_tohash));
and you have an error :
string _saltkey = "1234"; string _tohash = "my message to be encrypted"+_mysaltkey;
Alain Verleyen:
Thanks a lot Alain. It does now work perfectly !
should be
and you have an error :

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello, i got a string to encode into SHA-256. For this, i'm using the CryptEncode function with my string converted to char array.
I do not need to encrypt this array with any key, as the key is already hand crafted into this string (this is something i cant change).
Example :
where :
I dont understand why my hashed result returned by :
is different from using an online hash online utility like this :
I think it may have something to deal with the "key" in CryptEncode function, so is there a way to use it without any key while not altering the result, which has to be the same as an online PHP generator.
I would appreciate any help, as i am really stuck right now :'( Thanks !