freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

網(wǎng)絡(luò)安全rsa算法的實(shí)現(xiàn)實(shí)驗(yàn)報(bào)告-資料下載頁(yè)

2025-08-04 05:25本頁(yè)面
  

【正文】 }printf(%d\n,r)。return r。}void main(){int p,q,e,d,m,n,t,c,r。char s。printf(please input the p,q: )。scanf(%d%d,amp。p,amp。q)。n=p*q。printf(the n is %3d\n,n)。t=(p1)*(q1)。printf(the t is %3d\n,t)。printf(please input the e: )。scanf(%d,amp。e)。if(e1||et){ printf(e is error,please input again: )。 scanf(%d,amp。e)。}d=1。while(((e*d)%t)!=1) d++。printf(then caculate out that the d is %d\n,d)。printf(the cipher please input 1\n)。printf(the plain please input 2\n)。scanf(%d,amp。r)。switch(r){ case 1: printf(input the m: )。 /*輸入要加密的明文數(shù)字*/ scanf(%d,amp。m)。 c=candp(m,e,n)。 printf(the cipher is %d\n,c)。break。 case 2: printf(input the c: )。 /*輸入要解密的密文數(shù)字*/ scanf(%d,amp。c)。 m=candp(c,d,n)。 printf(the cipher is %d\n,m)。break。}getch()。} 代碼的思想:首先隨意輸入兩個(gè)素?cái)?shù)p和q,然后利用算法計(jì)算出p*q即n,再算出(p1)*(q1)即t,并且同時(shí)輸出計(jì)算的結(jié)果n和t,接下來(lái)輸入e,經(jīng)過(guò)算法可以計(jì)算出d,由此可以知道RSA算法的公鑰和私鑰;接下來(lái)可以有兩個(gè)選擇:一選擇輸入明文,有明文經(jīng)過(guò)算法可以計(jì)算出密文;二輸入密文,有密文經(jīng)過(guò)算法可以計(jì)算出明文。 運(yùn)行以上代碼就可以得到實(shí)驗(yàn)的結(jié)果。五、實(shí)驗(yàn)結(jié)果 實(shí)驗(yàn)結(jié)果如下圖所示:六、實(shí)驗(yàn)心得:通過(guò)這次的實(shí)驗(yàn),會(huì)運(yùn)用一些現(xiàn)成的算法進(jìn)行編程,對(duì)一些比較復(fù)雜的算法開(kāi)始基本認(rèn)識(shí)并深刻的掌握。在以后所涉及這方面的知識(shí)將會(huì)有全新的了解和掌握。讓我對(duì)RSA算法有了較通透的理解。
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1