1ENCRYPT(3P) POSIX Programmer's Manual ENCRYPT(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 encrypt — encoding function (CRYPT)
13
15 #include <unistd.h>
16
17 void encrypt(char block[64], int edflag);
18
20 The encrypt() function shall provide access to an implementation-
21 defined encoding algorithm. The key generated by setkey() is used to
22 encrypt the string block with encrypt().
23
24 The block argument to encrypt() shall be an array of length 64 bytes
25 containing only the bytes with values of 0 and 1. The array is modified
26 in place to a similar array using the key set by setkey(). If edflag
27 is 0, the argument is encoded. If edflag is 1, the argument may be
28 decoded (see the APPLICATION USAGE section); if the argument is not
29 decoded, errno shall be set to [ENOSYS].
30
31 The encrypt() function shall not change the setting of errno if suc‐
32 cessful. An application wishing to check for error situations should
33 set errno to 0 before calling encrypt(). If errno is non-zero on
34 return, an error has occurred.
35
36 The encrypt() function need not be thread-safe.
37
39 The encrypt() function shall not return a value.
40
42 The encrypt() function shall fail if:
43
44 ENOSYS The functionality is not supported on this implementation.
45
46 The following sections are informative.
47
49 None.
50
52 Historical implementations of the encrypt() function used a rather
53 primitive encoding algorithm.
54
55 In some environments, decoding might not be implemented. This is
56 related to some Government restrictions on encryption and decryption
57 routines. Historical practice has been to ship a different version of
58 the encryption library without the decryption feature in the routines
59 supplied. Thus the exported version of encrypt() does encoding but not
60 decoding.
61
63 None.
64
66 A future version of the standard may mark this interface as obsolete or
67 remove it altogether.
68
70 crypt(), setkey()
71
72 The Base Definitions volume of POSIX.1‐2017, <unistd.h>
73
75 Portions of this text are reprinted and reproduced in electronic form
76 from IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
77 table Operating System Interface (POSIX), The Open Group Base Specifi‐
78 cations Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of
79 Electrical and Electronics Engineers, Inc and The Open Group. In the
80 event of any discrepancy between this version and the original IEEE and
81 The Open Group Standard, the original IEEE and The Open Group Standard
82 is the referee document. The original Standard can be obtained online
83 at http://www.opengroup.org/unix/online.html .
84
85 Any typographical or formatting errors that appear in this page are
86 most likely to have been introduced during the conversion of the source
87 files to man page format. To report such errors, see https://www.ker‐
88 nel.org/doc/man-pages/reporting_bugs.html .
89
90
91
92IEEE/The Open Group 2017 ENCRYPT(3P)