混淆纯c语言实现md5算法(MD5 algorithm implemented in pure C language)

c md5  时间:2021-01-27  阅读:()

纯c语言实现md5算法MD5 algorithm implemented in pure Cl anguage

Here' s the code

Baidu needs points. I upload an integral that doesn't need anintegral.

/ / pure to delete this comment can be confused with.#include<stdio.h>

#define F (x, y, z) (( (x) & (y) ) | ( (~x) & (z)))

#define G (x, y, z) (( (x) & (z) ) | ( (y) & (~z)))

#define H (x, y, z) ((x) ^ (y) ^ (z) )

#define I (x, y, z) ((y) ^ ( (x) | (~z)) )

/ / pure to delete this comment can be confused with.#define RL (x, y) (((x) , (y) ( | ) (x) "(32 - (y)) )) //x y leftshift

#def ine PP (x) (x<<24) | ((x<<8) &0xff0000) | ((x>>8) &0xff00)| (x>>24) / / x high and low swap, such as PP (aabbccdd)=ddccbbaa

#def ine FF (a, B, C, D, x, s, AC) a = B + (RL ((a + F (B, C,d) + X + AC) , s) )

#def ine GG (a, B, C, D, x, s, AC) a = B + (RL ((a + G (B, C,d) + X + AC) , s) )

#def ine HH (a, B, C, D, x, s, AC) a = B + (RL ((a + H (B, C,d) + X + AC) , s) )

#define II (a, B, C, D, x, s, AC) a = B + (RL ((a + I (B, C,d) + X + AC) , s) )

Unsigned A, B, C, D, a, B, C, D, I, len, flen[2], x[16] ; //itemporary variable, len file length, flen[2] is 64 bit binaryrepresentation of the initial length of the file

Char filename[200] ; / / f ile name

FILE *fp;

