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