maloriopolium
asked on
Encrypting a CString
Hi,
I want to be able to encrypt a CString. Since I am doing some application programming in MFC, I would like to use the CryptEncrypt() function. Can somebody show me how to use this function? The example in MSDN deals with encrpyting a file, but I need to just encrypt a string.
I don't need the encryption to be very complicated, just reasonably secure.
Thanks.
I want to be able to encrypt a CString. Since I am doing some application programming in MFC, I would like to use the CryptEncrypt() function. Can somebody show me how to use this function? The example in MSDN deals with encrpyting a file, but I need to just encrypt a string.
I don't need the encryption to be very complicated, just reasonably secure.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks mahesh,
The codeproject link looks like what I need to figure out how to use the CryptEncrypt function.
The codeproject link looks like what I need to figure out how to use the CryptEncrypt function.
char szTemp[256];
int nIdx;
strcpy(szTemp, "INDIA");
nIdx = 0;
while (szTemp[nIdx] != 0)
{
szTemp[nIdx] ^= 21;
nIdx++;
}
MessageBox ( szTemp);;