admin管理员组文章数量:1627950
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()
版权声明:本文标题:32位md5加密算法c语言,MD5加密算法代码(C语言) 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dianzi/1705400603a137026.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论