資源簡介
運用DES算法開發的小程序,實行文本文件的加密以及解密。主要是里面有報告。

代碼片段和文件信息
#include?“stdio.h“
#include?“memory.h“
#include?“time.h“
#include?“stdlib.h“
#define?PLAIN_FILE_OPEN_ERROR?-1
#define?KEY_FILE_OPEN_ERROR?-2
#define?CIPHER_FILE_OPEN_ERROR?-3
#define?OK?1 ?
typedef?char?ElemType;
?//初始置換表IP
int?IP_Table[64]?=?{??57494133251791
?????????????????????????????????595143352719113
?????????????????????????????????615345372921135
?????????????????????????????????635547393123157
?????????????????????????????????56484032241680
?????????????????????????????????585042342618102
?????????????????????????????????605244362820124
?????????????????????????????????625446383022146};?
//逆初始置換表IP^-1
int?IP_1_Table[64]?=?{397471555236331
???386461454226230
???375451353216129
???364441252206028
???353431151195927
???342421050185826
???33141949175725
???32040848165624};
//擴充置換表E
int?E_Table[48]?=?{31?0?1?2?3?4
??????????????3??4?5?6?7?8
??????????????7??89101112
??????????????111213141516
??????????????151617181920
??????????????192021222324
??????????????232425262728
??????????????2728293031?0};
//置換函數P
int?P_Table[32]?=?{156192028112716
??0142225417309
??172313312628
??18122952110324};
//S盒
int?S[8][4][16]?=//S1
{{{1441312151183106125907}
{0157414213110612119538}
{4114813621115129731050}
{1512824917511314100613}}
//S2
{{1518146113497213120510}
{3134715281412011069115}
{0147111041315812693215}
{1381013154211671205149}}
//S3
{{1009146315511312711428}
{1370934610285141211151}
?{1364981530111212510147}
{1101306987415143115212}}
//S4
{{7131430691012851112415}
{1381156150347212110149}
{1069012117131513145284}
{3150610113894511127214}}
//S5
{{2124171011685315130149}
{1411212471315015103986}
{4211110137815912563014}
{1181271142136150910453}}
//S6
{{1211015926801334147511}
{1015427129561131401138}
{9141552812370410113116}
{4321295151011141760813}}
//S7
{{4112141508133129751061}
{1301174911014351221586}
{1411131237141015680592}
{6111381410795015142312}}
//S8
{{1328461511110931450127}
{1151381037412561101492}
{7114191214206101315358}
{2114741081315129035611}}};
//置換選擇1
int?PC_1[56]?=?{5648403224168
??????????0574941332517
??????????915850423426
??????????1810259514335
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????90624??2010-06-17?12:11??des程序說明報告.doc
?????文件??????12516??2010-06-17?01:49??DES\des3.c
?????文件??????33792??2010-06-17?02:02??DES\des3.ncb
?????文件???????3375??2010-06-17?01:06??DES\des3.dsp
?????文件???????1126??2010-06-17?01:49??DES\des3.plg
?????文件??????48640??2010-06-17?02:02??DES\des3.opt
?????目錄??????????0??2010-06-17?02:02??DES
?????文件?????????28??2010-06-17?01:14??測試文件以及運行結果\des2.txt
?????文件?????????32??2010-06-17?01:50??測試文件以及運行結果\2.txt
?????文件?????????28??2010-06-17?01:50??測試文件以及運行結果\3.txt
?????目錄??????????0??2010-06-17?02:03??測試文件以及運行結果
-----------?---------??----------?-----??----
???????????????190161????????????????????11
- 上一篇:售花管理系統出售鮮花系統
- 下一篇:電子科大12年軟件工程期末復習吐血整理
評論
共有 條評論