全文预览

利用程序实现希尔密码的加密和解密过程

上传者:随心@流浪 |  格式:doc  |  页数:12 |  大小:0KB

文档介绍
ay;}boolHillArray::isHillArray(){?intdet;?det=(detHillArray()%26+26)%26;?if(det&&(det%2)&&(det%13))?returntrue;?returnfalse;}voidHillArray::fillInversHArray(){?inti,j;?intinvDet;?for(i=1;i<26;i++)?{ if((((detHArray%26+26)%26)*i)%26==1) {?invDet=i; break; }}?for(i=0;i<size;i++) for(j=0;j<size;j++) { inverseHArray[i][j]=(invDet*memberV(j,i))%26; }}voidHillArray::showOriginalArray(){?showArray(HArray,size);}voidHillArray::showInverseArray(){?showArray(inverseHArray,size);}voidHillArray::initalFunc(){?do?{ fillArray();}while(!isHillArray());?fillInversHArray();}intmain(){?HillArrayone(4);?charplaintext[5],t[5];?charciphertext[5];?inttemp=0;?inti,j;?longl;?l=clock();?one.initalFunc();?l=clock()-l;?printf("%ld\n",l);?one.showOriginalArray();?one.showInverseArray();?printf("inputyourplaintext:");

收藏

分享

举报
下载此文档