《RSA算法C语言代码(最新整理)》由会员分享,可在线阅读,更多相关《RSA算法C语言代码(最新整理)(5页珍藏版)》请在人人文库网上搜索。
1、include #include #include #include #include char s100,*c;intn,e,d,i,C,j,k=0,len;int str100,b30;unsigned gcd(unsigned a, unsigned b )if(a%b=0)return b; elsereturn gcd(b,a%b);void Egcd(int a, int b,int &x, int &y)/ax-by=1if(b=0|a=0)x=1; y=0;return ;if(a122)bk=i; k+;for(j=i;ji;j-)cj=cj-1;ci= ;len+; bz+。
2、1=bz+1+(z+1);break;clen = 0;printf(明文:);puts(c);int function()/系统功能选择页面int choice; printf(=n);printf(欢迎进入RSA算法n);printf(1-加密n);printf(2-解密n);printf(3-退出n);printf(=n);printf(请输入要选择的功能号:);scanf(%d,&choice); return choice;int main()int function(); int fc;printf(请输入初始明文(小写):);gets(s);/ puts(s);RSA();/提供。
3、私钥和公钥while(1)fc=function();if(fc=1)/加密encrypt();else if(fc=2)/解密decrypt() ; else if(fc=3) break;elseprintf(输入有误,请重新输入!/n);return 0;“”“”At the end, Xiao Bian gives you a passage. Minand once said, people who learn to learn are very happy people. In every wonderful life, learning is an eternal theme. 。
4、As a professional clerical and teaching position, I understand the importance of continuous learning, life is diligent, nothing can be gained, only continuous learning can achieve better self. Only by constantly learning and mastering the latest relevant knowledge, can employees from all walks of life keep up with the pace of enterprise development and innovate to meet the needs of the market. This document is also edited by my studio professionals, there may be errors in the document, if there are errors, please correct, thank you。