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