Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

OSS Library Calls (a - d) crypt(3)
NAME
crypt - Encrypts a password or other character data
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZOSSCSRL
G-series native OSS processes: /G/system/sysnn/zosscsrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZOSSCDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zosscdll |
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/yosscdll |
SYNOPSIS
#include <unistd.h>
char *crypt(
const char *key,
const char *salt);
PARAMETERS
key Specifies the address of the string containing the password or other data to be
encrypted.
salt Specifies the address of the string containing the characters that should be used
to modify the encrypting algorithm. The string can contain the characters A
through Z, a through z, 0 through 9, period (.), or slash (/). The first two charac-
ters specified are used to modify the algorithm.
DESCRIPTION
The crypt() function provides one-way encryption for a string of data in conformance with the
Data Encryption Standards (DES).
NOTES
The crypt() function can be called only by native processes.
RETURN VALUES
Upon successful completion, the crypt( ) function returns a pointer to a static buffer containing
the encrypted version of the string pointed to by the key parameter. The first two characters of
the encrypted value are the first two characters of the string pointed to by the salt parameter.
Each call to the crypt( ) function overwrites the data in the static buffer used by a previous call.
If an application needs to preserve the information returned by a call to crypt( ), then it must
copy the information to a separately allocated memory area before a subsequent call.
If the call fails, the crypt( ) function returns a null pointer.
ERRORS
The HP implementation of crypt() does not set errno.
RELATED INFORMATION
Functions: encrypt(3), setkey(3).
STANDARDS CONFORMANCE
The HP implementation of this function does not return errno values.
527187-017 Hewlett-Packard Company 1149