]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/xcrypt.3
stdarg.3: SEE ALSO: add vprintf(3), vscanf(3), vsyslog(3)
[thirdparty/man-pages.git] / man3 / xcrypt.3
CommitLineData
fea681da 1.\" Copyright 2003 walter harms (walter.harms@informatik.uni-oldenburg.de)
2297bf0e 2.\"
38f20bb9 3.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
fea681da 4.\" Distributed under GPL
38f20bb9 5.\" %%%LICENSE_END
e787eaba 6.\"
fea681da 7.\" this is the 3rd type of interface for cryptographic routines
02e6bca3 8.\" 1. encrypt() expects a bit field
fea681da
MK
9.\" 2. cbc_crypt() byte values
10.\" 3. xencrypt() a hexstring
11.\" to bad to be true :(
12.\"
9ba01802 13.TH XCRYPT 3 2019-03-06 "" "Linux Programmer's Manual"
fea681da
MK
14.SH NAME
15xencrypt, xdecrypt, passwd2des \- RFS password encryption
16.SH SYNOPSIS
fea681da 17.B "#include <rpc/des_crypt.h>"
68e4db0a 18.PP
b9f02710 19.BI "void passwd2des(char " *passwd ", char *" key ");"
68e4db0a 20.PP
b9f02710 21.BI "int xencrypt(char *" secret ", char *" passwd ");"
68e4db0a 22.PP
b9f02710 23.BI "int xdecrypt(char *" secret ", char *" passwd ");"
fea681da 24.SH DESCRIPTION
5fcb9ef9
JD
25.BR WARNING :
26Do not use these functions in new code. They do not achieve
27any type of acceptable cryptographic security guarantees.
28.LP
fea681da 29The function
63aa9df0 30.BR passwd2des ()
fea681da
MK
31takes a character string
32.I passwd
33of arbitrary length and fills a character array
34.I key
c13182ef
MK
35of length 8.
36The array
fea681da 37.I key
c13182ef
MK
38is suitable for use as DES key.
39It has odd parity set in bit 0 of each byte.
fea681da
MK
40Both other functions described here use this function to turn their
41argument
42.I passwd
43into a DES key.
dd3568a1 44.PP
c13182ef 45The
63aa9df0 46.BR xencrypt ()
fea681da
MK
47function takes the ASCII character string
48.I secret
49given in hex,
50.\" (over the alphabet 0123456789abcdefABCDEF),
51which must have a length that is a multiple of 16,
52encrypts it using the DES key derived from
53.I passwd
54by
63aa9df0 55.BR passwd2des (),
fea681da
MK
56and outputs the result again in
57.I secret
58as a hex string
59.\" (over the alphabet 0123456789abcdef)
60of the same length.
dd3568a1 61.PP
fea681da 62The
63aa9df0 63.BR xdecrypt ()
fea681da 64function performs the converse operation.
47297adb 65.SH RETURN VALUE
fea681da 66The functions
63aa9df0 67.BR xencrypt ()
fea681da 68and
63aa9df0 69.BR xdecrypt ()
fea681da 70return 1 on success and 0 on error.
a759cc87 71.SH VERSIONS
42604799 72These functions are available in glibc since version 2.1.
8d2cf26d
ZL
73.SH ATTRIBUTES
74For an explanation of the terms used in this section, see
75.BR attributes (7).
76.TS
77allbox;
332d6855 78lbw37 lb lb
8d2cf26d
ZL
79l l l.
80Interface Attribute Value
81T{
82.BR passwd2des (),
83.BR xencrypt (),
84.BR xdecrypt ()
85T} Thread safety MT-Safe
86.TE
847e0d88 87.sp 1
fea681da
MK
88.SH BUGS
89The prototypes are missing from the abovementioned include file.
47297adb 90.SH SEE ALSO
fea681da 91.BR cbc_crypt (3)