"Traditional" crypt:
The algorithm used will depend upon whether crypt_set_format has been called and whether a global default format has been specified. Unless a global default has been specified or crypt_set_format has set the format to something else, the built-in default format is used. This is currently DES if it is available, or MD5 if not.
How the salt is used will depend upon the algorithm for the hash. For best results, specify at least two characters of salt.
The crypt_get_format function returns a constant string that represents the name of the algorithm currently used. Valid values are des, blf, md5 and nth.
The crypt_set_format function sets the default encoding format according to the supplied string.
The global default format can be set using the /etc/auth.conf file using the crypt_default property.
RETURN VALUES
The crypt function returns a pointer to the encrypted value on success, and NULL on failure. Note: this is not a standard behaviour, AT&T crypt will always return a pointer to a string. The crypt_set_format function will return 1 if the supplied encoding format was valid. Otherwise, a value of 0 is returned.
SEE ALSO
login(1), passwd(1), auth_getval(3), cipher(3), getpass(3), auth.conf(5), passwd(5)
HISTORY
AUTHORS
BUGS