]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" Copyright 2003 walter harms (walter.harms@informatik.uni-oldenburg.de) |
2297bf0e | 2 | .\" |
38f20bb9 | 3 | .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE) |
fea681da | 4 | .\" Distributed under GPL |
38f20bb9 | 5 | .\" %%%LICENSE_END |
e787eaba | 6 | .\" |
fea681da | 7 | .\" this is the 3rd type of interface for cryptographic routines |
02e6bca3 | 8 | .\" 1. encrypt() expects a bit field |
fea681da MK |
9 | .\" 2. cbc_crypt() byte values |
10 | .\" 3. xencrypt() a hexstring | |
11 | .\" to bad to be true :( | |
12 | .\" | |
9ba01802 | 13 | .TH XCRYPT 3 2019-03-06 "" "Linux Programmer's Manual" |
fea681da MK |
14 | .SH NAME |
15 | xencrypt, xdecrypt, passwd2des \- RFS password encryption | |
16 | .SH SYNOPSIS | |
fea681da | 17 | .B "#include <rpc/des_crypt.h>" |
68e4db0a | 18 | .PP |
b9f02710 | 19 | .BI "void passwd2des(char " *passwd ", char *" key ");" |
68e4db0a | 20 | .PP |
b9f02710 | 21 | .BI "int xencrypt(char *" secret ", char *" passwd ");" |
68e4db0a | 22 | .PP |
b9f02710 | 23 | .BI "int xdecrypt(char *" secret ", char *" passwd ");" |
fea681da | 24 | .SH DESCRIPTION |
5fcb9ef9 JD |
25 | .BR WARNING : |
26 | Do not use these functions in new code. They do not achieve | |
27 | any type of acceptable cryptographic security guarantees. | |
28 | .LP | |
fea681da | 29 | The function |
63aa9df0 | 30 | .BR passwd2des () |
fea681da MK |
31 | takes a character string |
32 | .I passwd | |
33 | of arbitrary length and fills a character array | |
34 | .I key | |
c13182ef MK |
35 | of length 8. |
36 | The array | |
fea681da | 37 | .I key |
c13182ef MK |
38 | is suitable for use as DES key. |
39 | It has odd parity set in bit 0 of each byte. | |
fea681da MK |
40 | Both other functions described here use this function to turn their |
41 | argument | |
42 | .I passwd | |
43 | into a DES key. | |
dd3568a1 | 44 | .PP |
c13182ef | 45 | The |
63aa9df0 | 46 | .BR xencrypt () |
fea681da MK |
47 | function takes the ASCII character string |
48 | .I secret | |
49 | given in hex, | |
50 | .\" (over the alphabet 0123456789abcdefABCDEF), | |
51 | which must have a length that is a multiple of 16, | |
52 | encrypts it using the DES key derived from | |
53 | .I passwd | |
54 | by | |
63aa9df0 | 55 | .BR passwd2des (), |
fea681da MK |
56 | and outputs the result again in |
57 | .I secret | |
58 | as a hex string | |
59 | .\" (over the alphabet 0123456789abcdef) | |
60 | of the same length. | |
dd3568a1 | 61 | .PP |
fea681da | 62 | The |
63aa9df0 | 63 | .BR xdecrypt () |
fea681da | 64 | function performs the converse operation. |
47297adb | 65 | .SH RETURN VALUE |
fea681da | 66 | The functions |
63aa9df0 | 67 | .BR xencrypt () |
fea681da | 68 | and |
63aa9df0 | 69 | .BR xdecrypt () |
fea681da | 70 | return 1 on success and 0 on error. |
a759cc87 | 71 | .SH VERSIONS |
42604799 | 72 | These functions are available in glibc since version 2.1. |
8d2cf26d ZL |
73 | .SH ATTRIBUTES |
74 | For an explanation of the terms used in this section, see | |
75 | .BR attributes (7). | |
76 | .TS | |
77 | allbox; | |
332d6855 | 78 | lbw37 lb lb |
8d2cf26d ZL |
79 | l l l. |
80 | Interface Attribute Value | |
81 | T{ | |
82 | .BR passwd2des (), | |
83 | .BR xencrypt (), | |
84 | .BR xdecrypt () | |
85 | T} Thread safety MT-Safe | |
86 | .TE | |
847e0d88 | 87 | .sp 1 |
fea681da MK |
88 | .SH BUGS |
89 | The prototypes are missing from the abovementioned include file. | |
47297adb | 90 | .SH SEE ALSO |
fea681da | 91 | .BR cbc_crypt (3) |