]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/xcrypt.3
getent.1, intro.1, time.1, _exit.2, _syscall.2, accept.2, access.2, acct.2, adjtimex...
[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 bit field
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 "" "Linux Programmer's Manual"
10 .SH NAME
11 xencrypt, xdecrypt, passwd2des \- RFS password encryption
12 .SH SYNOPSIS
13 .B "#include <rpc/des_crypt.h>"
14 .sp
15 .BI "void passwd2des(char " *passwd ", char *" key ");"
16 .sp
17 .BI "int xencrypt(char *" secret ", char *" passwd ");"
18 .sp
19 .BI "int xdecrypt(char *" secret ", char *" passwd ");"
20 .SH DESCRIPTION
21 The function
22 .BR passwd2des ()
23 takes a character string
24 .I passwd
25 of arbitrary length and fills a character array
26 .I key
27 of length 8.
28 The array
29 .I key
30 is suitable for use as DES key.
31 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 VERSIONS
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)