The Theory of DES algorithm
The DES algorithm belongs to symmetric encryption algorithm, which is widely used in some transactions with higher security requirements, such as payment industry. On the theory of DES algorithm, there are many articles on the Web have detailed explanation, write very well, I do not repeat here, here is a link: http://www.vckbase.com/document/viewdoc/?id=623, please friends to learn their own, My code is written based on the theory here.
II. implementation of the environment and documents
A, Environment: Redhat Linux + C
b, the implementation of the document: Des.h
Des.c
Makefile
Third, the Code
1, des.h documents
Function: To implement DES and 3DES encryption and decryption algorithm
Author: XXX
Date: 2008-9-23
#ifndef Des_h
#define Des_h
static int pc_1_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};
static int pc_2_table[48]={14,17,11,24, 1, 5,
3,28,15, 6,21,10,
23,19,12, 4, 26, 8,