It would be easier to just decrypt dst[] (from which you made my_string), rather than try to decrypt my_string.
If you try to push my_string back into a uchar array using StringToCharArray() then run it through CryptDecode() you'll get an invalid array error code.
So, I'm not sure what the answer would be (other than stick to decrypting dst).
It would be easier to just decrypt dst[] (from which you made my_string), rather than try to decrypt my_string.
If you try to push my_string back into a uchar array using StringToCharArray() then run it through CryptDecode() you'll get an invalid array error code.
So, I'm not sure what the answer would be (other than stick to decrypting dst).
You defeat the purpose of encryption if you were able to simply convert Hex back to Binary. If you try to do that, you will lose the encryption rule built into dst[] so that the string would be useless. The function ArrayToHex() is there to show this gibberish binary data in human readable characters, and is nothing more than that. The only way to convert it to the original text is to decrypt dst[]. Why don't you simply save off dst[] to a file, and then decrypt it when you need it?
This was my goal: encoding some information into the my_string (for example expiration date, etc ..) and getting back this information for the program (expert, indi) from the my_string.
I give my_string to the user, he/she has to use it as an input for the program, and the program can check whether the using of it is valid or not.
I cannot give dst[] to the user. ;)
1./ Maybe I'm wrong, but I think hex string is my_string, isn't it? Remember >>
string my_string=ArrayToHex(dst);
2./ Anyway it is not good. I want encode expiration date into the hex string (my_string). So, I need to decode this date from the hex string (my_string) and the program examines this date for validation.
I understand and agree with these, but there is one thing:
You wrote this: "You need to build in some mechanism to save off dst[]"
This is not clear to me, how can I do this? What do you mean? Can you explain it? Thank you
Maybe, it is better for you to elaborate in detail what you are trying to accomplish with encryption and decryption.
Just as I wrote, I make a string that contains encoded expiration date. I give this string to the user who inputs this to the expert. Expert checks (decodes) this string for validation.
(With this method no need to hardcode the exp date into the code itself.)

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi Gurus!
Here is the mql example of using of CryptEncode/CryptDecode.
Based on that example, let's say:
string my_string=ArrayToHex(dst);
I'd like to get the original text string ("The quick brown ... ") from my_string.
How can I get it?
Thank you