crypt - string 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 key argument points to a string to be encoded. The salt argument is a string chosen from the set:The first two characters of this string may be used to perturb the encoding algorithm.
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 return value of crypt() 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 errno to indicate the error.
The crypt() function will fail if:
- The functionality is not supported on this implementation.
The values returned by this function need not be portable among XSI-conformant systems.
encrypt(), setkey(), <unistd.h>.
Derived from Issue 1 of the SVID.