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

正文內(nèi)容

現(xiàn)代密碼學(xué)實驗(題目代碼)-免費閱讀

2025-07-01 20:28 上一頁面

下一頁面
  

【正文】 $39。 //after call DecryptData //cpoy the temp result to szFPlaintextAnyLength memcpy(szFPlaintextAnyLength + 8*i,szPlaintext,8)。 //if the data can39。}char* yxyDES::GetCiphertextAnyLength(){ return szFCiphertextAnyLength。 case 3: sz += $$$$$。 }}//fill the data to 8 bitsstring yxyDES::FillToEightBits(string sz){ //length less than 8 , add zero(s) to tail switch(()) { case 7: sz += $。 szLast8Bits = FillToEightBits(szLast8Bits)。 string szLast8Bits。 EncryptData(szSource)。}//any lengthvoid yxyDES::EncryptAnyLength(string szSource){ int iLength = ()。}char yxyDES::SingleBinaryToChar(int i){ if(i == 1) return 39。 for(int i=0。 int iX = SingleCharToBinary(sTmp[i][0]) * 2 + SingleCharToBinary(sTmp[i][5])。ilen。 } memcpy(Return_value,sz_IPData,64)。 for(unsigned int ui=0。k8。 for(i=0。 string s_Compress32 = CompressFuncS(sz_xor48)。}void yxyDES::FunctionF(char* sz_Li,char* sz_Ri,int iKey){ char sz_48R[48] = {0}。i16。 char sz_Li[32] = {0}。i++) { FunctionF(sz_Li,sz_Ri,i)。 char sz_Ri[32] = {0}。 memcpy(szTmp56 + 28,szDi,28)。 for(int i=0。 s_return += ch。 buffer[0] = 39。 int iCh = 0。 default: return 。 case 8: return 1000。 }}string yxyDES::HexIntToBinary(int i){ switch(i) { case 0: return 0000。: return 1101。 case 39。839。: return 0101。 case 39。039。k8。 for(i=0。// initial permutation (IP)const static int IP_Table[64] = { 58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4, 62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8, 57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3, 61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7}。 string HexIntToBinary(int )。 void InitialPermuteData(string,char*,bool)。 char* GetPlaintextAnyLength()。 void DecryptData(string )。 return 0。 c[0]=0。k++) { cypher[k]=cyph[k]^b[k]。 for(int j=0。 output_binary( (unsigned char)b[i])。 }}//output a char type of data in binary wayvoid output_binary(unsigned char c){ for(int i=0。 i byte_length。 (unsigned char)128。++kk) { outchar(s[kk])。 for(int j=0。 } for(int kk=0。 char c。 coutendl。 for(int k=5。 39。 vectorint s。i()。 else if(gcd(a)==0) cout密鑰a有誤,與26不互素endl。} return x。 }while(r)。char(k+97)出現(xiàn)的概率為:n[k]/sumendl。j26。++i) (97+i)。二、實驗內(nèi)容 1)用C\C++語言實現(xiàn)仿射變換(Affine)加/解密算法;2)用C\C++語言實現(xiàn)統(tǒng)計26個英文字母出現(xiàn)的頻率的程序;3)利用仿射變換加/解密程序?qū)σ欢屋^長的英文文章進行加密,再利用統(tǒng)計軟件對明文和密文中字母出現(xiàn)的頻率進行統(tǒng)計并作對比,觀察有什么規(guī)律。 vectorint n(26,0)。++i) if(int(x)==s[i]){ n[i]++。++k){ // n[k]=n[k]/sum。 do{ r=f%g。i=30。 int a,b。inx。cout加密成功!明文請見“”endl。i()。二、實驗內(nèi)容1)利用C\C++語言實現(xiàn)LFSR(其中LFSR已給定);2)通過不同初始狀態(tài)生成相應(yīng)的序列,并觀察他們的周期有什么特點;3)利用生成的序列對文本進行加/解密(按對應(yīng)位作模2加運算)。jj31。 if(key==1||key==2) { if(key==1) { cout加密成功,endl。 if(i+j32) i=(i+j1)%31+1。 ofstream out()。 ((int(c))^sum)。//return next stateunsigned char fn_feedback(unsigned char n, unsigned char c, unsigned char curr_state){ unsigned char t = c amp。 } return (unsigned char)((curr_state 1) | (s (n1)))。 (unsigned char)128) j )。 }}void Geffe(unsigned char buf[], unsigned char buf1[], unsigned char buf2[], unsigned char b[]){ for(int i=0。 }}void cypt(unsigned char b[]){ unsigned char cypher[10],cyph[10]。 } coutendl。 lfsr_output_byte(5,(unsigned char)44,(unsigned char)152, buf1, 10)。 coutendl。 ~yxyDES()。 void SetPlaintext(char* value)。 char szFPlaintextAnyLength[4096]。 string FillToEightBits(string)。endif構(gòu)造主文件:pragma hdrstopinclude //pragma package(smart_init)// permuted choice table (PC1)const static int PC1_Table[56] = { 57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4}。yxyDES::yxyDES(){}yxyDES::~yxyDES(){}void yxyDES::InitializeKey(string s){ //convert 8 charbytes key to 64 binarybits int i。 //a = 0x61 = 0110,0001 //after this , a is 1000,0110 } //let me convert it to right for(int j=0。i++) { sz_56key[i] = sz_64key[PC1_Table[i]1]。 case 39。: return 0100。739。 case 39。: return 1100。f39。 case 5: return 0101。 case 13: return 1101。 for(int i=0。 } if(bType) { char buffer[2] = {0}。 buffer[0] = 39。 char szDi[28] = {0}。 memcpy(szDi + 28 Shift_Table[i],szTmpR,Shift_Table[i])。 memcpy(szTmpR,szDi,28)。 memcpy(sz_Ri,sz_IP + 32,32)。j++) { sz
點擊復(fù)制文檔內(nèi)容
教學(xué)教案相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1