man-pages/man3/xcrypt.3.html
2021-03-31 01:06:50 +01:00

164 lines
3.5 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of XCRYPT</TITLE>
</HEAD><BODY>
<H1>XCRYPT</H1>
Section: Linux Programmer's Manual (3)<BR>Updated: 2019-03-06<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
xencrypt, xdecrypt, passwd2des - RFS password encryption
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>#include &lt;<A HREF="file:///usr/include/rpc/des_crypt.h">rpc/des_crypt.h</A>&gt;</B>
<P>
<B>void passwd2des(char </B><I>*passwd</I><B>, char *</B><I>key</I><B>);</B>
<P>
<B>int xencrypt(char *</B><I>secret</I><B>, char *</B><I>passwd</I><B>);</B>
<P>
<B>int xdecrypt(char *</B><I>secret</I><B>, char *</B><I>passwd</I><B>);</B>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>WARNING</B>:
Do not use these functions in new code. They do not achieve
any type of acceptable cryptographic security guarantees.
<P>
The function
<B>passwd2des</B>()
takes a character string
<I>passwd</I>
of arbitrary length and fills a character array
<I>key</I>
of length 8.
The array
<I>key</I>
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</I>
into a DES key.
<P>
The
<B>xencrypt</B>()
function takes the ASCII character string
<I>secret</I>
given in hex,
which must have a length that is a multiple of 16,
encrypts it using the DES key derived from
<I>passwd</I>
by
<B>passwd2des</B>(),
and outputs the result again in
<I>secret</I>
as a hex string
of the same length.
<P>
The
<B>xdecrypt</B>()
function performs the converse operation.
<A NAME="lbAE">&nbsp;</A>
<H2>RETURN VALUE</H2>
The functions
<B>xencrypt</B>()
and
<B>xdecrypt</B>()
return 1 on success and 0 on error.
<A NAME="lbAF">&nbsp;</A>
<H2>VERSIONS</H2>
These functions are available in glibc since version 2.1.
<A NAME="lbAG">&nbsp;</A>
<H2>ATTRIBUTES</H2>
For an explanation of the terms used in this section, see
<B><A HREF="/cgi-bin/man/man2html?7+attributes">attributes</A></B>(7).
<TABLE BORDER>
<TR VALIGN=top><TD><B>Interface</B></TD><TD><B>Attribute</B></TD><TD><B>Value</B><BR></TD></TR>
<TR VALIGN=top><TD>
<B>passwd2des</B>(),
<B>xencrypt</B>(),
<B>xdecrypt</B>()
</TD><TD>Thread safety</TD><TD>MT-Safe<BR></TD></TR>
</TABLE>
<P>
<A NAME="lbAH">&nbsp;</A>
<H2>BUGS</H2>
The prototypes are missing from the abovementioned include file.
<A NAME="lbAI">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?3+cbc_crypt">cbc_crypt</A></B>(3)
<A NAME="lbAJ">&nbsp;</A>
<H2>COLOPHON</H2>
This page is part of release 5.05 of the Linux
<I>man-pages</I>
project.
A description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
<DT id="2"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="3"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="4"><A HREF="#lbAE">RETURN VALUE</A><DD>
<DT id="5"><A HREF="#lbAF">VERSIONS</A><DD>
<DT id="6"><A HREF="#lbAG">ATTRIBUTES</A><DD>
<DT id="7"><A HREF="#lbAH">BUGS</A><DD>
<DT id="8"><A HREF="#lbAI">SEE ALSO</A><DD>
<DT id="9"><A HREF="#lbAJ">COLOPHON</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:06:00 GMT, March 31, 2021
</BODY>
</HTML>