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

NAME

6       encrypt - encoding function (CRYPT)
7

SYNOPSIS

9       #include <unistd.h>
10
11       void encrypt(char block[64], int edflag);
12
13

DESCRIPTION

15       The  encrypt()  function  shall  provide  access  to an implementation-
16       defined encoding algorithm. The key generated by setkey()  is  used  to
17       encrypt the string block with encrypt().
18
19       The  block  argument  to encrypt() shall be an array of length 64 bytes
20       containing only the bytes with values of 0 and 1. The array is modified
21       in place to a similar array using the key set by setkey(). If edflag is
22       0, the argument is encoded.  If  edflag  is  1,  the  argument  may  be
23       decoded  (see  the  APPLICATION  USAGE section); if the argument is not
24       decoded, errno shall be set to [ENOSYS].
25
26       The encrypt() function shall not change the setting of  errno  if  suc‐
27       cessful.  An  application  wishing to check for error situations should
28       set errno to 0 before calling  encrypt().   If  errno  is  non-zero  on
29       return, an error has occurred.
30
31       The  encrypt()  function  need not be reentrant. A function that is not
32       required to be reentrant is not required to be thread-safe.
33

RETURN VALUE

35       The encrypt() function shall not return a value.
36

ERRORS

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

EXAMPLES

46       None.
47

APPLICATION USAGE

49       Historical implementations of the  encrypt()  function  used  a  rather
50       primitive encoding algorithm.
51
52       In  some  environments,  decoding  might  not  be  implemented. This is
53       related to some Government restrictions on  encryption  and  decryption
54       routines.  Historical  practice has been to ship a different version of
55       the encryption library without the decryption feature in  the  routines
56       supplied.  Thus the exported version of encrypt() does encoding but not
57       decoding.
58

RATIONALE

60       None.
61

FUTURE DIRECTIONS

63       None.
64

SEE ALSO

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