admin管理员组

文章数量:1536091

2024年1月16日发(作者:)

{ return (y ^ (x | ~z)); }inline void FF(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac){ a += F(b, c, d) + x + ac; a = rotate_left(a, s); a += b; }inline void GG(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac){ a += G(b, c, d) + x + ac; a = rotate_left(a, s); a += b; }inline void HH(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac){ a += H(b, c, d) + x + ac; a = rotate_left(a, s); a += b; }inline void II(uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac){ a += I(b, c, d) + x + ac; a = rotate_left(a, s); a += b; }static unsigned char PADDING[64] ={0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};#define S11 7#define S12 12#define S13 17#define S14 22#define S21 5#define S22 9#define S23 14#define S24 20#define S31 4#define S32 11#define S33 16#define S34 23#define S41 6#define S42 10#define S43 15#define S44 21char* Prin真美妙5(uchar md5Digest[16]){char chBuffer[256];

char chEach[10];int nCount;memset(chBuffer,0,256);memset(chEach, 0, 10);for (nCount = 0; nCount < 16; nCount++){sprintf(chEach, "%02x", md5Digest[nCount]);strncat(chBuffer, chEach, sizeof(chEach));}return strdup(chBuffer);}char* MD5String(char* szString){Init();int nLen = strlen(szString);Update((unsigned char*)szString, (unsigned int)nLen);Finalize();return Prin真美妙5(Digest());}char* MD5File(char* szFilename){FILE* file;int nLen;unsigned char chBuffer[1024];try{memset(chBuffer, 0, 1024);if ((file = fopen (szFilename, "rb")) != NULL){while (nLen = fread (chBuffer, 1, 1024, file))Update(chBuffer, nLen);Finalize();fclose (file);return Prin真美妙5(Digest());

}}catch(...){}return NULL; // failed}void Init()

本文标签: 加密算法代码语言C语言