APG(1)
๐ APG(1) โ apg โจ
okay bestie, let's get into apg ๐ it's the tool that generates a whole bunch of random passwords for you at once. no cap, it's giving main character energy ๐ฆ
๐ธ NAME
apg - generates several random passwords ๐
โจ SYNOPSIS
apg [-a algorithm] [-M mode] [-E char_string] [-n num_of_pass] [-m
min_pass_len] [-x max_pass_len] [-r dictfile] [-b filter_file] [-p
min_substr_len] [-s] [-c cl_seed] [-d] [-y] [-l] [-t] [-k] [-q] [-h]
[-v]
๐ DESCRIPTION
okay so apg generates several random passwords ๐ฅ it has two password generation algorithms and a built-in pseudo random number generator. literally iconic ๐
the default algorithm is the pronounceable password generation algorithm designed by Morrie Gasser ๐ง it's described in A Random Word Generator For Pronounceable Passwords from the National Technical Information Service (NTIS) AD-A-017676. ngl that paper is super old and was never put online, so the author had to use the NIST implementation described in FIPS-181 ๐
the other algorithm is a simple random character generator, but it uses four user-defined symbol sets to make the password. so YOU get to pick what kinds of symbols show up ๐ the sets are:
- numeric symbol set (0,...,9)
- capital letters symbol set (A,...,Z)
- small letters symbol set (a,...,z)
- special symbols symbol set (#,@,!,...)
the built-in pseudo random number generator is an implementation of the algorithm from Appendix C of ANSI X9.17 or RFC1750, except it uses CAST or SHA-1 instead of Triple DES ๐ it grabs the local time with microsecond precision (see gettimeofday(2)) and /dev/random (if available) to make the initial random seed. the vibe is very secure ๐ซถ
apg can also check how good a generated password is by using a dictionary ๐ you can do this by passing -r dictfile or -b filtername, where dictfile is the dictionary file name and filtername is the name of a Bloom filter file. in the dictionary you can put words (one per line) that should not show up in your passwords, like user names, common words, etc. you can even use one of the dictionaries that come with dictionary password crackers ๐ญ Bloom filter files should be created with apgbfm(1), which comes with the apg distribution. the author also plans to add other checks (like pattern check) in future releases to make life easier โจ
๐ฆ OPTIONS
๐ Password generation modes options
-a algorithmโ pick the algorithm for password generation.0- (default) pronounceable password generation1- random character password generation
-n num_of_passโ generate num_of_pass passwords. default is6๐-m min_pass_lenโ generate passwords with a minimum length of min_pass_len. if min_pass_len > max_pass_len, then max_pass_len = min_pass_len. default minimum password length is8๐-x max_pass_lenโ generate passwords with a maximum length of max_pass_len. if min_pass_len > max_pass_len, then max_pass_len = min_pass_len. default maximum password length is10โจ-M modeโ use the symbol sets specified by mode when generating passwords. mode is a text string made of the charactersS,s,N,n,C,c,L,l. here's what they mean:Sโ the generator must use the special symbol set for every generated password.sโ the generator should use the special symbol set for password generation.Nโ the generator must use the numeral symbol set for every generated password.nโ the generator should use the numeral symbol set for password generation.Cโ the generator must use the capital symbol set for every generated password.cโ the generator should use the capital symbol set for password generation.Lโ the generator must use the small letters symbol set for every generated password (always present if the pronounceable algorithm is used) ๐งlโ the generator should use the small letters symbol set for password generation.R,rโ not supported anymore ๐ use the-E char_stringoption instead.- mode can't be more than
4characters long.
heads up: usingL,M,N,Cwill slow down the password generation process ๐ข
examples: -M sncl, -M SNCL, or -M Cn ๐
-E char_stringโ exclude the characters in char_string from password generation (in pronounceable mode you can't exclude small letters). to include special symbols that the shell would otherwise mess with (apostrophe, quotes, dollar sign, etc.) in char_string, use the backslashed versions ๐
examples:
running apg -a 1 -M n -n 3 -m 8 -E 23456789 gives you passwords that look like this:
10100110
01111000
11011101
running apg -a 1 -M nc -n 3 -m 26 -E GHIJKLMNOPQRSTUVWXYZ gives you passwords that look like this:
16A1653CD4DE5E7BD9584A3476
C8F78E06944AFD57FB9CB882BC
8C8DF37CD792D36D056BBD5002
๐ Password quality control options
-kโ check every generated password with cracklib. to use this you must enable cracklib support when building the program. (the original says "programm," we'll let it slide ๐ญ)-r dictfileโ check generated passwords for appearing in dictfile ๐-b filter_fileโ check generated passwords for appearing in filter_file. the filter_file should be created withapgbfm(1)๐ธ-p min_substr_lenโ tellsapg(1)to check every substring of the generated password against filter_file. if any of those substrings show up in the filter file, the password gets rejected andapg(1)makes another one. min_substr_len is the minimum substring length to check. this option only works if-bis set ๐
๐ง Pseudo random number generator options
-sโ ask the user for a random sequence to use when generating passwords ๐ฒ-c cl_seedโ use cl_seed as the random seed for password generation. the author uses it when generating passwords in a shell script ๐
๐ Password output options
-dโ do NOT use any delimiters between generated passwords. the author uses this for shell scripts too ๐ซถ-yโ print generated passwords and their crypted versions (seecrypt(3)) ๐ฅ-qโ quiet mode, don't print warnings ๐คซ-lโ spell out the generated passwords. super useful if you need to read a password over the phone ๐
WARNING: think twice before reading your password over the phone ๐
-tโ print the pronunciation of the generated pronounceable password ๐ฃ๏ธ-hโ print help info and exit ๐ท-vโ print version info and exit ๐
๐ DEFAULT OPTIONS
the default options are apg -a 0 -M sncl -n 6 -x 10 -m 8 (new style) โจ
if you want to generate really secure passwords, use the -s option ๐ to make life simpler you can write a tiny shell script, for example:
[begin]----> pwgen.sh
#!/bin/sh
/usr/local/bin/apg -m 8 -x 12 -s
[ end ]----> pwgen.sh
๐ฆ EXIT CODE
when apg finishes its job successfully, it exits with code 0. an exit code of -1 means an error happened. text errors get written to the standard error stream ๐จ
๐ซง DIAGNOSTICS
if /dev/random isn't available, apg will show a message about it ๐
๐ FILES
None. ๐ฆ
๐ BUGS
None. if you find one, send a bug description to the author ๐
๐ SEE ALSO
๐ AUTHOR
Adel I. Mirzazhanov, <a-del@iname.com> project home page: http://www.adel.nursat.kz/apg/ ๐
Automated Password Generator, 2003 Aug 04, APG(1) โ bestie, that's a wrap! โจ slay the password game forever ๐ ๐๐ฆ
๐ฆ where this page comes from
- epel 10: apg 2.3.0b-50.el10_2 ยท BSD-3-Clause
- epel 9: apg 2.3.0b-40.el9 ยท BSD
- fedora 43: apg 2.3.0b-50.fc43 ยท BSD-3-Clause
- fedora 44: apg 2.3.0b-52.fc44 ยท BSD-3-Clause
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms