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

📄 h_des.h

📁 des算法源码 des算法源码 des算法源码
💻 H
字号:
//----------------------------------------------------------------------------------------//
// H_Des.h : Math Function(Des() e.g) for inner user
// not extern for outside user
//
// Data: 2006.5.15
// Edited by Fenglei
//
//----------------------------------------------------------------------------------------//
#ifndef H_Des_H
#define H_Des_H

#define IN
#define OUT
#define IN_OUT

#pragma once

// The following ifdef block is the standard way of creating macros which make exporting 
// from a DLL simpler. All files within this DLL are compiled with the DES_C_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see 
// DES_C_API functions as being imported from a DLL, wheras this DLL sees symbols
// defined with this macro as being exported.

//----------------------------------------------------------------------------------------//

//*****************************************************************************
//															parama length(BYTEs)
//function		  : Triple Des encrypt
//name            : DES_C_DDES
//parama		   
//	key		      : the input key                           8 or 16 
//	data		  : the input data block   					8 
//	encrypt	      : encrypt or decrypt flag  				true:  encrypt;
//															false: decrypt 
//author          : xiao wei
//last edit date  : 2003.4.11 
//last edit time  : 15:14
//*****************************************************************************
void DES_C_DDES(const BYTE IN *key, BYTE IN_OUT *data, bool IN encrypt);


//*****************************************************************************
//															parama length(BYTEs)
//function		  : Des encrypt
//name            : DES_C_DES
//parama		   
//	key		      : the input key                           8 
//	data		  : the input data block   					8 
//	doEncrypt	  : encrypt or decrypt flag  				0:encrypt;
//															1:decrypt 
//author          : xiao wei
//last edit date  : 2003.4.11 
//last edit time  : 15:14
//*****************************************************************************
void DES_C_DES(const BYTE IN *key, BYTE IN_OUT *data, int IN doEncrypt);


//*****************************************************************************
//															parama ASCII
//function		  : DES/3DES Encrypt/ Decrypt
//name            : DES
//parama
//	psData		  : Data for calculate
//	psKey	      : Key for calculate(16 Or 8 Bytes)		16-- 3Des; 8-- Des
//	bEncrypt	  : Encrypt Or Decrypt Flag
//
//return		  : 3DES Result
//
//author          : Feng Lei
//last edit date  : 2006.5.19 
//last edit time  : 10:28
//*****************************************************************************
LPCSTR DES(LPCSTR IN psData, LPCSTR IN psKey, BOOL IN bEncrypt);

//*****************************************************************************
//															parama ASCII
//function		  : MAC
//name            : MAC
//parama
//	psInitValue	  : Initail Data for calculate
//	psData	      : Data
//	psKey	  	  : Key for calculate(16 Or 8 Bytes)		16-- 3Des; 8-- Des
//
//return		  : MAC Result(4Bytes)
//
//author          : Feng Lei
//last edit date  : 2006.5.19 
//last edit time  : 10:28
//*****************************************************************************
LPCSTR MAC(LPCSTR IN psInitValue, LPCSTR IN psData, LPCSTR IN psKey);

#endif

⌨️ 快捷键说明

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