xrootd
PC1.hh
Go to the documentation of this file.
00001 /* ----------------------------------------------------------------------- *
00002  *                                                                         *
00003  * PC1.hh                                                                  *
00004  *                                                                         *
00005  *                                                                         *
00006  * C++ adaptation of PC1 implementation written by Alexander PUKALL 1991.  *
00007  *                                                                         *
00008  * Reference:  http://membres.lycos.fr/pc1/                                *
00009  *                                                                         *
00010  * Description:                                                            *
00011  * PC1 Cipher Algorithm (Pukall Cipher 1) for encryption/decryption.       *
00012  * One-way hash for password encryption also provided.                     *
00013  *                                                                         *
00014  * Key length is 256 bits                                                  *
00015  *                                                                         *
00016  * Free code no restriction to use please include the name of the Author   *
00017  * in the final software                                                   *
00018  * Tested with Turbo C 2.0 for DOS and Microsoft Visual C++ 5.0 for Win 32 *
00019  *                                                                         *
00020  * Adapted by G. Ganis (g.ganis@cern.ch), January 2005                     *
00021  * ----------------------------------------------------------------------- */
00022 
00023 // Basic length (of key, output hash, ...) in bytes
00024 #define kPC1LENGTH 32
00025 
00026 //
00027 // Encode / Decode functions
00028 int PC1Encrypt(const char *, int, const char *, int, char *);
00029 int PC1Decrypt(const char *, int, const char *, int, char *);
00030 
00031 //
00032 // One-way hash
00033 int PC1HashFun(const char *, int, const char *, int, int, char *);