⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 des.h

📁 DES encryption source, for chaining and block crypt
💻 H
字号:
#ifndef BYTE
  #define BYTE unsigned char
#endif

#ifndef byte
  #define byte unsigned char
#endif

#ifndef uint8
	#define uint8  unsigned char
#endif

#ifndef uint32
	#define uint32 unsigned long int
#endif

// common DES modes
#define DES_LEFT    0
#define DES_RIGHT   1
#define SECA_PC		2
#define DES_HASH    8
#define DES_PC1    16
#define DES_IP     32
#define DES_FP     64
#define DES_MOD   128

#define PRV_DES_ENCRYPT     (DES_LEFT|DES_PC1|DES_IP|DES_FP)
#define PRV_DES_DECRYPT     (DES_RIGHT|DES_PC1|DES_IP|DES_FP)

#define VIA_DES         (DES_LEFT|DES_MOD)
#define VIA_DES_HASH    (DES_LEFT|DES_HASH|DES_MOD)
//#define SECA_DES_ENCR   (PRV_DES_ENCRYPT|SECA_PC)
//#define SECA_DES_DECR   (PRV_DES_DECRYPT|SECA_PC)
//#define NAGRA_DES_ENCR  PRV_DES_ENCRYPT
//#define NAGRA_DES_DECR  PRV_DES_DECRYPT

// common Cryptoworks DES modes
#define CRW_DES_LEFT	0
#define CRW_DES_RIGHT	1
#define DESMOD1			2
#define DES				4
#define DESMOD3			8

#define DES2_DECRYPT	(DES|DESMOD3|CRW_DES_LEFT)
#define DES2_ENCRYPT	(DES|DESMOD1|CRW_DES_RIGHT)
#define CRW_DES_DECRYPT	DES

extern const byte E[], S[][64], P[], LS[], IP[], FP[];
extern byte _PC1[], _PC2[];

void cDes_Des(unsigned char *data, const unsigned char *key, int mode);
unsigned int cDes_Mod (unsigned int R, unsigned int key7);
void cDes_Permute (unsigned char *data, const unsigned char *P, int n);
void cDes_3DES(unsigned char *data, unsigned char *key);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -