google-site-verification: googlebaca44933768a824.html [C++]md5 checksum of a string - Old Royal Hack Forum

Announcement

Collapse
No announcement yet.

[C++]md5 checksum of a string

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [C++]md5 checksum of a string

    Code:
    char* __stdcall chksum_md5(char* stringforhash )
    {
        //msdn
        int di; 
        HCRYPTPROV Provider = 0;
        ::CryptAcquireContext(&Provider,NULL,MS_DEF_PROV,PROV_RSA_FULL,CRYPT_VERIFYCONTEXT);
    
        HCRYPTHASH Hash = 0;
        ::CryptCreateHash(Provider,CALG_MD5,0,0,&Hash);
        ::CryptHashData(Hash,(unsigned char*)stringforhash,strlen(stringforhash), 0);
    
        unsigned char digest2[16];
        unsigned long size = sizeof(digest2);
        ::CryptGetHashParam(Hash, HP_HASHVAL, digest2, &size, 0);
        ::CryptDestroyHash(Hash);
        ::CryptReleaseContext(Provider, 0);
    
        char* hex_output = new char[33];     
    
        for( di = 0;  di < 16;  di++ )
            ::sprintf(hex_output + di * 2,"%02x", digest2[di]);
    
        return hex_output;
    }






    gibs coins @
    1KatP9B8KG7mvcoFhdLGua1isG88nYZE8C

Working...
X