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