CRYPT(3) Library Functions Manual CRYPT(3)

cryptstring encoding function (CRYPT)

#include <unistd.h>

char *crypt (const char *key, const char *salt);

The crypt() function is a string encoding function. The algorithm is implementation-dependent.

The argument points to a string to be encoded. The argument is a string chosen from the set: a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9 . / The first two characters of this string may be used to perturb the encoding algorithm.

The return value of points to static data that is overwritten by each call.

This need not be a reentrant function.

Upon successful completion, crypt() returns a pointer to the encoded string. The first two characters of the returned value are those of the salt argument.

Otherwise it returns a null pointer and sets to indicate the error.

The crypt() function will fail if:

The functionality is not supported on this implementation.

None.

The values returned by this function need not be portable among XSI-conformant systems.

None.

encrypt(3) , setkey(3) , <unistd.h> .

Derived from Issue 1 of the SVID.

February 1997 posix.fail