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

正文內容

網絡安全rsa算法的實現(xiàn)實驗報告-資料下載頁

2025-08-04 05:25本頁面
  

【正文】 }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()。} 代碼的思想:首先隨意輸入兩個素數(shù)p和q,然后利用算法計算出p*q即n,再算出(p1)*(q1)即t,并且同時輸出計算的結果n和t,接下來輸入e,經過算法可以計算出d,由此可以知道RSA算法的公鑰和私鑰;接下來可以有兩個選擇:一選擇輸入明文,有明文經過算法可以計算出密文;二輸入密文,有密文經過算法可以計算出明文。 運行以上代碼就可以得到實驗的結果。五、實驗結果 實驗結果如下圖所示:六、實驗心得:通過這次的實驗,會運用一些現(xiàn)成的算法進行編程,對一些比較復雜的算法開始基本認識并深刻的掌握。在以后所涉及這方面的知識將會有全新的了解和掌握。讓我對RSA算法有了較通透的理解。
點擊復制文檔內容
教學課件相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1