des3.h

来自「站长96年写的一个Internet上用的股票行情、分析、交易、资讯程序源码」· C头文件 代码 · 共 93 行

H
93
字号
#ifndef _MODULE_DES3_H_#define _MODULE_DES3_H_/* *             des3 - NBS Data Encryption Standard Library * *         Copyright (c) 1992,93,94 by SWS. All Rights Reserved. *       Stefan Wolf Software; Gartenstr 22; D-61449 Steinbach/Ts. *           FAX: +49 (0) 6171 980483; CI$ Email: 100111,140 * *    Synopsis:	desinit(key) * Description: intializes all arrays and permutation tables for  *              single DES *       Input: key -  64-bit DES key *      Output: 0 if OK; >0 if a (semi) weak was selected * *    Synopsis:	des3init(key) * Description: intializes all arrays and permutation tables for *              triple DES *       Input: key -  128-bit DES key *      Output: 0 if OK; >0 if a (semi) weak was selected * *    Synopsis: ecbXcode(inblock,outblock) * Description: encrypts (X=en) or decrypts (X=de) 64-bit inblock to *              64-bit outblock using single DES in ECB mode *     	 Input: inblock  - pointer to 64-bit buffer of input data *              outblock - pointer to 64-bit buffer for output data *      Output: 0 if OK                                         * *    Synopsis: ecb3Xcode(inblock,outblock) * Description: encrypts (X=en) or decrypts (X=de) 64-bit inblock to *              64-bit outblock using triple DES in ECB mode *     	 Input: inblock  - pointer to 64-bit buffer of input data *              outblock - pointer to 64-bit buffer for output data *      Output: 0 if OK * *    Synopsis: cbcXcode(inblock,outblock,ivec) * Description: encrypts (X=en) or decrypts (X=de) 64-bit inblock to *              64-bit outblock using single DES in CBC mode *     	 Input: inblock  - pointer to 64-bit buffer of input data *              outblock - pointer to 64-bit buffer for output data *              ivec     - pointer to 64-bit initilization vector *      Output: 0 if OK * *    Synopsis: cbc3Xcode(inblock,outblock,ivec) * Description: encrypts (X=en) or decrypts (X=de) 64-bit inblock to *              64-bit outblock using triple DES in CBC mode *     	 Input: inblock  - pointer to 64-bit buffer of input data *              outblock - pointer to 64-bit buffer for output data *              ivec     - pointer to 64-bit initilization vector *      Output: 0 if OK * */typedef unsigned char uchar;#ifdef __cplusplusextern "C" {#endif /* __cplusplus */#define	WIN16#if defined(WIN16)#define DECL int far pascal#define UCHAR uchar far#endif /* WIN16 */#if defined(WIN32)/* remove pascal for MS VC */#define DECL int pascal#define UCHAR uchar#endif /* WIN32 */#if !defined(WIN16) && !defined(WIN32)#define DECL int#define UCHAR uchar#endif /* !WIN16 && !WIN32 */DECL desinit(UCHAR *key1);DECL ecbencode(UCHAR *inblock, UCHAR *outblock);DECL ecbdecode(UCHAR *inblock, UCHAR *outblock);DECL cbcencode(UCHAR *inblock, UCHAR *outblock, UCHAR *ivec);DECL cbcdecode(UCHAR *inblock, UCHAR *outblock, UCHAR *ivec);DECL des3init(UCHAR *key3);DECL ecb3encode(UCHAR *inblock, UCHAR *outblock);          DECL ecb3decode(UCHAR *inblock, UCHAR *outblock);DECL cbc3encode(UCHAR *inblock, UCHAR *outblock, UCHAR *ivec);DECL cbc3decode(UCHAR *inblock, UCHAR *outblock, UCHAR *ivec);#ifdef __cplusplus}#endif /* __cplusplus */#endif /* _MODULE_DES3_H_ */ 

⌨️ 快捷键说明

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