xrootd
PC3.hh
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------- *
2  * *
3  * PC3.cc *
4  * *
5  * C++ adaptation of PKEP implementation written by Alexander PUKALL 1991. *
6  * *
7  * PKEP ( Pukall Key Exchange Protocol (c) Alexander PUKALL 1997 *
8  * *
9  * Reference: http://membres.lycos.fr/pc1/ *
10  * *
11  * Description: *
12  * Algorithm allowing the secure exchange of a random password using the *
13  * PC3 cipher for random number generation based on a 160-bit seed. *
14  * Initialization creates private and public parts; exponentiation builds *
15  * the key using the received public part. *
16  * *
17  * Created Key length is 256 bits (32 bytes). Input random string can be *
18  * up to 256 bytes, but 32 or 64 should be typically enough. *
19  * Buffers for private and public parts should be of length kPC3SLEN *
20  * *
21  * Fro the author: *
22  * Free code no restriction to use please include the name of the Author *
23  * in the final software *
24  * *
25  * Adapted by G. Ganis (g.ganis@cern.ch), February 2005 *
26  * ----------------------------------------------------------------------- */
27 
28 typedef unsigned char uchar;
29 
30 #define kPC3SLEN 33
31 #define kPC3MAXRPWLEN 256
32 #define kPC3MINBITS 128
33 #define kPC3KEYLEN 32
34 
35 int PC3InitDiPuk(uchar *rpwd, unsigned int lrpw, uchar *pub, uchar *priv);
36 int PC3DiPukExp(uchar *pub, uchar *priv, uchar *key);