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

NAME

6       setkey - set encoding key (CRYPT)
7

SYNOPSIS

9       #include <stdlib.h>
10
11       void setkey(const char *key);
12
13

DESCRIPTION

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

RETURN VALUE

32       No values are returned.
33

ERRORS

35       The setkey() function shall fail if:
36
37       ENOSYS The functionality is not supported on this implementation.
38
39
40       The following sections are informative.
41

EXAMPLES

43       None.
44

APPLICATION USAGE

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

RATIONALE

54       None.
55

FUTURE DIRECTIONS

57       None.
58

SEE ALSO

60       crypt()   ,   encrypt()   ,   the   Base    Definitions    volume    of
61       IEEE Std 1003.1-2001, <stdlib.h>
62
64       Portions  of  this text are reprinted and reproduced in electronic form
65       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
66       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
67       Specifications Issue 6, Copyright (C) 2001-2003  by  the  Institute  of
68       Electrical  and  Electronics  Engineers, Inc and The Open Group. In the
69       event of any discrepancy between this version and the original IEEE and
70       The  Open Group Standard, the original IEEE and The Open Group Standard
71       is the referee document. The original Standard can be  obtained  online
72       at http://www.opengroup.org/unix/online.html .
73
74
75
76IEEE/The Open Group                  2003                            SETKEY(P)
Impressum