資源簡介
DES加密 解密 方法: DESr DESw 支持3DES加密 解密 類中利用函數重載的方式 實現兩種加密方式 加密后為16進制字符串 使用方法: 實例化一個對象 然后就可以隨便用了。 如 DES加密 解密 CString sd,sd2; yxyDES2 des; sd=des.DESr("wan123456","710666260"); sd2=des.DESw(sd,"710666260"); 3DES加密 解密 CString sd,sd2; yxyDES2 des; sd=des.DESr("wan123456","710666260","123456");
代碼片段和文件信息
#include?“stdafx.h“
#include?“yxyDES2.h“
//?permuted?choice?table?(PC1)
const?static?char?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
};
//?permuted?choice?key?(PC2)
const?static?char?PC2_Table[48]?=?{
14?17?11?24??1??5??3?28?15??6?21?10
23?19?12??4?26??8?16??7?27?20?13??2
41?52?31?37?47?55?30?40?51?45?33?48
44?49?39?56?34?53?46?42?50?36?29?32
};
//?number?left?rotations?of?pc1?
const?static?char?Shift_Table[16]?=?{
1122222212222221
};
//?initial?permutation?(IP)
const?static?char?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?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????5390??2015-07-11?13:11??yxyDES2.h
?????文件????????431??2015-07-11?13:18??說明.txt
?????文件??????16363??2015-07-11?13:11??yxyDES2.cpp
-----------?---------??----------?-----??----
????????????????22184????????????????????3
評論
共有 條評論