HP-UX Reference (11i v1 00/12) - 3 Library Functions A-M (vol 6)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man3/!!!intro.3c
________________________________________________________________
___ ___
c
crypt(3C) crypt(3C)
NAME
crypt - generate hashing encryption
SYNOPSIS
#include <crypt.h>
#include <unistd.h>
char *crypt(const char *key, const char *salt);
Obsolescent Interfaces
char *crypt_r(const char *key, const char *salt, CRYPTD *cd);
void setkey_r(const char *key, CRYPTD *cd);
void encrypt_r(char block[64], int edflag, CRYPTD *cd);
void setkey(const char *key);
void encrypt(char block[64], int edflag);
DESCRIPTION
crypt():
crypt() is the password encryption function. It is based on a one way hashing encryption algorithm with
variations intended (among other things) to frustrate use of hardware implementations of a key search.
key is a user’s typed password. salt is a two-character string chosen from the set
[a-zA-Z0-9./]; this
string is used to perturb the hashing 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 pass-
word. The first two characters are the salt itself.
Obsolescent Interfaces
crypt_r(), setkey_r(), encrypt_r(), setkey(), encrypt() generate hashing encryption.
APPLICATION USAGE
crypt() is thread-safe. This interface is not async-cancel-safe.
WARNINGS
The return value for crypt() points to data whose content is overwritten by each call.
crypt_r(), setkey_r(), and encrypt_r() are obsolescent interfaces supported only for compati-
bility with existing DCE applications. New multithreaded applications should use
crypt().
SEE ALSO
crypt(1), login(1), passwd(1), getpass(3C), passwd(4).
STANDARDS CONFORMANCE
crypt(): SVID2, SVID3, XPG2, XPG3, XPG4
Section 3−−102 − 1 − HP-UX Release 11i: December 2000
___
___