.\"
.\" Copyright notice.
.\" This software is copyrighted (c) 1991 by Matt Bishop and the
.\" Trustees of Dartmouth College.  All rights reserved.
.\"
.\" Author:	Matt Bishop
.\" Address:	Department of Mathematics and Computer Science
.\" 	 	Dartmouth College
.\"  		Hanover, NH  03755-1831
.\"  		USA
.\" telephone:	+1 603 646 3267
.\" fax:	+1 603 646 1312
.\" internet:	Matt.Bishop@dartmouth.edu
.\" usenet:	...!decvax!dartvax!Matt.Bishop
.\"
.\" version information
.ds Vr Version GAMMA 6/31/91 Matt.Bishop@dartmouth.edu
.TH GENDICT 1
.SH NAME
gendict \- generate a dictionary of guesses
.SH SYNOPSIS
.BR gendict " ["
.BI \-l n
] [
.BI \-o dict
] [
.BI \-p
] [
.BI \-P pwdcmd
] [
.BI \-t how
] [
.BI \-w
] [
.BI \-W listcmd
]
.IR file " ..."
.SH DESCRIPTION
.I Gendict
takes as input password files and lists of words,
and produces as output a dictionary which can then be used as
a list of guesses for passwords.
Each word appears exactly once in the dictionary;
duplicates are pruned.
A user transformation
(specified by the
.B \-P
or
.B \-W
options) may be applied to each file or list.
The results are collated into one large word list,
transformed as indicated by the
.B \-t
option,
truncated
(if the
.B \-l
option is given),
sorted,
and duplicates are pruned.
.PP
Options are:
.TP
.BI \-l n
Truncate all dictionary words to be at most
.I n
characters.
This is done
.I before
identical words are pruned,
so if two words differ in the
.IR n +1'st
character,
only one copy of the first
.I n
will be present in the dictionary.
As only the first 8 characters of \s-2UNIX\s0 passwords are used,
this can cut down the dictionary's size appreciably.
.TP
.BI \-o dict
The output dictionary is to be saved in a file named
.IR dict .
By default, it is written to the standard output.
.TP
.B \-p
Files following this option are password files.
The login name, UID, GID, home directory's base name,
and each field of the GECOS structure will be extracted
and placed into a word list.
In addition,
the output of any
.I pwdcmd
(specified using the
.B \-P
flag) will also be added to the word list.
.TP
.BI \-P pwdcmd
Each password file is given as an argument to this command.
There is no input.
Output is collected and added to a word list.
The output is expected to be one guess per line.
.TP
.BI \-t how
After the password files are processed into a set of word lists,
a set of transformations is applied to those word lists and
user-supplied word lists.
(This is done after the
.I pwdcmd
and
.I listcmd
programs,
if any,
are run.)
The following transformations may then be applied,
by specifying them as a comma-separated list of arguments
.I how
to the
.B \-t
option:
.in +5
.ta 15n
id	identity; do nothing (default)
.br
cap	make all letters upper case
.br
low	make all letters lower case
.br
fcap	capitalize the first letter
.br
\f2n\fP	append the digit \f2n\fP (0 to 9)
.br
rev	reverse the word
.br
rcap	reverse the word, make all letters upper case
.br
rlow	reverse the word, make all letters lower case
.br
rfcap	reverse the word, capitalize the first letter
.br
r\f2n\fP	reverse the word, append the digit \f2n\fP (0 to 9)
.in -5n
.TP
.B \-w
Files following this option are word lists.
Their contents,
and the output of any
.I listcmd
(specified using the
.B \-W
flag) will also be added to the word list.
.TP
.BI \-W listcmd
Each word list file is given as an argument to this command.
There is no input.
Output is collected and added to a word list.
The output is expected to be one guess per line.
.SH "SEE ALSO"
guess(1), trans(1)
