Guest User

decrypt

a guest
Aug 26th, 2012
400
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void decrypt(LPBYTE data, DWORD size, LPSTR key, DWORD algo)
  2. {
  3.     HCRYPTPROV hProv;
  4.     CryptAcquireContext(&hProv, 0, 0, PROV_RSA_AES, CRYPT_VERIFYCONTEXT);
  5.  
  6.     HCRYPTHASH hHash;
  7.  
  8.     CryptCreateHash(hProv, CALG_MD5, 0, 0, &hHash);
  9.     CryptHashData(hHash, (LPBYTE)key, strlen(key), CRYPT_USERDATA);
  10.    
  11.     HCRYPTKEY hkey;
  12.  
  13.     CryptDeriveKey(hProv, algo, hHash, CRYPT_EXPORTABLE , &hkey);
  14.  
  15.     CryptDecrypt(hkey, NULL, TRUE, 0, data, &size);
  16.  
  17.  
  18.     CryptDestroyHash(hHash);
  19.  
  20.     CryptReleaseContext(hProv, 0);
  21.  
  22. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×