I read Dan Rollins excellent article "Easy String Encryption Using CryptoAPI in C++":
I got the class to compile and run no problem. But in my application it encrypts the string, but will not decrypt. The CryptoAPI function CryptDecrypt fails with error NTE_BAD_LEN. I tried increasing the output buffer size to a much larger value, but then it simply returns an incorrect decryption of the input string. I have even tried just passing simple char and LPCSTR values to it, and it is no-go.
I am thinking this might be an issue with unicode, but I admit that I am a bit lost. Any help would be appreciated.