1setkey(3C)               Standard C Library Functions               setkey(3C)
2
3
4

NAME

6       setkey - set encoding key
7

SYNOPSIS

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

DESCRIPTION

15       The setkey() function provides (rather primitive) access to the hashing
16       algorithm employed by the crypt(3C) function. The argument of  setkey()
17       is an array of length 64 bytes containing only the bytes with numerical
18       value of 0 and 1. If this string is divided into groups of 8, the  low-
19       order  bit  in  each group is ignored; this gives a 56-bit key which is
20       used by the algorithm. This is the key that will be used with the algo‐
21       rithm to encode a string block passed to encrypt(3C).
22

RETURN VALUES

24       No values are returned.
25

ERRORS

27       The setkey() function will fail if:
28
29       ENOSYS    The functionality is not supported on this implementation.
30
31

USAGE

33       In some environments, decoding may not be implemented.  This is related
34       to U.S. Government restrictions on encryption and decryption  routines:
35       the DES decryption algorithm cannot be exported outside the U.S.A. His‐
36       torical practice has been to ship a different version of the encryption
37       library  without  the decryption feature in the routines supplied. Thus
38       the exported version of encrypt() does encoding but not decoding.
39
40
41       Because setkey() does not return a value, applications wishing to check
42       for  errors  should set errno to 0, call setkey(), then test errno and,
43       if it is non-zero, assume an error has occurred.
44

ATTRIBUTES

46       See attributes(5) for descriptions of the following attributes:
47
48
49
50
51       ┌─────────────────────────────┬─────────────────────────────┐
52       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
53       ├─────────────────────────────┼─────────────────────────────┤
54       │Interface Stability          │Standard                     │
55       ├─────────────────────────────┼─────────────────────────────┤
56       │MT-Level                     │Safe                         │
57       └─────────────────────────────┴─────────────────────────────┘
58

SEE ALSO

60       crypt(3C), encrypt(3C), attributes(5), standards(5)
61
62
63
64SunOS 5.11                        14 Aug 2002                       setkey(3C)
Impressum