1XCRYPT(3) Linux Programmer's Manual 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
18 The function passwd2des() takes a character string passwd of arbitrary
19 length and fills a character array key of length 8. The array key is
20 suitable for use as DES key. It has odd parity set in bit 0 of each
21 byte. Both other functions described here use this function to turn
22 their argument passwd into a DES key.
23
24 The xencrypt() function takes the ASCII character string secret given
25 in hex, which must have a length that is a multiple of 16, encrypts it
26 using the DES key derived from passwd by passwd2des(), and outputs the
27 result again in secret as a hex string of the same length.
28
29 The xdecrypt() function performs the converse operation.
30
32 The functions xencrypt() and xdecrypt() return 1 on success and 0 on
33 error.
34
36 These routines are present in libc 4.6.27 and later, and in glibc 2.1
37 and later.
38
40 The prototypes are missing from the abovementioned include file.
41
43 cbc_crypt(3)
44
46 This page is part of release 3.25 of the Linux man-pages project. A
47 description of the project, and information about reporting bugs, can
48 be found at http://www.kernel.org/doc/man-pages/.
49
50
51
52 2003-04-04 XCRYPT(3)