]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/xcrypt.3
Formatting fix
[thirdparty/man-pages.git] / man3 / xcrypt.3
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 .\"
9 .TH xcrypt 3 2003-04-04 "" "RPC cryptography"
10 .SH NAME
11 xencrypt, xdecrypt, passwd2des \- RFS password encryption
12 .SH SYNOPSIS
13 .sp
14 .B "#include <rpc/des_crypt.h>"
15 .sp
16 .BI "void passwd2des (char " *passwd ", char *" key ");"
17 .sp
18 .BI "int xencrypt (char *" secret ", char *" passwd ");"
19 .sp
20 .BI "int xdecrypt (char *" secret ", char *" passwd ");"
21 .sp
22 .SH DESCRIPTION
23 The function
24 .BR passwd2des ()
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
38 .BR xencrypt ()
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
47 .BR passwd2des (),
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
55 .BR xdecrypt ()
56 function performs the converse operation.
57 .SH "RETURN VALUE"
58 The functions
59 .BR xencrypt ()
60 and
61 .BR xdecrypt ()
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)