apg [-sdyltqhv] [-a algorithm] [-M mode] [-E string] [-n count] [-m length]
[-x length] [-r file] [-b file] [-p length] [-c seed]
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
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 or SHA-1 instead of Triple DES. It uses local time with preci-
sion of microseconds and random device (if available) to produce initial
apg also have the ability to check generated password quality using dictio-
nary. You can use this ability if you specify command-line options -r dict-
file or -b filtername where dictfile is the dictionary file name and fil-
tername is the name of Bloom filter file. 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 dictio-
naries that come with dictionary password crackers. Bloom filter file
should be created with apgbfm utility included in apg distribution. In
future releases I plan to implement some other techniques to check pass-
words (like pattern check) just to make life easier The options are as
-a use algorithm number for password generation where number is:
0 - pronounceable password generation
1 - random character password generation
generate count number of passwords. Default is 6.
generate password with minimum length. If minimum length > maximum
length then maximum length = minimum length. Default minimum password
generate password with maximum length. If minimum length > maximum
length then maximum length = minimum length. Default maximum length
password length is 10.
Use symbolsets specified with mode for password generation. mode is
a text string consisting of characters S, s, N, n, C, c, L, l.
S generator must use special symbol set for every generated
s generator should use special symbol set for password genera-
N generator must use numeral symbol set for every generated
n generator should use numeral symbol set for password genera-
C generator must use capital symbol set for every generated
c generator should use capital symbol set for password genera
L generator must use small letters symbol set for every generated
password (always present if pronounceable password generation
algorithm is used).
l generator should use small letters symbol set for password
mode cannot be more than 4 characters in length.
Usage of L, M, N, C will slow down password generation process.
-M sncl or -M SNCL or -M Cn
exclude characters in string from password generation process (in
pronounceable password generation mode you can not exclude small
letters). To include special symbols that can be recognized by shell
(apostrophe, quotes, dollar sign, etc.) in string use the backslashed
Command apg -a 1 -M n -n 3 -m 8 -E 23456789 will generate a set of
passwords that will look like this
Command apg -a 1 -M nc -n 3 -m 26 -E GHIJKLMNOPQRSTUVWXYZ will gen-
erate a set of passwords that will look like this
check generated passwords for their appearance in dictionary file.
check generated passwords for their appearance in filter file. filter
file should be created with apgbfm utility.
this option tells apg to check every substring of the generated pass-
word for appearance in filter file. If any of such substrings would
be found in the filter file then generated password would be rejected
and apg will generate another one. length specifies minimum substring
length to check. This option is active only if -b option is defined.
use seed as a random seed for password generation.
-s ask user for random sequence for password generation.
-d do NOT use any delimiters between generated passwords.
-y print generated passwords and crypted passwords.
-q quiet mode (do not print warnings).
-l spell generated passwords. Useful when you want to read generated
password by telephone.
WARNING: Think twice before read your password by phone.
-t print pronunciation for generated pronounceable password.
-h print help information and exit.
-v print version information and exit.
apg -a 0 -M sncl -n 6 -x 10 -m 8
If you want to generate really secure passwords, you should use option -s.
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.
Adel I. Mirzazhanov, <a-deliname.com>
Project home page: http://www.adel.nursat.kz/apg/