1XCRYPT(3) Library Functions Manual XCRYPT(3)
2
3
4
6 xencrypt, xdecrypt, passwd2des - RFS password encryption
7
9 Standard C library (libc, -lc)
10
12 #include <rpc/des_crypt.h>
13
14 void passwd2des(char *passwd, char *key);
15
16 int xencrypt(char *secret, char *passwd);
17 int xdecrypt(char *secret, char *passwd);
18
20 WARNING: Do not use these functions in new code. They do not achieve
21 any type of acceptable cryptographic security guarantees.
22
23 The function passwd2des() takes a character string passwd of arbitrary
24 length and fills a character array key of length 8. The array key is
25 suitable for use as DES key. It has odd parity set in bit 0 of each
26 byte. Both other functions described here use this function to turn
27 their argument passwd into a DES key.
28
29 The xencrypt() function takes the ASCII character string secret given
30 in hex, which must have a length that is a multiple of 16, encrypts it
31 using the DES key derived from passwd by passwd2des(), and outputs the
32 result again in secret as a hex string of the same length.
33
34 The xdecrypt() function performs the converse operation.
35
37 The functions xencrypt() and xdecrypt() return 1 on success and 0 on
38 error.
39
41 For an explanation of the terms used in this section, see at‐
42 tributes(7).
43
44 ┌────────────────────────────────────────────┬───────────────┬─────────┐
45 │Interface │ Attribute │ Value │
46 ├────────────────────────────────────────────┼───────────────┼─────────┤
47 │passwd2des(), xencrypt(), xdecrypt() │ Thread safety │ MT-Safe │
48 └────────────────────────────────────────────┴───────────────┴─────────┘
49
51 These functions are available since glibc 2.1.
52
54 The prototypes are missing from the abovementioned include file.
55
57 cbc_crypt(3)
58
59
60
61Linux man-pages 6.05 2023-07-20 XCRYPT(3)