NAME | SYNOPSIS | DESCRIPTION | ATTRIBUTES | RETURN VALUES | EXAMPLES | SEE ALSO
#include <tsol/tsol.h>int randomword(char *word, char *hyphenated_word, const unsigned short minlen, const unsigned short maxlen, const unsigned char *seed);
randomword() generates random pronounceable passwords using the FIPS 181 algorithm. Upon successful completion, word is replaced with a new password with a length between minlen and maxlen inclusive. hyphenated_word is a hyphenated version of word showing its pronunciation. If seed is non-NULL, it is a random number seed of eight significant characters. A good choice is the user's old password. Successive calls to randomword() by the same program should pass a null pointer for seed to produce new random passwords using the initial seed.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Availability | SUNWtsu |
MT-Level | MT-Unsafe |
randomword() returns:
If minlen > maxlen or seed has not been set.
If maxlen is zero (0).
Length of the password word generated.
char password[10]; char hyphen_password[20]; char seed[9]; int len; int i; printf("Please enter old password: "); fgets(seed, 9, stdin); len = randomword(password, hyphen_password, 6, 8, seed); printf("password %s is pronounced %s\n", password, hyphen_password); for (i = 1; i < 5; i++) { len = randomword(password, hyphen_password, 6, 8, (unsigned char *) 0); printf("password %s is pronounced %s\n", password, hyphen_password); }
Federal Information Processing Standards Publication 181, Automated Password Generator, 5 October 1993
NAME | SYNOPSIS | DESCRIPTION | ATTRIBUTES | RETURN VALUES | EXAMPLES | SEE ALSO