1XCRYPT(3) RPC cryptography XCRYPT(3)
2
3
4
6 xencrypt, xdecrypt, passwd2des - RFS password encryption
7
9 #include <rpc/des_crypt.h>
10
11 void passwd2des (char *passwd, char *key);
12
13 int xencrypt (char *secret, char *passwd);
14
15 int xdecrypt (char *secret, char *passwd);
16
17
19 The function passwd2des() takes a character string passwd of arbitrary
20 length and fills a character array key of length 8. The array key is
21 suitable for use as DES key. It has odd parity set in bit 0 of each
22 byte. Both other functions described here use this function to turn
23 their argument passwd into a DES key.
24
25 The xencrypt() function takes the ASCII character string secret given
26 in hex, which must have a length that is a multiple of 16, encrypts it
27 using the DES key derived from passwd by passwd2des(), and outputs the
28 result again in secret as a hex string of the same length.
29
30 The xdecrypt() function performs the converse operation.
31
33 The functions xencrypt() and xdecrypt() return 1 on success and 0 on
34 error.
35
37 These routines are present in libc 4.6.27 and later, and in glibc 2.1
38 and later.
39
41 The prototypes are missing from the abovementioned include file.
42
44 cbc_crypt(3)
45
46
47
48 2003-04-04 XCRYPT(3)