网络信息安全教学实验系统

发布于2022-01-12 23:53:40

我造学校的机房将windows2003 sever的虚拟系统拷贝到我自己的电脑,为什么在机房中的网络信息安全教学实验系统平台可以用,而到了我的机子上就不可以用了,说未注册,也不说明如何注册(机房中网络信息安全教学实验系统平台就是安装在虚拟系统内的)

3个回答
admin
网友回答2022-01-12
你好! 你的问题即将过期, 请采纳我的为答案, 否则系统将自动扣除你的积分。
admin
网友回答2022-01-12
c语言编写的一个des加密源程序如下,不解释,自己慢慢看: c语言编写的一个des加密源程序如下,不解释,自己慢慢看: #include #include #include #include #define plain_file_open_error -1 #define key_file_open_error -2 #define cipher_file_open_error -3 #define ok 1; typedef char elemtype; int ip_table[64] = { 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, 56,48,40,32,24,16,8,0, 58,50,42,34,26,18,10,2, 60,52,44,36,28,20,12,4, 62,54,46,38,30,22,14,6}; int ip_1_table[64] = {39,7,47,15,55,23,63,31, 38,6,46,14,54,22,62,30, 37,5,45,13,53,21,61,29, 36,4,44,12,52,20,60,28, 35,3,43,11,51,19,59,27, 34,2,42,10,50,18,58,26, 33,1,41,9,49,17,57,25, 32,0,40,8,48,16,56,24}; int e_table[48] = {31, 0, 1, 2, 3, 4, 3, 4, 5, 6, 7, 8, 7, 8,9,10,11,12, 11,12,13,14,15,16, 15,16,17,18,19,20, 19,20,21,22,23,24, 23,24,25,26,27,28, 27,28,29,30,31, 0}; int p_table[32] = {15,6,19,20,28,11,27,16, 0,14,22,25,4,17,30,9, 1,7,23,13,31,26,2,8, 18,12,29,5,21,10,3,24}; int s[8][4][16] =/* s1 */ {{{14,4,13,1,2,15,11,8,3,10,6,12,5,9,0,7}, {0,15,7,4,14,2,13,1,10,6,12,11,9,5,3,8}, {4,1,14,8,13,6,2,11,15,12,9,7,3,10,5,0}, {15,12,8,2,4,9,1,7,5,11,3,14,10,0,6,13}}, /* s2 */ {{15,1,8,14,6,11,3,4,9,7,2,13,12,0,5,10}, {3,13,4,7,15,2,8,14,12,0,1,10,6,9,11,5}, {0,14,7,11,10,4,13,1,5,8,12,6,9,3,2,15}, {13,8,10,1,3,15,4,2,11,6,7,12,0,5,14,9}}, /* s3 */ {{10,0,9,14,6,3,15,5,1,13,12,7,11,4,2,8}, {13,7,0,9,3,4,6,10,2,8,5,14,12,11,15,1}, {13,6,4,9,8,15,3,0,11,1,2,12,5,10,14,7}, {1,10,13,0,6,9,8,7,4,15,14,3,11,5,2,12}}, /* s4 */ {{7,13,14,3,0,6,9,10,1,2,8,5,11,12,4,15}, {13,8,11,5,6,15,0,3,4,7,2,12,1,10,14,9}, {10,6,9,0,12,11,7,13,15,1,3,14,5,2,8,4}, {3,15,0,6,10,1,13,8,9,4,5,11,12,7,2,14}}, /* s5 */ {{2,12,4,1,7,10,11,6,8,5,3,15,13,0,14,9}, {14,11,2,12,4,7,13,1,5,0,15,10,3,9,8,6}, {4,2,1,11,10,13,7,8,15,9,12,5,6,3,0,14}, {11,8,12,7,1,14,2,13,6,15,0,9,10,4,5,3}}, /* s6 */ {{12,1,10,15,9,2,6,8,0,13,3,4,14,7,5,11}, {10,15,4,2,7,12,9,5,6,1,13,14,0,11,3,8}, {9,14,15,5,2,8,12,3,7,0,4,10,1,13,11,6}, {4,3,2,12,9,5,15,10,11,14,1,7,6,0,8,13}}, /* s7 */ {{4,11,2,14,15,0,8,13,3,12,9,7,5,10,6,1}, {13,0,11,7,4,9,1,10,14,3,5,12,2,15,8,6}, {1,4,11,13,12,3,7,14,10,15,6,8,0,5,9,2}, {6,11,13,8,1,4,10,7,9,5,0,15,14,2,3,12}}, /* s8 */ {{13,2,8,4,6,15,11,1,10,9,3,14,5,0,12,7}, {1,15,13,8,10,3,7,4,12,5,6,11,0,14,9,2}, {7,11,4,1,9,12,14,2,0,6,10,13,15,3,5,8}, {2,1,14,7,4,10,8,13,15,12,9,0,3,5,6,11}}}; int pc_1[56] = {56,48,40,32,24,16,8, 0,57,49,41,33,25,17, 9,1,58,50,42,34,26, 18,10,2,59,51,43,35, 62,54,46,38,30,22,14, 6,61,53,45,37,29,21, 13,5,60,52,44,36,28, 20,12,4,27,19,11,3}; int pc_2[48] = {13,16,10,23,0,4,2,27, 14,5,20,9,22,18,11,3, 25,7,15,6,26,19,12,1, 40,51,30,36,46,54,29,39, 50,44,32,46,43,48,38,55, 33,52,45,41,49,35,28,31}; int move_times[16] = {1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1}; int bytetobit(elemtype ch,elemtype bit[8]); int bittobyte(elemtype bit[8],elemtype *ch); int char8tobit64(elemtype ch[8],elemtype bit[64]); int bit64tochar8(elemtype bit[64],elemtype ch[8]); int des_makesubkeys(elemtype key[64],elemtype subkeys[16][48]); int des_pc1_transform(elemtype key[64], elemtype tempbts[56]); int des_pc2_transform(elemtype key[56], elemtype tempbts[48]); int des_rol(elemtype data[56], int time); int des_ip_transform(elemtype data[64]); int des_ip_1_transform(elemtype data[64]); int des_e_transform(elemtype data[48]); int des_p_transform(elemtype data[32]); int des_sbox(elemtype data[48]); int des_xor(elemtype r[48], elemtype l[48],int count); int des_swap(elemtype left[32],elemtype right[32]); int des_encryptblock(elemtype plainblock[8], elemtype subkeys[16][48], elemtype cipherblock[8]); int des_decryptblock(elemtype cipherblock[8], elemtype subkeys[16][48], elemtype plainblock[8]); int des_encrypt(char *plainfile, char *keystr,char *cipherfile); int des_decrypt(char *cipherfile, char *keystr,char *plainfile); int bytetobit(elemtype ch, elemtype bit[8]){ int cnt; for(cnt = 0;cnt < 8; cnt++){ *(bit+cnt) = (ch>>cnt)&1; } return 0; } /* 娴滃矁绻橀崚鎯版祮阉广垺鍨氱€涙 濡?*/ int bittobyte(elemtype bit[8],elemtype *ch){ int cnt; for(cnt = 0;cnt < 8; cnt++){ *ch |= *(bit + cnt)<>3; data[cur2+1] = (output&0x04)>>2; data[cur2+2] = (output&0x02)>>1; data[cur2+3] = output&0x01; } return 0; } int des_swap(elemtype left[32], elemtype right[32]){ elemtype temp[32]; memcpy(temp,left,32); memcpy(left,right,32); memcpy(right,temp,32); return 0; } int des_encryptblock(elemtype plainblock[8], elemtype subkeys[16][48], elemtype cipherblock[8]){ elemtype plainbits[64]; elemtype copyright[48]; int cnt; char8tobit64(plainblock,plainbits); des_ip_transform(plainbits); for(cnt = 0; cnt < 16; cnt++){ memcpy(copyright,plainbits+32,32); des_e_transform(copyright); des_xor(copyright,subkeys[cnt],48); des_sbox(copyright); des_p_transform(copyright); des_xor(plainbits,copyright,32); if(cnt != 15){ des_swap(plainbits,plainbits+32); } } des_ip_1_transform(plainbits); bit64tochar8(plainbits,cipherblock); return 0; } int des_decryptblock(elemtype cipherblock[8], elemtype subkeys[16][48],elemtype plainblock[8]){ elemtype cipherbits[64]; elemtype copyright[48]; int cnt; char8tobit64(cipherblock,cipherbits); des_ip_transform(cipherbits); for(cnt = 15; cnt >= 0; cnt--){ memcpy(copyright,cipherbits+32,32); des_e_transform(copyright); des_xor(copyright,subkeys[cnt],48); des_sbox(copyright); des_p_transform(copyright); des_xor(cipherbits,copyright,32); if(cnt != 0){ des_swap(cipherbits,cipherbits+32); } } des_ip_1_transform(cipherbits); bit64tochar8(cipherbits,plainblock); return 0; } int des_encrypt(char *plainfile, char *keystr,char *cipherfile){ file *plain,*cipher; int count; elemtype plainblock[8],cipherblock[8],keyblock[8]; elemtype bkey[64]; elemtype subkeys[16][48]; if((plain = fopen(plainfile,"rb")) == null){ return plain_file_open_error; } if((cipher = fopen(cipherfile,"wb")) == null){ return cipher_file_open_error; } memcpy(keyblock,keystr,8); char8tobit64(keyblock,bkey); des_makesubkeys(bkey,subkeys); while(!feof(plain)){ if((count = fread(plainblock,sizeof(char),8,plain)) == 8){ des_encryptblock(plainblock,subkeys,cipherblock); fwrite(cipherblock,sizeof(char),8,cipher); } } if(count){ memset(plainblock + count,'\0',7 - count); plainblock[7] = 8 - count; des_encryptblock(plainblock,subkeys,cipherblock); fwrite(cipherblock,sizeof(char),8,cipher); } fclose(plain); fclose(cipher); return ok; } int des_decrypt(char *cipherfile, char *keystr,char *plainfile){ file *plain, *cipher; int count,times = 0; long filelen; elemtype plainblock[8],cipherblock[8],keyblock[8]; elemtype bkey[64]; elemtype subkeys[16][48]; if((cipher = fopen(cipherfile,"rb")) == null){ return cipher_file_open_error; } if((plain = fopen(plainfile,"wb")) == null){ return plain_file_open_error; } memcpy(keyblock,keystr,8); char8tobit64(keyblock,bkey); des_makesubkeys(bkey,subkeys); fseek(cipher,0,seek_end); filelen = ftell(cipher); rewind(cipher); while(1){ fread(cipherblock,sizeof(char),8,cipher); des_decryptblock(cipherblock,subkeys,plainblock); times += 8; if(times < filelen){ fwrite(plainblock,sizeof(char),8,plain); } else{ break; } } if(plainblock[7] < 8){ for(count = 8 - plainblock[7]; count < 7; count++){ if(plainblock[count] != '\0'){ break; } } } if(count == 7){ fwrite(plainblock,sizeof(char),8 - plainblock[7],plain); } else{ fwrite(plainblock,sizeof(char),8,plain); } fclose(plain); fclose(cipher); return ok; } int main() { des_encrypt("out.xml","key.txt","out.des"); des_decrypt("out.des","key.txt","out.des.xml"); return 0; };>
admin
网友回答2022-01-12
那个需要加密狗(就是那个U盘状的东西)和前面的一台大箱子 (平时当交换机使用),这样程序就是注册了

回到
顶部