CRYPT(3C)
NAME
crypt - generate password encryption
SYNOPSIS
char *crypt (key, salt)
char *key, *salt;
HP-UX COMPATIBILITY
Level: HP-UX/RUN ONLY
Origin: System V
DESCRIPTION
Crypt is the password encryption function. It is based on the NBS Data Encryption Standard (DES), with variations intended (among other things) to frustrate use of hardware implementations of the DES for key search.
Key is a user’s typed password. Salt is a two-character string chosen from the set [a-zA-Z0-9./]; this salt string is used to perturb the DES algorithm in one of 4096 different ways, after which the password is used as the key to encrypt repeatedly a constant string. The returned value points to the encrypted password, in the same alphabet as the salt. The first two characters are the salt itself.
SEE ALSO
login(1), passwd(1), getpass(3C), passwd(5)
BUGS
The return value points to static data that is overwritten by the next call to crypt(3C).
Hewlett-Packard — last mod. May 11, 2021