]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright 2003 walter harms (walter.harms@informatik.uni-oldenburg.de) |
2 | .\" Distributed under GPL | |
3 | .\" this is the 3rd type of interface for cryptographic routines | |
4 | .\" 1. encrypt() expects a bitfield | |
5 | .\" 2. cbc_crypt() byte values | |
6 | .\" 3. xencrypt() a hexstring | |
7 | .\" to bad to be true :( | |
8 | .\" | |
5bcbc378 | 9 | .TH XCRYPT 3 2003-04-04 "" "RPC cryptography" |
fea681da MK |
10 | .SH NAME |
11 | xencrypt, xdecrypt, passwd2des \- RFS password encryption | |
12 | .SH SYNOPSIS | |
13 | .sp | |
14 | .B "#include <rpc/des_crypt.h>" | |
15 | .sp | |
b9f02710 | 16 | .BI "void passwd2des(char " *passwd ", char *" key ");" |
fea681da | 17 | .sp |
b9f02710 | 18 | .BI "int xencrypt(char *" secret ", char *" passwd ");" |
fea681da | 19 | .sp |
b9f02710 | 20 | .BI "int xdecrypt(char *" secret ", char *" passwd ");" |
fea681da MK |
21 | .sp |
22 | .SH DESCRIPTION | |
23 | The function | |
63aa9df0 | 24 | .BR passwd2des () |
fea681da MK |
25 | takes a character string |
26 | .I passwd | |
27 | of arbitrary length and fills a character array | |
28 | .I key | |
29 | of length 8. The array | |
30 | .I key | |
31 | is suitable for use as DES key. It has odd parity set in bit 0 of each byte. | |
32 | Both other functions described here use this function to turn their | |
33 | argument | |
34 | .I passwd | |
35 | into a DES key. | |
36 | .LP | |
37 | The | |
63aa9df0 | 38 | .BR xencrypt () |
fea681da MK |
39 | function takes the ASCII character string |
40 | .I secret | |
41 | given in hex, | |
42 | .\" (over the alphabet 0123456789abcdefABCDEF), | |
43 | which must have a length that is a multiple of 16, | |
44 | encrypts it using the DES key derived from | |
45 | .I passwd | |
46 | by | |
63aa9df0 | 47 | .BR passwd2des (), |
fea681da MK |
48 | and outputs the result again in |
49 | .I secret | |
50 | as a hex string | |
51 | .\" (over the alphabet 0123456789abcdef) | |
52 | of the same length. | |
53 | .LP | |
54 | The | |
63aa9df0 | 55 | .BR xdecrypt () |
fea681da MK |
56 | function performs the converse operation. |
57 | .SH "RETURN VALUE" | |
58 | The functions | |
63aa9df0 | 59 | .BR xencrypt () |
fea681da | 60 | and |
63aa9df0 | 61 | .BR xdecrypt () |
fea681da MK |
62 | return 1 on success and 0 on error. |
63 | .SH AVAILABILITY | |
64 | These routines are present in libc 4.6.27 and later, and in | |
65 | glibc 2.1 and later. | |
66 | .SH BUGS | |
67 | The prototypes are missing from the abovementioned include file. | |
68 | .SH "SEE ALSO" | |
69 | .BR cbc_crypt (3) |