//
DES.cpp : Defines the entry point for the console application.
//
#include " stdafx.h "
#include < iostream >
//
// DES加密、解密算法
// 作者:liujichao
// DES算法:64位明文(不足需补位) + 56位密钥(8个校验位) --> 64位密文
// 定义32位无符号类型
typedef unsigned long DWORD;
// DES 64位块
typedef struct tagBLOCK
{
DWORD dwLeft32; // 高32位
DWORD dwRight32; // 低32位
}BLOCK, * LPBLOCK;
namespace
{
// 正向置换表
int DES_IP[] =
{
58 , 50 , 42 , 34 , 26 , 18 , 10 , 2 ,
60 , 52 , 44 , 36 , 28 , 20 , 12 , 4 ,
62 , 54 , 46 , 38 , 30 , 22 , 14
//
#include " stdafx.h "
#include < iostream >
//
// DES加密、解密算法
// 作者:liujichao
// DES算法:64位明文(不足需补位) + 56位密钥(8个校验位) --> 64位密文
// 定义32位无符号类型
typedef unsigned long DWORD;
// DES 64位块
typedef struct tagBLOCK
{
DWORD dwLeft32; // 高32位
DWORD dwRight32; // 低32位
}BLOCK, * LPBLOCK;
namespace
{
// 正向置换表
int DES_IP[] =
{
58 , 50 , 42 , 34 , 26 , 18 , 10 , 2 ,
60 , 52 , 44 , 36 , 28 , 20 , 12 , 4 ,
62 , 54 , 46 , 38 , 30 , 22 , 14