DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

randomword(S-osr5)


randomword -- generate a pronounceable password

Syntax

cc . . . -lprot

#include <sys/types.h>
#include <sys/security.h>
#include <sys/audit.h>
#include <prot.h>

int randomword (word, hyphenated_word, min, max, restrict, seed) char *word; char *hyphenated_word; unsigned short int min; unsigned short int max; int restrict; long seed;

Description

randomword places a null-terminated random pronounceable password into the user-supplied space word and returns the length of the generated word. The hyphenated version of the word is placed in hyphenated_word.

The min and max arguments denote the minimum and maximum lengths allowed for word. min may equal max, but may not be greater than max, and neither may be negative. The user space pre-allocated is at least max for word and 2*max-1 for hyphenated_word. Of course, the smaller min and max are, the less the selection of random words. For a program like login(M), suggested values are 6 for min and 8 for max.

The argument restrict is 0 when no restrictions are placed on the generated word. It is non-zero when the words generated pass the tests of the routine acceptable_password(S-osr5).

The seed argument specifies an initial seed for the random number generator used by randomword. It is used by the routine only on the first time it is called; the argument is ignored on subsequent calls.

Notes

The password generator relies on a random number generator that produces uniformly distributed integers. Because the password generator invokes the random number generator many times even for one word, the random number generator has to be very good. The period (distinct numbers produced given a particular seed) and number space (range of possible numbers) must both be large.

Files

/etc/passwd
/etc/group

See also

acceptable_password(S-osr5), drand48(S-osr5), login(M), passwd(C), seed(S-osr5)

Standards conformance

randomword is an extension of AT&T System V provided by the Santa Cruz Operation.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005