Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dispcrypt(3) [osf1 man page]

dispcrypt(3)						     Library Functions Manual						      dispcrypt(3)

NAME
dispcrypt - encrypt a password, dispatching based on the associated algorithm (Enhanced Security) LIBRARY
Security Library (libsecurity.so) In order to quickstart a program, the program must be linked as follows: -lsecurity -ldb -laud -lm See the shared library discussion in the Programmer's Guide for more information about using the quickstarting feature. SYNOPSIS
#include <prot.h> char *discprypt( const char *plaintext, const char *salt, int algorithm_index); PARAMETERS
plaintext The unencrypted password to be encrypted. salt A string value which may be used as input to the selected encryption algorithm. This parameter should be at least two charac- ters in length, and null-terminated. For password validation, it should be the encrypted password which is already in use. algorithm_index A value from 0 to (get_num_crypts()-1), indicating which encryption algorithm is to be used. For password validation, use the fd_oldcrypt field of an es_passwd structure. For password generation, use the fd_newcrypt field (and update the fd_oldcrypt field at the same time as the fd_encrypt field if the change is successful). DESCRIPTION
The dispcrypt() function applies the specified encryption algorithm to the given password string and salt value, and returns the encrypted form of the password. The return value is static data which is overwritten on subsequent calls to this function or to the encryption algo- rithms which it calls, so callers should save a copy of the string unless the only use is an immediate comparison during password valida- tion. RETURN VALUES
This routine returns NULL if there is an encryption failure. Otherwise, it returns a pointer to static data, which is the null-terminated encrypted password result. RELATED INFORMATION
passwd(1), getespwent(3), get_num_crypts(3) Security delim off dispcrypt(3)

Check Out this Related Man Page

get_num_crypts(3)					     Library Functions Manual						 get_num_crypts(3)

NAME
get_num_crypts, get_crypt_name - determine the encryption types available (Enhanced Security) LIBRARY
Security Library (libsecurity.so) SYNOPSIS
#include <prot.h> int get_num_crypts(void); const char *get_crypt_name( int cryptnum); PARAMETERS
cryptnum The encryption algorithm for which the name is to be returned. DESCRIPTION
The get_num_crypts() function returns the number of encryption algorithms which the current system supports. This value is non-negative, and at least four. The get_crypt_name() function returns a pointer to static storage containing the name of the encryption algorithm with the index value given in the cryptnum parameter. Other calls to get_crypt_name() could overwrite the stored name, so applications should copy the names this function returns if there is a chance that other parts of the application might also call this function. This function returns NULL if the given algorithm index is negative or if it is not less than the return value of get_num_crypts(). Algorithm indexes are most com- monly obtained from the fd_oldcrypt and fd_newcrypt fields of an extended profile entry. The dxaccounts system management GUI uses the get_num_crypts() and get_crypt_name() functions to determine how to display the menu of allowable encryption algorithms for ENHANCED security. RETURN VALUES
The get_num_crypts() function returns a non-negative value which is at least four. The get_crypt_name() function returns a name for a known encryption algorithm, or a NULL pointer if the given index is out of range. NOTES
In order to quickstart a program, the program must be linked as follows: -lsecurity -ldb -laud -lm See the shared library discussion in the Programmer's Guide for more information about using the quickstarting feature. RELATED INFORMATION
getespwent(3), getesdfent(3), dispcrypt(3), dxaccounts(8) Security delim off get_num_crypts(3)
Man Page