资源描述:
《des加密算法c语言实现-报告》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、DES加密算法C语言实现•报告DES加密算法C实现mac.c#include#include/**程序描述:力[1/解密公用函数*decrypt/encryptroutine**/#defineu_charunsignedcharvoidFDES(u_char*key,u_char*text,u_char*mtext);void_FDES(u_char*key,u_char*mtext,u_char*text);voidFcncryptO(u_char*tcxt,u_char*mtcxt);voidFdiscryptO(u_char*mte
2、xt,u_char*text);voidFexpandO(u_char*in,u_char*out);voidFcompressO(u_char*out,u_char*in);voidFcompress016(u_char*out,u_char*in);voidFsctkcystar(u_charbits[64]);t(dun).®s佝wsqt(dui「卄9]如JEqo_n}(]X3iiu*JBq9_n4)X91^.2耳0一11'/;3才*piOA/•A•A•A•A•A•A•A•A•沪•沪•沪•沪•沪•沪•沪•沪•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、
3、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、9UOU:UJR)9J1jnsojjoqdiouo;)X31111)X9)UIEjdt1X9)*JFtpidXjouojoj冋!冋*j叫cTn:JQJQlUPJPdsaa:uoilounj:[8刃[厶【]才[8"[厶【]『[8"[厶【口
4、・wqo~n£(qq*jrqo_n4pp*jpqo_n)xoq_sjpiOA:(W*.【叫envy]*JEip一rr」j*」叫cnnj[*JBqo~n4uiui)HdP?oa:(jj*.ipqo-n4{{^jgqo_n,]X"*jpqo_n)diij_piOA!(jj*JFip_n,H*JBqo_n4jyqi*JBqo_n)diijp[OA!(XX*JEqo_2pp*JEqo_n8*JBqo~n)uosjpiOAt(junoo)urjojjnq^jgqWsxq*JEqo_n)sqjpiOAi(1X914)X9jiu)OJdXJOSipjt(dtui)j—sA叩gsqI(duii
5、'Ao#)opuedx3H卄9]如JEqo_n}(]X3i*JBq0_n4.2耳0一11'/;3才*piOA/•A•A•A•A•A•A•A•A•沪•沪•沪•沪•沪•沪•沪•沪•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•:、•
6、:、9UOU:UJR)9Jnjnpuinjd;1X91BJBpJ9qdl9U9tJX9JIU*wtpidXjouojoj冋!冋*j叫cTn:JQJQlUPJPdsaa:uoilounj:(JXOJUI4)X0])Q)dXJ9U0Ju_chartmp[64];inti,j;Fiip(text,11,rr);for(i=l;i<17;i++){FF(i,ll,rr,LL,RR);for(j=0;j<32;j++){H[j]=LL[j];rr[j]=RR[j];}}_Fiip(tmp,rr,ll);FcompressO(tmp,mlext);}voidFdiscryptO(u_cha
7、r*mtext,u_char*text)u_chartmp[64];inti,j;Fiip(mtcxt,11,rr);for(i=16;i>0;i--){FF(i,ll,rr,LL,RR);for(j=0;j<32;j++){H[j]=LL[j];rr[j]=RR[j];}}_Fiip(tmp,rr,ll);FcompressO(tmp,text);}voidFexpandO(u_char*in,u_char*out)intdivide;inti,j;for(i=0;i<8;i卄){divi