1SETKEY(3P)                 POSIX Programmer's Manual                SETKEY(3P)
2
3
4

PROLOG

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

NAME

12       setkey — set encoding key (CRYPT)
13

SYNOPSIS

15       #include <stdlib.h>
16
17       void setkey(const char *key);
18

DESCRIPTION

20       The setkey() function  provides  access  to  an  implementation-defined
21       encoding  algorithm.  The argument of setkey() is an array of length 64
22       bytes containing only the bytes with numerical value of  0  and  1.  If
23       this  string  is  divided  into  groups of 8, the low-order bit in each
24       group is ignored; this gives a 56-bit key which is used  by  the  algo‐
25       rithm.  This is the key that shall be used with the algorithm to encode
26       a string block passed to encrypt().
27
28       The setkey() function shall not change the setting of errno if success‐
29       ful.  An  application  wishing to check for error situations should set
30       errno to 0 before calling setkey().  If errno is non-zero on return, an
31       error has occurred.
32
33       The setkey() function need not be thread-safe.
34

RETURN VALUE

36       No values are returned.
37

ERRORS

39       The setkey() function shall fail if:
40
41       ENOSYS The functionality is not supported on this implementation.
42
43       The following sections are informative.
44

EXAMPLES

46       None.
47

APPLICATION USAGE

49       Decoding  need  not be implemented in all environments. This is related
50       to government restrictions in some countries on encryption and  decryp‐
51       tion routines. Historical practice has been to ship a different version
52       of the encryption library without the decryption feature  in  the  rou‐
53       tines  supplied.  Thus  the exported version of encrypt() does encoding
54       but not decoding.
55

RATIONALE

57       None.
58

FUTURE DIRECTIONS

60       A future version of the standard may mark this interface as obsolete or
61       remove it altogether.
62

SEE ALSO

64       crypt(), encrypt()
65
66       The Base Definitions volume of POSIX.1‐2017, <stdlib.h>
67
69       Portions  of  this text are reprinted and reproduced in electronic form
70       from IEEE Std 1003.1-2017, Standard for Information Technology --  Por‐
71       table  Operating System Interface (POSIX), The Open Group Base Specifi‐
72       cations Issue 7, 2018 Edition, Copyright (C) 2018 by the  Institute  of
73       Electrical  and  Electronics Engineers, Inc and The Open Group.  In the
74       event of any discrepancy between this version and the original IEEE and
75       The  Open Group Standard, the original IEEE and The Open Group Standard
76       is the referee document. The original Standard can be  obtained  online
77       at http://www.opengroup.org/unix/online.html .
78
79       Any  typographical  or  formatting  errors that appear in this page are
80       most likely to have been introduced during the conversion of the source
81       files  to  man page format. To report such errors, see https://www.ker
82       nel.org/doc/man-pages/reporting_bugs.html .
83
84
85
86IEEE/The Open Group                  2017                           SETKEY(3P)
Impressum