Available in

(1) (3) (3)/de (3)/es (3)/fr (3)/ja (3)/pl (3)/pt (3)/tr (3c) (3posix) (3trf)

TOC

crypt(3C)                Standard C Library Functions                crypt(3C)



NAME

       crypt - string encoding function

SYNOPSIS

   Default
       #include <crypt.h>

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

   Standard conforming
       #include <unistd.h>

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

DESCRIPTION

       The  crypt() function is a string encoding function, used primarily for
       password encryption.  It is based on  a  one-way  encryption  algorithm
       with variations intended (among other things) to frustrate use of hard-
       ware implementations of a key search.

       The key argument points to a string to be  encoded  (for  example,  the
       user's  password.)  Only  the first eight characters are used; the rest
       are ignored. The 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.

RETURN VALUES

       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.

       In multithreaded applications, the return value is a pointer to thread-
       specific data.

ERRORS

       The crypt() function will fail if:

       ENOSYS
             The functionality is not supported on this implementation.

USAGE

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

       The values returned by this function may not be portable among XSI-con-
       formant systems.

ATTRIBUTES

       See attributes(5) for descriptions of the following attributes:


       +-----------------------------+-----------------------------+
       |      ATTRIBUTE TYPE         |      ATTRIBUTE VALUE        |
       +-----------------------------+-----------------------------+
       |Interface Stability          |Standard                     |
       +-----------------------------+-----------------------------+
       |MT-Level                     |Safe                         |
       +-----------------------------+-----------------------------+

SEE ALSO

       passwd(1), crypt(3C), encrypt(3C), getpass(3C), setkey(3C),  passwd(4),
       attributes(5)



SunOS 5.9                         2 May 2001                         crypt(3C)

COMMENTS

Add your comment here. Whitespace and linebreaks are preserved. URLs are linked automatically.
CAPTCHA

No HTML allowed. URLs will be linked with nofollow attribute. Whitespace is preserved.