1encrypt(3C) Standard C Library Functions encrypt(3C)
2
3
4
6 encrypt - encoding function
7
9 #include <crypt.h>
10
11 void encrypt(char block[64], int edflag);
12
13
14 Standard conforming
15 #include <unistd.h>
16
17 void encrypt(char block[64], int edflag);
18
19
21 The encrypt() function provides (rather primitive) access to the hash‐
22 ing algorithm employed by the crypt(3C) function. The key generated by
23 setkey(3C) is used to encrypt the string block with encrypt().
24
25
26 The block argument to encrypt() is an array of length 64 bytes contain‐
27 ing only the bytes with numerical value of 0 and 1. The array is modi‐
28 fied in place to a similar array using the key set by setkey(3C). If
29 edflag is 0, the argument is encoded. If edflag is 1, the argument may
30 be decoded (see the USAGE section below); if the argument is not
31 decoded, errno will be set to ENOSYS.
32
34 The encrypt() function returns no value.
35
37 The encrypt() function will fail if:
38
39 ENOSYS The functionality is not supported on this implementation.
40
41
43 In some environments, decoding may not be implemented. This is related
44 to U.S. Government restrictions on encryption and decryption routines:
45 the DES decryption algorithm cannot be exported outside the U.S.A. His‐
46 torical practice has been to ship a different version of the encryption
47 library without the decryption feature in the routines supplied. Thus
48 the exported version of encrypt() does encoding but not decoding.
49
50
51 Because encrypt() does not return a value, applications wishing to
52 check for errors should set errno to 0, call encrypt(), then test errno
53 and, if it is non-zero, assume an error has occurred.
54
56 See attributes(5) for descriptions of the following attributes:
57
58
59
60
61 ┌─────────────────────────────┬─────────────────────────────┐
62 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
63 ├─────────────────────────────┼─────────────────────────────┤
64 │Interface Stability │Standard │
65 ├─────────────────────────────┼─────────────────────────────┤
66 │MT-Level │Safe │
67 └─────────────────────────────┴─────────────────────────────┘
68
70 crypt(3C), setkey(3C), attributes(5)
71
72
73
74SunOS 5.11 2 May 2001 encrypt(3C)