Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ randomword(S) — OpenDesktop Software Development System 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

drand48(S)

login(M)

passwd(C)

seed(S)


 randomword(S)                  6 January 1993                  randomword(S)


 Name

    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 hyphenatedword.

    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 nei-
    ther may be negative.  The user space pre-allocated is at least max for
    word and 2*max-1 for hyphenatedword.  Of course, the smaller min and max
    are, the less the selection of random words.  For a program like log-
    in(M), suggested values are 6 for min and 8 for max.

    The argument restrict is 0 when no restrictions are placed on the gen-
    erated word.  It is non-zero when the words generated pass the tests of
    the routine acceptablepassword described by acceptpw(S).

    The seed argument specifies an initial seed for the random number genera-
    tor 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 num-
    ber 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

    acceptpw(S), drand48(S), login(M), passwd(C), seed(S)

 Standards conformance

    randomword is an extension of AT&T System V provided by the Santa Cruz
    Operation.


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026