]>
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 | |
fea681da MK |
13 | .B "#include <rpc/des_crypt.h>" |
14 | .sp | |
b9f02710 | 15 | .BI "void passwd2des(char " *passwd ", char *" key ");" |
fea681da | 16 | .sp |
b9f02710 | 17 | .BI "int xencrypt(char *" secret ", char *" passwd ");" |
fea681da | 18 | .sp |
b9f02710 | 19 | .BI "int xdecrypt(char *" secret ", char *" passwd ");" |
fea681da MK |
20 | .SH DESCRIPTION |
21 | The function | |
63aa9df0 | 22 | .BR passwd2des () |
fea681da MK |
23 | takes a character string |
24 | .I passwd | |
25 | of arbitrary length and fills a character array | |
26 | .I key | |
27 | of length 8. The array | |
28 | .I key | |
29 | is suitable for use as DES key. It has odd parity set in bit 0 of each byte. | |
30 | Both other functions described here use this function to turn their | |
31 | argument | |
32 | .I passwd | |
33 | into a DES key. | |
34 | .LP | |
35 | The | |
63aa9df0 | 36 | .BR xencrypt () |
fea681da MK |
37 | function takes the ASCII character string |
38 | .I secret | |
39 | given in hex, | |
40 | .\" (over the alphabet 0123456789abcdefABCDEF), | |
41 | which must have a length that is a multiple of 16, | |
42 | encrypts it using the DES key derived from | |
43 | .I passwd | |
44 | by | |
63aa9df0 | 45 | .BR passwd2des (), |
fea681da MK |
46 | and outputs the result again in |
47 | .I secret | |
48 | as a hex string | |
49 | .\" (over the alphabet 0123456789abcdef) | |
50 | of the same length. | |
51 | .LP | |
52 | The | |
63aa9df0 | 53 | .BR xdecrypt () |
fea681da MK |
54 | function performs the converse operation. |
55 | .SH "RETURN VALUE" | |
56 | The functions | |
63aa9df0 | 57 | .BR xencrypt () |
fea681da | 58 | and |
63aa9df0 | 59 | .BR xdecrypt () |
fea681da MK |
60 | return 1 on success and 0 on error. |
61 | .SH AVAILABILITY | |
62 | These routines are present in libc 4.6.27 and later, and in | |
63 | glibc 2.1 and later. | |
64 | .SH BUGS | |
65 | The prototypes are missing from the abovementioned include file. | |
66 | .SH "SEE ALSO" | |
67 | .BR cbc_crypt (3) |