Manual Page Result
0
Command: dispcrypt | Section: 3 | Source: Digital UNIX | File: dispcrypt.3.gz
dispcrypt(3) Library Functions Manual dispcrypt(3)
NAME
dispcrypt - encrypt a password, dispatching based on the associated al-
gorithm (Enhanced Security)
LIBRARY
Security Library (libsecurity.so)
In order to quickstart a program, the program must be linked as fol-
lows:
-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 characters in length, and null-terminated. For pass-
word 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 valida-
tion, use the fd_oldcrypt field of an es_passwd structure.
For password generation, use the fd_newcrypt field (and up-
date the fd_oldcrypt field at the same time as the fd_en-
crypt 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 over-
written on subsequent calls to this function or to the encryption algo-
rithms which it calls, so callers should save a copy of the string un-
less the only use is an immediate comparison during password valida-
tion.
RETURN VALUES
This routine returns NULL if there is an encryption failure. Other-
wise, 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)