/ / pure to delete this comment can be confused with.Void MD5 () {//MD5 core algorithm for the 64 round

A=A, b=B, c=C, d=D;

/**//* Round * 1

FF (a, B, C, D, x[, 0] , 7, 0xd76aa478) ; /**//* 1.

FF (D, a, B, C, x[, 1] , 12, 0xe8c7b756) ; /**//* 2.

FF (C, D, a, B, x[, 2] , 17, 0x242070db) ; /**//* 3.

FF (B, C, D, a, x[, 3] , 22, 0xc1bdceee) ; /**//* 4.FF (a, B, C, D, x[, 4] , 7, 0xf57c0faf) ; /**//* 5.FF (D, a, B, C, x[, 5] , 12, 0x4787c62a) ; /**//* 6.FF (C, D, a, B, x[, 6] , 17, 0xa8304613) ; /**//* 7.FF (B, C, D, a, x[, 7] , 22, 0xf d469501) ; /**//* 8.FF (a, B, C, D, x[, 8] , 7, 0x698098d8) ; /**//* 9.FF (D, a, B, C, x[, 9] , 12, 0x8b44f7af) ; /**//* 10.FF (C, D, a, B, x[10], 17, 0xffff5bb1) ; /**//* 11.FF (B, C, D, a, x[11], 22, 0x895cd7be) ; /**//* 12.FF (a, B, C, D, x[12], 7, 0x6b901122) ; /**//* 13.FF (D, a, B, C, x[13], 12, 0xfd987193) ; /**//* 14.FF (C, D, a, B, x[14], 17, 0xa679438e) ; /**//* 15.FF (B, C, D, a, x[15], 22, 0x49b40821) ; /**//* 16./**//* Round * 2

GG (a, B, C, D, x[, 1] , 5, 0xf61e2562) ; /**//* 17.

GG (D, a, B, C, x[, 6] , 9, 0xc040b340) ; /**//* 18.

GG (C, D, a, B, x[11], 14, 0x265e5a51) ; /**//* 19.

GG (B, C, D, a, x[, 0] , 20, 0xe9b6c7aa) ; /**//* 20.

GG (a, B, C, D, x[, 5] , 5, 0xd62f105d) ; /**//* 21.

GG (D, a, B, C, x[10], 9, 0x02441453) ; /**//* 22.

GG (C, D, a, B, x[15], 14, 0xd8a1e681) ; /**//* 23.

GG (B, C, D, a, x[, 4] , 20, 0xe7d3fbc8) ; /**//* 24.

GG (a, B, C, D, x[9], 5) ,

0x21e1cde6) ; / * * / / * * / 25

GG (D, a, B, C, X [14] , 9, 0xc33707d6) ; / * * / / * 26 * /GG (C, D, a, B, X [3], 14, 0xf4d50d87) ; / * * / / * 27 * /GG (B, C, D, a, X [8] , 20, 0x455a14ed) ; / * * / / * * / 28GG (A, B, C, D, X [13] , 5, 0xa9e3e905) ; / * * / / * * / 29GG (D, a, B, C, X [2], 9, 0xfcefa3f8) ; / * * / / * * / 30GG (C, D, a, B, X [7], 14, 0x676f02d9) ; / * * / / * * / 31GG (B, C, D, a, X [12] , 20, 0x8d2a4c8a) ; / * * / / * * / 32

/ * * / / * * / Round 3

Hh (A, B, C, D, X [4, 5], 0xfffa3942) ; / * * / / * 33 * /Hh (D, a, B, C, X [8], 11, 0x8771f681) ; / * * / / * 34 * /Hh (C, D, a, B, X [11] , 16, 0x6d9d6122) ; / * * / / * 35 * /Hh (B, C, D, a, x] [14, 23, 0xfde5380c) ; / * * / / * 36 * /Hh (A, B, C, D, X [1], 4, 0xa4beea44) ; / * * / / * * / 37Hh (D, a, B, C, X [4], 11, 0x4bdecfa9) ; / * * / / * 38 * /Hh (C, D, a, B, X [7], 16, 0xf6bb4b60) ; / * * / / * * / 39Hh (B, C, D, a, X [10] , 23, 0xbebfbc70) ; / * * / / * 40 * /Hh (A, B, C, D, X [13] , 4, 0x289b7ec6) ; / * * / / * * / 41Hh (D, a, B, C, X [0], 11, 0xeaa127fa) ; / * * / / * * / 42Hh (C, D, a, B, X [3], 16, 0xd4ef3085) ; / * * / / * * / 43Hh (B, C, D, a, x] [6, 23, 0x04881d05) ; / * * / / * * / 44Hh (A, B, C, D, X [9], 4, 0xd9d4d039) ; / * * / / * 45 * /Hh (D, a, B, C, X [11, 12], 0xe6db99e5) ; / * * / / * 46 * /

Hh (C, D, a, B, x] [15, 16, 0x1fa27cf8) ; / * * / / * 47 * /Hh (B, C, D, a, X [2], 23, 0xc4ac5665) ; / * * / / * * / 48/ /纯是为了混淆用,删除本注释即可

/ * * / / * * / 4 round

I I (A, B, C, D, X [0], 6, 0xf4292244) ; / * * / / * * / 49I I (D, a, B, C, x] [7, 10, 0x432aff97) ; / * * / / * 50 * /II (C, D, a, B, X [14] , 15, 0xab9423a7) ; / * * / / * * / 51(B, C, D, a, X [5], 21, 0xfc93a039) ; / * * / / * 52 * /II (A, B, C, D, X [12] , 6, 0x655b59c3) ; / * * / / * * /II (D, a, B, C, X [3], 10, 0x8f0ccc92) ; / * * / / * * / 54II (C, D, a, B, X [10] , 15, 0xffeff47d) ; / * * / / * 55 * /(B, C, D, a, X [1], 21, 0x85845dd1) ; / * * / / * * / 56II (A, B, C, D, X [8], 6, 0x6fa87e4f) ; / * * / / * * / 57II (D, a, B, C, X [15] , 10, 0xfe2ce6e0) ; / * * / / * * / 58I I (C, D, a, B, X [6], 15, 0xa3014314) ; / * * / / * * / 59(B, C, D, a, X [13] , 21, 0x4e0811a1) ; / * * / / * 60 * /

II (A, B, C, D, X [4], 6, 0xf7537e82) ; / * * / / * * / 61I I (D, a, B, C, X [10, 11], 0xbd3af235) ; / * * / / * 62 * /II (C, D, a, B, X [2], 15, 0x2ad7d2bb) ; / * * / / * * / 63(B, C, D, a, x] [9, 21, 0xeb86d391) ; / * * / / * * / 64A + = a;

B + = B;

C + = C;

D = D +;

/ /纯是为了混淆用,删除本注释即可

}

/ /纯是为了混淆用,删除本注释即可

/ /纯是为了混淆用,删除本注释即可

Main() {

While (1) {// pure to confuse, the notes can be deletedPrintf ("Input file:") ;

Gets (filename) ; // get function, avoid scanf segmentation inspace data,

If (filename[0]==34) f ilename[strlen (filename) -1]=0, strcpy(filename, f ilename+1) ; / / support file drag, but will morethan double quotes, here is the double quotes excess

If (! StrCmp (f ilename, exit)) exit (0) ; / / input exit exit(if! (fp=fopen (filename, RB))) {printf ("Can not open thisfile \n!") ; continue; } / / in binary file open

Fseek (FP, 0, SEEK_END) ; // the file pointer to the end of thefile

If ( (len=ftell (FP)) ==-1) {printf ("Sorry! Can not calculatefiles which larger than 2 GB! \n") ; Fclose (FP) ; continue; }//ftell function returns long, the maximum is 2GB, beyond thereturn -1

Rewind (FP) ; / / reset the file pointer to the file headerA=0x67452301, B=0xefcdab89, C=0x98badcfe, D=0x10325476; / /initialize link variables.

Flen[1]=len/0x20000000; //flen unit is bit

Flen[0]= (len%0x20000000) *8;

Memset (x, 0,64) ; / / initialize the X array for the 0

FREAD (&x, 4, 16, FP) ; / / to 4 bytes for a group, read 16 setsof data

For (i=0; i<len/64; i++) {// cycle operation until the end ofthe file

(MD 5) ;

Memset (x, 0,64) ;

F REA D (&x, 4, 16, FP) ;

}

( (char*) x [len%64]=128) ; // end of file 1, 0, 128 or 10000000binary

If (len%64>55) MD5 () , memset (x, 0,64) ;

Memcpy (x+14, flen, 8) ; // the end of the file is added to theoriginal file length bit

(MD 5) ;

Fclose (FP) ;

Printf ("MD5 Code:%08x%08x%08x%08x\n", PP (A) , PP (B) , PP (C) ,PP (D)) ; / / high and low output resistance

}

Contabo美国独立日促销,独立服7月€3.99/月

Contabo自4月份在新加坡增设数据中心以后,这才短短的过去不到3个月,现在同时新增了美国纽约和西雅图数据中心。可见Contabo加速了全球布局,目前可选的数据中心包括:德国本土、美国东部(纽约)、美国西部(西雅图)、美国中部(圣路易斯)和亚洲的新加坡数据中心。为了庆祝美国独立日和新增数据中心,自7月4日开始,购买美国地区的VPS、VDS和独立服务器均免设置费。Contabo是德国的老牌服务商,...

企鹅小屋:垃圾服务商有跑路风险,站长注意转移备份数据!

企鹅小屋:垃圾服务商有跑路风险!企鹅不允许你二次工单的,二次提交工单直接关服务器,再严重就封号,意思是你提交工单要小心,别因为提交工单被干了账号!前段时间,就有站长说企鹅小屋要跑路了,站长不太相信,本站平台已经为企鹅小屋推荐了几千元的业绩,CPS返利达182.67CNY。然后,站长通过企鹅小屋后台申请提现,提现申请至今已经有20几天,企鹅小屋也没有转账。然后,搞笑的一幕出现了:平台账号登录不上提示...

Stablehost 美国主机商黑五虚拟主机四折

如今我们网友可能较多的会选择云服务器、VPS主机,对于虚拟主机的话可能很多人不会选择。但是我们有些外贸业务用途的建站项目还是会有选择虚拟主机的。今天看到的Stablehost 商家虚拟主机在黑五期间也有四折优惠,对于这个服务商而言不是特别的喜欢,虽然他们商家和我们熟悉的老鹰主机商有些类似,且在后来老鹰主机改版和方案后,Stablehost 商家也会跟随改版,但是性价比认为不如老鹰主机。这次黑色星期...

c md5为你推荐
软银支付雅虎在05年就被阿里巴巴收购了,为什么现在又会出现马云收回支付宝产权,雅虎和软银不高兴的情况呢?聚酯纤维和棉哪个好聚酯纤维面料和纯棉面料哪个好免费阅读小说app哪个好想看小说有什么好用的app推荐?朱祁钰和朱祁镇哪个好大家怎么看明英宗和明代宗ps软件哪个好怎么ps啊,哪个软件好网页传奇哪个好玩有什么好玩的传奇类网页游戏?电动牙刷哪个好电动牙刷和普通牙刷哪个好,有何区别?清理手机垃圾软件哪个好什么手机清理软件最好?美国国际东西方大学你知道美国哪些大学有预科课程吗360云盘网页版最近360云盘网页版登陆后,找不到文件共享群了。哪位知道在哪里可以进去文件共享群?
ftp空间 冰山互联 便宜服务器 外贸主机 webhostingpad lighttpd 国外网站代理服务器 165邮箱 合租空间 umax120 服务器维护 免费个人主页 网站加速 香港ip 聚惠网 九零网络 cpu使用率过高怎么办 so域名 neicun 9929 更多