des algorithm realization C
2016-08-23
0 0 0
no vote
Other
Earn points
#include
class SubKey {// Define key for a class
public:
int key [8] [6];
} subkey [16]; // define the sub-key array of objects
class DES {
int encipher_decipher; // determine the encryption or decryption
int key_in [8] [8]; // user input original 64-bit binary number
int key_out [8] [7]; // remove the last bit of parity bit for each row
int c0_d0 [8] [7]; // store data after 56 PC-1 conversion
int c0 [4] [7], d0 [4] [7]; // are stored c0, d0
int text [8] [8]; // 64-bit plaintext
int text_ip [8] [8]; // explicit conversion by the IP after the
int A [4] [8], B [4] [8]; // A, B respectively after storing the IP converting plaintext into two parts, to facilitate the exchange of
int temp [8] [6]; 48-bit binary value is stored // expanded permuted
int temp1 [8] [6]; // to store and subkey XOR result
int s_result [8] [4]; 32-bit value stored by S // transforme
class SubKey {// Define key for a class
public:
int key [8] [6];
} subkey [16]; // define the sub-key array of objects
class DES {
int encipher_decipher; // determine the encryption or decryption
int key_in [8] [8]; // user input original 64-bit binary number
int key_out [8] [7]; // remove the last bit of parity bit for each row
int c0_d0 [8] [7]; // store data after 56 PC-1 conversion
int c0 [4] [7], d0 [4] [7]; // are stored c0, d0
int text [8] [8]; // 64-bit plaintext
int text_ip [8] [8]; // explicit conversion by the IP after the
int A [4] [8], B [4] [8]; // A, B respectively after storing the IP converting plaintext into two parts, to facilitate the exchange of
int temp [8] [6]; 48-bit binary value is stored // expanded permuted
int temp1 [8] [6]; // to store and subkey XOR result
int s_result [8] [4]; 32-bit value stored by S // transforme
c
算法
des
实现
Related Source Codes
PClite
0
0
no vote
generic embeded FTP Client
0
0
no vote
UDP Test Demo
0
0
no vote
TMS320F28335 DSP transmits data to EEPROM through
0
0
no vote
TMS320F28335 CAN communication source code
0
0
no vote
No comment