everything wincrypt object I declare returns a compile error in VC++... ONCE i removed the LEAN define from my stdafx.h file and it compiled but then the next time I wanted to use it it was back to the same crap and editting the afx file did nothing.
I try to use CryptoAPI for Windows (MFC) application,
however, I got compile errors ( w98/w2000, vc6),
" CryptoDoc.cpp(263) : error 065: 'CryptAcquireContext' : undeclared identifier ". If anyone knew the solution,
please give me a help.
I tried this CryptoAPI and it works perfectly. However,
since I save the encrypted data to a file and read it back
at a later time, an EOF in the data would totally cripple
the fil i/o involved in reading the data. So how do I
avoid the EOF in encrypted data?? Thanks!
CryptoAPI works fine with Win95 and Win98 as soon as you have IE3 or later.
For 128 bits you need a special patch from Microsoft that can be installed only if IE is already installed.
Another way for CryptoAPI 128 bits is a little work done in the registry but you need rsaenh.dll (in system directory) that is available only in USA and Canada.
Hope this helps.
Is there any chance that the encrypted string would include a NULL character?
In this code this is not a problem, as the call to egQueryValueEx() would return the size of the data.
However, NULL characters would be a problem if the encrypted string was stored in a string (as I am doing). When I go to read this string for decrypting, I would miss data if there was a NULL character.
I know a way around this - just store the length of the encrypted string - but I do not want to do this unless I have to.
You just need to install IE 4.0 or above and it will install
the required APIs. IE uses the Crypto API to do it's own
40 bit or 128 bit encryption. The version of IE you install
(the high security version, or low security downloadable
from everywhere version) determines which version of the
Crypto API will be installed.