]>
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 | .\" | |
4b8c67d9 | 13 | .TH XCRYPT 3 2017-09-15 "" "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 MK |
24 | .SH DESCRIPTION |
25 | The function | |
63aa9df0 | 26 | .BR passwd2des () |
fea681da MK |
27 | takes a character string |
28 | .I passwd | |
29 | of arbitrary length and fills a character array | |
30 | .I key | |
c13182ef MK |
31 | of length 8. |
32 | The array | |
fea681da | 33 | .I key |
c13182ef MK |
34 | is suitable for use as DES key. |
35 | It has odd parity set in bit 0 of each byte. | |
fea681da MK |
36 | Both other functions described here use this function to turn their |
37 | argument | |
38 | .I passwd | |
39 | into a DES key. | |
dd3568a1 | 40 | .PP |
c13182ef | 41 | The |
63aa9df0 | 42 | .BR xencrypt () |
fea681da MK |
43 | function takes the ASCII character string |
44 | .I secret | |
45 | given in hex, | |
46 | .\" (over the alphabet 0123456789abcdefABCDEF), | |
47 | which must have a length that is a multiple of 16, | |
48 | encrypts it using the DES key derived from | |
49 | .I passwd | |
50 | by | |
63aa9df0 | 51 | .BR passwd2des (), |
fea681da MK |
52 | and outputs the result again in |
53 | .I secret | |
54 | as a hex string | |
55 | .\" (over the alphabet 0123456789abcdef) | |
56 | of the same length. | |
dd3568a1 | 57 | .PP |
fea681da | 58 | The |
63aa9df0 | 59 | .BR xdecrypt () |
fea681da | 60 | function performs the converse operation. |
47297adb | 61 | .SH RETURN VALUE |
fea681da | 62 | The functions |
63aa9df0 | 63 | .BR xencrypt () |
fea681da | 64 | and |
63aa9df0 | 65 | .BR xdecrypt () |
fea681da | 66 | return 1 on success and 0 on error. |
a759cc87 | 67 | .SH VERSIONS |
42604799 | 68 | These functions are available in glibc since version 2.1. |
8d2cf26d ZL |
69 | .SH ATTRIBUTES |
70 | For an explanation of the terms used in this section, see | |
71 | .BR attributes (7). | |
72 | .TS | |
73 | allbox; | |
332d6855 | 74 | lbw37 lb lb |
8d2cf26d ZL |
75 | l l l. |
76 | Interface Attribute Value | |
77 | T{ | |
78 | .BR passwd2des (), | |
79 | .BR xencrypt (), | |
80 | .BR xdecrypt () | |
81 | T} Thread safety MT-Safe | |
82 | .TE | |
847e0d88 | 83 | .sp 1 |
fea681da MK |
84 | .SH BUGS |
85 | The prototypes are missing from the abovementioned include file. | |
47297adb | 86 | .SH SEE ALSO |
fea681da | 87 | .BR cbc_crypt (3) |