資源簡介
實(shí)驗(yàn)要求:開發(fā)實(shí)現(xiàn)一個S-DES和RSA加解密系統(tǒng),在界面上輸入明文和密鑰,系統(tǒng)可以輸出正確的密文。通過曲線圖分析算法的雪崩效應(yīng)。
代碼片段和文件信息
#include?
#include?
#include?
using?namespace?std;
const?string?P10?=?“2416390875“;???????????????//置換密鑰的字符串
const?string?P8?=?“52637498“;??????????????????//P8置換字符串
const?string?IP?=?“15203746“;??????????????????//置換明文的字符串
const?string?IP_1?=?“30246175“;????????????????//逆置換的字符串
const?string?EP?=?“30121230“;??????????????????//擴(kuò)展置換的字符串
const?int?KEY?=?10;????????????????????????????//密鑰長度
const?int?HALF_KEY?=?5;????????????????????????//密鑰長度的一半
const?int?SUB_KEY?=?8;?????????????????????????//子密鑰長度
const?int?TEXT?=?8;????????????????????????????//明文或密文的長度
const?int?HALF_TEXT?=?4;???????????????????????//明文或密文長度的一半
const?int?QUARTER_TEXT?=?2;????????????????????//明文或密文長度的四分之一
const?int?S0[4][4]?=???????????????????????????//S0?Box
{?
?????{1
- 上一篇:C語言 飛機(jī)票訂票系統(tǒng)
- 下一篇:mfc文本編輯器
評論
共有 條評論