APG(1)

NAME
apg - generates several random passwords

SYNOPSIS
apg [-r dictfile] [-a algorithm] [-C] [-L] [-S] [-N] [-m min_pass_len] [-x max_pass_len] [-n num_of_pass] [-s] [-c cl_seed] [-d] [-h] [-v]

DESCRIPTION
apg generates several random passwords. It uses several password generation algorithms (currently two) and a built-in pseudo random number generator.

Default algorithm is pronounceable password generation algorithm designed by Morrie Gasser and described in A Random Word Generator For Pronounceable Passwords National Technical Information Service (NTIS) AD-A-017676. The original paper is very old and had never been put online, so I have to use NIST implementation described in FIPS-181.

Another algorithm is simple random character generation algorithm, but it uses four user-defined symbol sets to produce random password. It means that user can choose type of symbols that should appear in password. Symbol sets are: numeric symbol set (0,...,9) , capital letters symbol set (A,...,Z) , small letters symbol set (a,...,z) and special symbols symbol set (#,@,!,...).

Built-in pseudo random number generator is an implementation of algorithm described in Appendix C of ANSI X9.17 or RFC1750 with exception that it uses CAST instead of Triple DES. It uses local time with precision of microseconds (see gettimeofday(2)) and /dev/random (if available) to produce initial random seed.

apg also have the ability to check generated password quality using dictionary. You can use this ability if you specify command-line option -r dictfile where dictfile is dictionary file name. In that dictionary you may place words (one per line) that should not appear as generated passwords. For example: user names, common words, etc. You even can use one of the dictionaries that come with dictionary password crackers. This check is case sensitive. For example, if you want to reject word 'root', you should insert in dictfile words: root, Root, RoOt, ... , ROOT. It is not the easiest way to check password quality, but it is the most powerful way. In future releases I plan to implement some other techniques to check passwords (like pattern check) just to make life easier.

OPTIONS

-S  use special symbol set (for random character password generation algorithm only)

-N  use numeral symbol set

-C  use capital symbol set

-L  use small letters symbol set (always present if pronounceable password generation algorithm is used)

-a algorithm
    use algorithm for password generation.
    0 - (default) pronounceable password generation
    1 - random character password generation

-r dictfile
    check generated passwords for their appearance in dictfile

-s  ask user for random sequence for password generation

-c cl_seed
    use cl_seed as a random seed for password generation. I use it when i have to generate passwords in a shell script.

-d  do NOT use any delimiters between generated passwords. I use it when i have to generate passwords in a shell script.

-n num_of_pass
    generate num_of_pass number of passwords. Default is 6.

-m min_pass_len
    generate password with minimum length min_pass_len. If min_pass_len > max_pass_len then max_pass_len = min_pass_len. Default minimum password length is 6.

-x max_pass_len
    generate password with maximum length max_pass_len. If min_pass_len > max_pass_len then max_pass_len = min_pass_len. Default maximum password length is 8.

-h  print help information and exit

-v  print version information and exit

DEFAULT OPTIONS
apg -a 0 -N -C -L -n 6 -x 8 -m 6

If you want to generate realy secure passwords, you should use option -s. To simlify apg usage, you can write a small shell script. For example:
[begin]----> pwgen.sh
#!/bin/sh
/usr/local/bin/apg -m 8 -x 12 -s
[ end ]----> pwgen.sh

EXIT CODE
On successful completion of its task, apg will complete with exit code 0. An exit code of -1 indicates an error occurred. Textual errors are written to the standard error stream.

DIAGNOSTICS
If /dev/random is not available, apg will display a message about it.

FILES
None.

BUGS
None. If you've found one, please send bug description to the author.

SEE ALSO
apgd (8)

AUTHOR
Adel I. Mirzazhanov, <a-del@iname.com>
Project home page: http://www.adel.nursat.kz/apg/