|
Packit |
7cfc04 |
.\" Copyright 2003 walter harms (walter.harms@informatik.uni-oldenburg.de)
|
|
Packit |
7cfc04 |
.\"
|
|
Packit |
7cfc04 |
.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
|
|
Packit |
7cfc04 |
.\" Distributed under GPL
|
|
Packit |
7cfc04 |
.\" %%%LICENSE_END
|
|
Packit |
7cfc04 |
.\"
|
|
Packit |
7cfc04 |
.\" this is the 3rd type of interface for cryptographic routines
|
|
Packit |
7cfc04 |
.\" 1. encrypt() expects a bit field
|
|
Packit |
7cfc04 |
.\" 2. cbc_crypt() byte values
|
|
Packit |
7cfc04 |
.\" 3. xencrypt() a hexstring
|
|
Packit |
7cfc04 |
.\" to bad to be true :(
|
|
Packit |
7cfc04 |
.\"
|
|
Packit |
7cfc04 |
.TH XCRYPT 3 2017-09-15 "" "Linux Programmer's Manual"
|
|
Packit |
7cfc04 |
.SH NAME
|
|
Packit |
7cfc04 |
xencrypt, xdecrypt, passwd2des \- RFS password encryption
|
|
Packit |
7cfc04 |
.SH SYNOPSIS
|
|
Packit |
7cfc04 |
.B "#include <rpc/des_crypt.h>"
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
.BI "void passwd2des(char " *passwd ", char *" key ");"
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
.BI "int xencrypt(char *" secret ", char *" passwd ");"
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
.BI "int xdecrypt(char *" secret ", char *" passwd ");"
|
|
Packit |
7cfc04 |
.SH DESCRIPTION
|
|
Packit |
7cfc04 |
The function
|
|
Packit |
7cfc04 |
.BR passwd2des ()
|
|
Packit |
7cfc04 |
takes a character string
|
|
Packit |
7cfc04 |
.I passwd
|
|
Packit |
7cfc04 |
of arbitrary length and fills a character array
|
|
Packit |
7cfc04 |
.I key
|
|
Packit |
7cfc04 |
of length 8.
|
|
Packit |
7cfc04 |
The array
|
|
Packit |
7cfc04 |
.I key
|
|
Packit |
7cfc04 |
is suitable for use as DES key.
|
|
Packit |
7cfc04 |
It has odd parity set in bit 0 of each byte.
|
|
Packit |
7cfc04 |
Both other functions described here use this function to turn their
|
|
Packit |
7cfc04 |
argument
|
|
Packit |
7cfc04 |
.I passwd
|
|
Packit |
7cfc04 |
into a DES key.
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
The
|
|
Packit |
7cfc04 |
.BR xencrypt ()
|
|
Packit |
7cfc04 |
function takes the ASCII character string
|
|
Packit |
7cfc04 |
.I secret
|
|
Packit |
7cfc04 |
given in hex,
|
|
Packit |
7cfc04 |
.\" (over the alphabet 0123456789abcdefABCDEF),
|
|
Packit |
7cfc04 |
which must have a length that is a multiple of 16,
|
|
Packit |
7cfc04 |
encrypts it using the DES key derived from
|
|
Packit |
7cfc04 |
.I passwd
|
|
Packit |
7cfc04 |
by
|
|
Packit |
7cfc04 |
.BR passwd2des (),
|
|
Packit |
7cfc04 |
and outputs the result again in
|
|
Packit |
7cfc04 |
.I secret
|
|
Packit |
7cfc04 |
as a hex string
|
|
Packit |
7cfc04 |
.\" (over the alphabet 0123456789abcdef)
|
|
Packit |
7cfc04 |
of the same length.
|
|
Packit |
7cfc04 |
.PP
|
|
Packit |
7cfc04 |
The
|
|
Packit |
7cfc04 |
.BR xdecrypt ()
|
|
Packit |
7cfc04 |
function performs the converse operation.
|
|
Packit |
7cfc04 |
.SH RETURN VALUE
|
|
Packit |
7cfc04 |
The functions
|
|
Packit |
7cfc04 |
.BR xencrypt ()
|
|
Packit |
7cfc04 |
and
|
|
Packit |
7cfc04 |
.BR xdecrypt ()
|
|
Packit |
7cfc04 |
return 1 on success and 0 on error.
|
|
Packit |
7cfc04 |
.SH VERSIONS
|
|
Packit |
7cfc04 |
These functions are available in glibc since version 2.1.
|
|
Packit |
7cfc04 |
.SH ATTRIBUTES
|
|
Packit |
7cfc04 |
For an explanation of the terms used in this section, see
|
|
Packit |
7cfc04 |
.BR attributes (7).
|
|
Packit |
7cfc04 |
.TS
|
|
Packit |
7cfc04 |
allbox;
|
|
Packit |
7cfc04 |
lbw37 lb lb
|
|
Packit |
7cfc04 |
l l l.
|
|
Packit |
7cfc04 |
Interface Attribute Value
|
|
Packit |
7cfc04 |
T{
|
|
Packit |
7cfc04 |
.BR passwd2des (),
|
|
Packit |
7cfc04 |
.BR xencrypt (),
|
|
Packit |
7cfc04 |
.BR xdecrypt ()
|
|
Packit |
7cfc04 |
T} Thread safety MT-Safe
|
|
Packit |
7cfc04 |
.TE
|
|
Packit |
7cfc04 |
.sp 1
|
|
Packit |
7cfc04 |
.SH BUGS
|
|
Packit |
7cfc04 |
The prototypes are missing from the abovementioned include file.
|
|
Packit |
7cfc04 |
.SH SEE ALSO
|
|
Packit |
7cfc04 |
.BR cbc_crypt (3)
|
|
Packit |
7cfc04 |
.SH COLOPHON
|
|
Packit |
7cfc04 |
This page is part of release 4.15 of the Linux
|
|
Packit |
7cfc04 |
.I man-pages
|
|
Packit |
7cfc04 |
project.
|
|
Packit |
7cfc04 |
A description of the project,
|
|
Packit |
7cfc04 |
information about reporting bugs,
|
|
Packit |
7cfc04 |
and the latest version of this page,
|
|
Packit |
7cfc04 |
can be found at
|
|
Packit |
7cfc04 |
\%https://www.kernel.org/doc/man\-pages/.
|