home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / des3_os2.zip / DES3.H < prev    next >
C/C++ Source or Header  |  1996-02-20  |  3KB  |  90 lines

  1. #ifndef _MODULE_DES3_H_
  2. #define _MODULE_DES3_H_
  3. /*
  4.  *             des3 - NBS Data Encryption Standard Library
  5.  *
  6.  *         Copyright (c) 1992 - 96 by SWS. All Rights Reserved.
  7.  *       Stefan Wolf Software; Gartenstr 22; D-61449 Steinbach/Ts.
  8.  *         FON/FAX: +49 (0) 6171 980483; BBS: +49 (0) 69 5075592
  9.  *      Compu$erve: 100111,140; Internet: 100111.140@compuserve.com
  10.  *
  11.  *    Synopsis:    desinit(key)
  12.  * Description: intializes all arrays and permutation tables for 
  13.  *              single DES
  14.  *       Input: key -  8 Byte DES key
  15.  *      Output: 0 if OK; >0 if a (semi) weak was selected
  16.  *
  17.  *    Synopsis:    des3init(key)
  18.  * Description: intializes all arrays and permutation tables for
  19.  *              triple DES
  20.  *       Input: key - 24 Byte DES key
  21.  *      Output: 0 if OK; >0 if a (semi) weak was selected
  22.  *
  23.  *    Synopsis: ecbXcode(inblock,outblock)
  24.  * Description: encrypts (X=en) or decrypts (X=de) 64-bit inblock to
  25.  *              64-bit outblock using single DES in ECB mode
  26.  *          Input: inblock  - pointer to 64-bit buffer of input data
  27.  *              outblock - pointer to 64-bit buffer for output data
  28.  *      Output: 0 if OK                                        
  29.  *
  30.  *    Synopsis: ecb3Xcode(inblock,outblock)
  31.  * Description: encrypts (X=en) or decrypts (X=de) 64-bit inblock to
  32.  *              64-bit outblock using triple DES (EDE) in ECB mode 
  33.  *          Input: inblock  - pointer to 64-bit buffer of input data
  34.  *              outblock - pointer to 64-bit buffer for output data
  35.  *      Output: 0 if OK
  36.  *
  37.  *    Synopsis: cbcXcode(inblock,outblock,ivec)
  38.  * Description: encrypts (X=en) or decrypts (X=de) 64-bit inblock to
  39.  *              64-bit outblock using single DES in CBC mode
  40.  *          Input: inblock  - pointer to 64-bit buffer of input data
  41.  *              outblock - pointer to 64-bit buffer for output data
  42.  *              ivec     - pointer to 64-bit initilization vector
  43.  *      Output: 0 if OK
  44.  *
  45.  *    Synopsis: cbc3Xcode(inblock,outblock,ivec)
  46.  * Description: encrypts (X=en) or decrypts (X=de) 64-bit inblock to
  47.  *              64-bit outblock using triple DES (EDE) in CBC mode 
  48.  *          Input: inblock  - pointer to 64-bit buffer of input data
  49.  *              outblock - pointer to 64-bit buffer for output data
  50.  *              ivec     - pointer to 64-bit initilization vector
  51.  *      Output: 0 if OK
  52.  *
  53.  */
  54.  
  55.  
  56. #ifdef __cplusplus
  57. extern "C" {
  58. #endif /* __cplusplus */
  59.  
  60. #if defined(WIN16) 
  61. #define DECL int far pascal
  62. #define UCHAR unsigned char far
  63. #endif /* WIN16 */
  64.  
  65. #if defined(WIN32) || defined(OS2)
  66. #define DECL int pascal
  67. #define UCHAR unsigned char
  68. #endif /* WIN32 */
  69.  
  70. #if !defined(WIN16) && !defined(WIN32) && !defined(OS2)
  71. #define DECL int
  72. #define UCHAR unsigned char
  73. #endif /* !WIN16 && !WIN32 && !OS2 */
  74.  
  75. DECL desinit(UCHAR *key1);
  76. DECL ecbencode(UCHAR *inblock, UCHAR *outblock);
  77. DECL ecbdecode(UCHAR *inblock, UCHAR *outblock);
  78. DECL cbcencode(UCHAR *inblock, UCHAR *outblock, UCHAR *ivec);
  79. DECL cbcdecode(UCHAR *inblock, UCHAR *outblock, UCHAR *ivec);
  80. DECL des3init(UCHAR *key3);
  81. DECL ecb3encode(UCHAR *inblock, UCHAR *outblock);          
  82. DECL ecb3decode(UCHAR *inblock, UCHAR *outblock);
  83. DECL cbc3encode(UCHAR *inblock, UCHAR *outblock, UCHAR *ivec);
  84. DECL cbc3decode(UCHAR *inblock, UCHAR *outblock, UCHAR *ivec);
  85.  
  86. #ifdef __cplusplus
  87. }
  88. #endif /* __cplusplus */
  89. #endif /* _MODULE_DES3_H_ */
  90.