Click here to Skip to main content
15,912,457 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Delete History of Internet? Pin
Abbas_Riazi29-Jan-03 22:08
professionalAbbas_Riazi29-Jan-03 22:08 
AnswerRe: Delete History of Internet? Pin
Rohit  Sinha30-Jan-03 1:51
Rohit  Sinha30-Jan-03 1:51 
GeneralRe: Delete History of Internet? Pin
xxhimanshu30-Jan-03 2:02
xxhimanshu30-Jan-03 2:02 
GeneralEncryption/Decryption Pin
Zaid Ansari29-Jan-03 19:28
Zaid Ansari29-Jan-03 19:28 
GeneralRe: Encryption/Decryption Pin
karl_w29-Jan-03 21:39
karl_w29-Jan-03 21:39 
GeneralRe: Encryption/Decryption Pin
Zaid Ansari29-Jan-03 22:03
Zaid Ansari29-Jan-03 22:03 
GeneralRe: Encryption/Decryption Pin
Zaid Ansari29-Jan-03 22:05
Zaid Ansari29-Jan-03 22:05 
GeneralRe: Encryption/Decryption Pin
karl_w30-Jan-03 0:08
karl_w30-Jan-03 0:08 
It's not DES, but it uses the Windows-CryptAPI.
On the other hand I'm quite sure there is a class outside in the wild which provides DES-encryption.

	<br />
HCRYPTPROV hCryptProv;<br />
HCRYPTKEY hKey;<br />
HCRYPTHASH hHash;<br />
<br />
if ( !CryptAcquireContext(&hCryptProv, NULL , NULL, PROV_RSA_FULL,  0))<br />
    AfxMessageBox("Error Acquire");<br />
<br />
if ( !CryptCreateHash(hCryptProv, CALG_MD5, 0, 0, &hHash))<br />
    AfxMessageBox("Error CreateHash");<br />
<br />
if ( !CryptHashData(hHash, (BYTE*) "YourKey", (DWORD)strlen("YourKey"), 0))<br />
    AfxMessageBox("Error Hashing");<br />
<br />
if ( !CryptDeriveKey(hCryptProv, CALG_RC4, hHash, 0, &hKey))<br />
    AfxMessageBox("Error Derive Key");<br />
<br />
BYTE* buf; //The thing you want to encrypt<br />
DWORD size = (DWORD)strlen((char*)buf);<br />
     <br />
CryptEncrypt(hKey, NULL, TRUE, 0, (BYTE*)buf, &size, size);<br />
<br />
CryptDecrypt(hKey, NULL, TRUE, 0, (BYTE*)buf, &size)<br />
<br />


This works fine for me. It's not a high-security app, so i hardcoded the encryption-key in the code. I simply took the Class-Name as key.

Hope I could help.

--

karl
GeneralRe: Encryption/Decryption Pin
Zaid Ansari30-Jan-03 0:46
Zaid Ansari30-Jan-03 0:46 
GeneralRe: Encryption/Decryption Pin
Zaid Ansari3-Feb-03 5:02
Zaid Ansari3-Feb-03 5:02 
GeneralRe: Encryption/Decryption Pin
karl_w3-Feb-03 6:28
karl_w3-Feb-03 6:28 
GeneralRe: Encryption/Decryption Pin
Zaid Ansari3-Feb-03 20:19
Zaid Ansari3-Feb-03 20:19 
GeneralPrecision of double type Pin
paulb29-Jan-03 19:12
paulb29-Jan-03 19:12 
GeneralRe: Precision of double type Pin
Chris Richardson29-Jan-03 19:49
Chris Richardson29-Jan-03 19:49 
GeneralSetting Bitmap Background for CProgressCtrl Pin
Effiniti29-Jan-03 18:09
Effiniti29-Jan-03 18:09 
GeneralRe: Setting Bitmap Background for CProgressCtrl Pin
Abbas_Riazi29-Jan-03 22:12
professionalAbbas_Riazi29-Jan-03 22:12 
GeneralVisual C++ terms and agreements Pin
moraalg29-Jan-03 16:52
moraalg29-Jan-03 16:52 
GeneralRe: Visual C++ terms and agreements Pin
Christian Graus29-Jan-03 18:09
protectorChristian Graus29-Jan-03 18:09 
Generalspecial .lnk files Pin
Hervorzaubern29-Jan-03 14:01
Hervorzaubern29-Jan-03 14:01 
GeneralRe: special .lnk files Pin
Chris Losinger29-Jan-03 14:19
professionalChris Losinger29-Jan-03 14:19 
GeneralRe: special .lnk files Pin
30-Jan-03 5:41
suss30-Jan-03 5:41 
GeneralRe: special .lnk files Pin
Hervorzaubern30-Jan-03 5:42
Hervorzaubern30-Jan-03 5:42 
Generalclistctrl in report mode: make the header not clickable. Pin
trustno129-Jan-03 14:01
trustno129-Jan-03 14:01 
GeneralRe: clistctrl in report mode: make the header not clickable. Pin
Michael Dunn29-Jan-03 14:51
sitebuilderMichael Dunn29-Jan-03 14:51 
GeneralLAN connection test Pin
Paul M Watt29-Jan-03 13:35
mentorPaul M Watt29-Jan-03 13:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.