The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 NAME

crypt - string encoding function (CRYPT)

 SYNOPSIS



#include <unistd.h>

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

 DESCRIPTION

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:


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 crypt() points to static data that is overwritten by each call.

This need not be a reentrant function.

 RETURN VALUE

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.

 ERRORS

The crypt() function will fail if:
[ENOSYS]
The functionality is not supported on this implementation.

 EXAMPLES

None.

 APPLICATION USAGE

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

 FUTURE DIRECTIONS

None.

 SEE ALSO

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

DERIVATION

Derived from Issue 1 of the SVID.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]