2004-11-03 13:51:07 +00:00
|
|
|
.\" Copyright 2003 walter harms (walter.harms@informatik.uni-oldenburg.de)
|
|
|
|
.\" Distributed under GPL
|
|
|
|
.\" this is the 3rd type of interface for cryptographic routines
|
|
|
|
.\" 1. encrypt() expects a bitfield
|
|
|
|
.\" 2. cbc_crypt() byte values
|
|
|
|
.\" 3. xencrypt() a hexstring
|
|
|
|
.\" to bad to be true :(
|
|
|
|
.\"
|
|
|
|
.TH xcrypt 3 2003-04-04 "" "RPC cryptography"
|
|
|
|
.SH NAME
|
|
|
|
xencrypt, xdecrypt, passwd2des \- RFS password encryption
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.sp
|
|
|
|
.B "#include <rpc/des_crypt.h>"
|
|
|
|
.sp
|
2006-01-14 17:14:10 +00:00
|
|
|
.BI "void passwd2des (char " *passwd ", char *" key ");"
|
2004-11-03 13:51:07 +00:00
|
|
|
.sp
|
2006-01-14 17:14:10 +00:00
|
|
|
.BI "int xencrypt (char *" secret ", char *" passwd ");"
|
2004-11-03 13:51:07 +00:00
|
|
|
.sp
|
2006-01-14 17:14:10 +00:00
|
|
|
.BI "int xdecrypt (char *" secret ", char *" passwd ");"
|
2004-11-03 13:51:07 +00:00
|
|
|
.sp
|
|
|
|
.SH DESCRIPTION
|
|
|
|
The function
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR passwd2des ()
|
2004-11-03 13:51:07 +00:00
|
|
|
takes a character string
|
|
|
|
.I passwd
|
|
|
|
of arbitrary length and fills a character array
|
|
|
|
.I key
|
|
|
|
of length 8. The array
|
|
|
|
.I key
|
|
|
|
is suitable for use as DES key. It has odd parity set in bit 0 of each byte.
|
|
|
|
Both other functions described here use this function to turn their
|
|
|
|
argument
|
|
|
|
.I passwd
|
|
|
|
into a DES key.
|
|
|
|
.LP
|
|
|
|
The
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR xencrypt ()
|
2004-11-03 13:51:07 +00:00
|
|
|
function takes the ASCII character string
|
|
|
|
.I secret
|
|
|
|
given in hex,
|
|
|
|
.\" (over the alphabet 0123456789abcdefABCDEF),
|
|
|
|
which must have a length that is a multiple of 16,
|
|
|
|
encrypts it using the DES key derived from
|
|
|
|
.I passwd
|
|
|
|
by
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR passwd2des (),
|
2004-11-03 13:51:07 +00:00
|
|
|
and outputs the result again in
|
|
|
|
.I secret
|
|
|
|
as a hex string
|
|
|
|
.\" (over the alphabet 0123456789abcdef)
|
|
|
|
of the same length.
|
|
|
|
.LP
|
|
|
|
The
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR xdecrypt ()
|
2004-11-03 13:51:07 +00:00
|
|
|
function performs the converse operation.
|
|
|
|
.SH "RETURN VALUE"
|
|
|
|
The functions
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR xencrypt ()
|
2004-11-03 13:51:07 +00:00
|
|
|
and
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR xdecrypt ()
|
2004-11-03 13:51:07 +00:00
|
|
|
return 1 on success and 0 on error.
|
|
|
|
.SH AVAILABILITY
|
|
|
|
These routines are present in libc 4.6.27 and later, and in
|
|
|
|
glibc 2.1 and later.
|
|
|
|
.SH BUGS
|
|
|
|
The prototypes are missing from the abovementioned include file.
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR cbc_crypt (3)
|