dandybandy:
wanted : encrypt a string using AES256 method, format the encrypted data into hexadecimal string, then decrypt it again using same key into the original string.
here's my try
which prints : 61CB5825C0A9B5BE56A3372F0A6EDF all ok.
now to decrypt (not from the dst char array above, but from the Encrypted string) :
I know the problem is when I format the dst array into Encrypted variable, I can't correctly revert it back to the char array before decryption.
how do I solve this problem ?
Instead of converting to a hex string, use CryptEncode to encode the result into base64.
This can be printed as string, and can be decided from base64 back, so you can go through without complex conversion.

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
wanted : encrypt a string using AES256 method, format the encrypted data into hexadecimal string, then decrypt it again using same key into the original string.
here's my try
which prints : 61CB5825C0A9B5BE56A3372F0A6EDF all ok.
now to decrypt (not from the dst char array above, but from the Encrypted string) :
I know the problem is when I format the dst array into Encrypted variable, I can't correctly revert it back to the char array before decryption.
how do I solve this problem ?