Originally posted by: Dins
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.
ReplyOriginally posted by: fima
SetupCryptoClient is missing 2 calls
to CryptDestroyKey(hKey);
after each successful CryptGetUserKey.
This creates a memory leak...
Fima.
ReplyOriginally posted by: DevGuy
BOOL bSuccess = CryptAcquireContext(&hProv, NULL, MS_DEF_PROV, PROV_RSA_FULL,
if (!bSuccess)
// create a new context
if (!bSuccess)
if (!bSuccess)
CryptAcquireContext can fail in many ways, for example, when code is invoked by an ASP page. Here is the fix.
0);
bSuccess = CryptAcquireContext(&hProv, NULL, MS_DEF_PROV, PROV_RSA_FULL,
CRYPT_MACHINE_KEYSET);
{
bSuccess = CryptAcquireContext(&hProv, NULL, MS_DEF_PROV, PROV_RSA_FULL, CRYPT_NEWKEYSET);
}
{
bSuccess = CryptAcquireContext(&hProv, NULL, MS_DEF_PROV, PROV_RSA_FULL, CRYPT_NEWKEYSET|CRYPT_MACHINE_KEYSET);
}
Originally posted by: Joe
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.
Originally posted by: Quakey
Hi there,
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!
Originally posted by: PIALAT Richard
Due to French legislation and as expressed in CryptEncrypt function help, this function will fail with a NTE_PERM error code.
ReplyOriginally posted by: Marian Miulet
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.
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\Defaults\Provider\Microsoft Enhanced Cryptographic Provider v1.0]
"Image Path"="rsaenh.dll"
"Type"=dword:00000001
"Signature"=hex:5e,50,ac,2d,eb,1e,54,68,b0,bc,c7,ec,86,40,8d,65,f7,2b,89,30,6a,\
b4,a7,8e,44,de,03,69,97,6e,84,ee,40,21,96,46,26,5a,0d,81,e5,88,fa,77,09,c9,\
64,1f,db,d5,98,d9,e9,ed,92,08,e8,89,40,47,2c,ab,a6,83,68,bc,f3,f0,4c,d7,07,\
52,1a,32,89,95,33,98,07,6b,d2,3f,cd,fa,db,a1,0e,f6,19,99,64,01,1f,ab,3c,ed,\
be,9e,36,92,74,ec,f4,a1,78,42,43,d3,8b,62,79,6f,f4,1d,18,7b,1b,11,04,4f,50,\
2e,e0,1b,a7,54,25,64,00,00,00,00,00,00,00,00
Originally posted by: Dmitry Semenov
I wonder, can it apply to PGP encryption system.
I have PGP installed on my machine.
Can I use CriptoApy with PGP key and all?
Originally posted by: Matt
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.
Thanks,
Matt Shumaker
mshumake@trsystems.com
Originally posted by: John Munsch
Trust me, I have programs that run on them.
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.