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