1ENCRYPT(3P)                POSIX Programmer's Manual               ENCRYPT(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       encrypt - encoding function (CRYPT)
13

SYNOPSIS

15       #include <unistd.h>
16
17       void encrypt(char block[64], int edflag);
18
19

DESCRIPTION

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

RETURN VALUE

41       The encrypt() function shall not return a value.
42

ERRORS

44       The encrypt() function shall fail if:
45
46       ENOSYS The functionality is not supported on this implementation.
47
48
49       The following sections are informative.
50

EXAMPLES

52       None.
53

APPLICATION USAGE

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

RATIONALE

66       None.
67

FUTURE DIRECTIONS

69       None.
70

SEE ALSO

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