The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  | will give a
.\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to
.\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
.    de IX
.    tm Index:\\$1\t\\n%\t"\\$2"
..
.    nr % 0
.    rr F
.\}
.\"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
.    \" fudge factors for nroff and troff
.if n \{\
.    ds #H 0
.    ds #V .8m
.    ds #F .3m
.    ds #[ \f1
.    ds #] \fP
.\}
.if t \{\
.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.    ds #V .6m
.    ds #F 0
.    ds #[ \&
.    ds #] \&
.\}
.    \" simple accents for nroff and troff
.if n \{\
.    ds ' \&
.    ds ` \&
.    ds ^ \&
.    ds , \&
.    ds ~ ~
.    ds /
.\}
.if t \{\
.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
.    \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.    \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.    \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.    ds : e
.    ds 8 ss
.    ds o a
.    ds d- d\h'-1'\(ga
.    ds D- D\h'-1'\(hy
.    ds th \o'bp'
.    ds Th \o'LP'
.    ds ae ae
.    ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "randpass 1"
.TH randpass 1 "2009-03-29" "1.07" ""
.SH "NAME"
randpass \- generate random passwords and passphrases
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
randpass [ \-w | \-p \s-1NUMWORDS\s0 ] [ \-s \s-1WORDSOURCE\s0 ] [ \-l \s-1WORDLEN\s0 ]
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
\&\fBrandpass\fR generates random passwords and passphrases to your specifications.
.SH "OPTIONS"
.IX Header "OPTIONS"
.IP "\fB\-w\fR, \fB\-\-word\fR" 4
.IX Item "-w, --word"
Generate passwords (the default).
.IP "\fB\-p\fR, \fB\-\-phrase\fR \fInum\fR" 4
.IX Item "-p, --phrase num"
Generate passphrases with the specified number of words.  The passphrase
that is generated will not contain duplicate words (e.g., \f(CW\*(C`urial hayseed
dumpish urial\*(C'\fR).  This may not be a range.
.Sp
When this option is used, options \fB\-c\fR and \fB\-C\fR are ignored.
.IP "\fB\-n\fR, \fB\-\-count\fR \fInum\fR" 4
.IX Item "-n, --count num"
Generate the specified number of passwords or passphrases.  This may not
be a range.
.IP "\fB\-l\fR, \fB\-\-word\-length\fR \fInumber-or-range\fR" 4
.IX Item "-l, --word-length number-or-range"
The length of the password, or of each word in the passphrase.
.Sp
If a range is specified (e.g., \f(CW\*(C`\-\-word\-length 8\-14\*(C'\fR) then the length
of the password (or of the words in the passphrase) will fall randomly
within that range (including both endpoints).  Half-open ranges (e.g.,
\&\f(CW\*(C`\-\-word\-length 3\-\*(C'\fR) are not allowed.
.Sp
The default is 7\-14 for passwords and 4\-7 for passphrases.
.IP "\fB\-c\fR, \fB\-\-chars\fR \fIstring-or-setname\fR" 4
.IX Item "-c, --chars string-or-setname"
The set of characters (specified as a sequence of characters) used in
generating a password.  This is currently ignored if passphrases are being
generated.
.Sp
You may specify a named set instead.  Choose among these...
.RS 4
.IP "\fB:std\fR" 4
.IX Item ":std"
.Vb 1
\&  ('A'..'H', 'J'..'N', 'P'..'Z', ('a'..'k', 'm', 'n', 'p'..'z') x 2, '2'..'9')
.Ve
.Sp
This is the default.  It omits digits and letters that may be mistaken for each
other (\f(CW\*(C`l\*(C'\fR, \f(CW\*(C`I\*(C'\fR, \f(CW1\fR; \f(CW\*(C`o\*(C'\fR, \f(CW\*(C`O\*(C'\fR, \f(CW0\fR).
.IP "\fB:alpha\fR" 4
.IX Item ":alpha"
.Vb 1
\&  ('A'..'Z', 'a'..'z')
.Ve
.IP "\fB:lower\fR" 4
.IX Item ":lower"
.Vb 1
\&  ('a'..'z')
.Ve
.IP "\fB:ALPHA\fR or \fB:upper\fR" 4
.IX Item ":ALPHA or :upper"
.Vb 1
\&  ('A'..'Z')
.Ve
.IP "\fB:alphanum\fR" 4
.IX Item ":alphanum"
.Vb 1
\&  ('A'..'Z', 'a'..'z', '0'..'9')
.Ve
.IP "\fB:num\fR" 4
.IX Item ":num"
.Vb 1
\&  ('0'..'9')
.Ve
.IP "\fB:hex\fR" 4
.IX Item ":hex"
Hexadecimal digits (lowercase).
.Sp
.Vb 1
\&  ('0'..'9', 'a'..'f')
.Ve
.IP "\fB:HEX\fR" 4
.IX Item ":HEX"
Hexadecimal digits (uppercase).
.Sp
.Vb 1
\&  ('0'..'9', 'A'..'F')
.Ve
.IP "\fB:bool\fR" 4
.IX Item ":bool"
Binary digits.
.Sp
.Vb 1
\&  (0, 1)
.Ve
.IP "\fB:bin\fR" 4
.IX Item ":bin"
Binary data (bytes 0 through 255).
.Sp
.Vb 1
\&  ("\ex00".."\exFF")
.Ve
.IP "\fB:bin7\fR" 4
.IX Item ":bin7"
Binary data (bytes 0 through 127).
.Sp
.Vb 1
\&  ("\ex00".."\ex7F")
.Ve
.RE
.RS 4
.Sp
Repeated use of this option is cumulative, so (for example) the following will
generate passwords that may be expected to contain (on average) twice as many
upper-case letters as lower-case letters:
.Sp
.Vb 1
\&    randpass -c :upper -c :upper -c :lower
.Ve
.RE
.IP "\fB\-C\fR, \fB\-\-range\fR \fIbegin\fR\-\fIend\fR" 4
.IX Item "-C, --range begin-end"
Specify a range of (\s-1ASCII\s0) characters to use.  As is true of \fB\-c\fR, use of
multiple \fB\-C\fR options is cumulative.
.Sp
Options \fB\-c\fR and \fB\-C\fR may be freely interspersed, and the order in which they
are given is not significant, so the following are all equivalent:
.Sp
.Vb 3
\&    randpass -c :upper -c :lower -c :num
\&    randpass -C a-z    -C 0-9    -C A-Z
\&    randpass -c :num   -c :upper -C a-z
.Ve
.IP "\fB\-r\fR, \fB\-\-required\fR [\fInum\fR#]\fIstring-or-setname\fR" 4
.IX Item "-r, --required [num#]string-or-setname"
Specifies that all generated passwords (\fBnot\fR passphrases) must have at least
\&\fInum\fR (default 1) occurrences of the characters specified by
\&\fIstring-or-setname\fR, which may be a named set (e.g., \f(CW\*(C`:alphanum\*(C'\fR) or a string
of required characters (e.g., \f(CW\*(C`aeiou\*(C'\fR).
.Sp
For example, the following will generate passwords with at least 2 digits and
at least 1 of the given punctuation marks:
.Sp
.Vb 1
\&    randpass -c :alphanum -c '!@%' -r '2#:num' -r '!@%'
.Ve
.Sp
Any required characters must be specified in a \fB\-c\fR or \fB\-C\fR option.
.IP "\fB\-M\fR, \fB\-\-maximum\-rejects\fR \fInum\fR" 4
.IX Item "-M, --maximum-rejects num"
The maximum number of passwords that may be rejected (default 5,000).  If this
is exceeded, an error will result.
.IP "\fB\-s\fR, \fB\-\-source\fR \fIfile\fR" 4
.IX Item "-s, --source file"
Specify the source file from which words will be drawn in generating
a passphrase.  This file will typically consist of a single word
per line (but creative uses of \f(CW\*(C`randpass\*(C'\fR may do otherwise for interesting
results).
.Sp
The default is \f(CW\*(C`/usr/share/dict/words\*(C'\fR.  The special file name \f(CW\*(C`\-\*(C'\fR
may be used to specify standard input.
.Sp
Note: If the source file doesn't have enough lines (of sufficient length)
to generate the full passphrase, the program exits with code 1 and prints
a suitable error message to standard error.
.IP "\fB\-F\fR, \fB\-\-freli\fR" 4
.IX Item "-F, --freli"
Use the \s-1FRELI\s0 word list (\f(CW\*(C`/usr/share/dict/freli\*(C'\fR when generating passphrases.
(See <http://www.nkuitse.com/freli/> for more information about \s-1FRELI\s0.)
.IP "\fB\-j\fR, \fB\-\-join\fR \fIstring\fR" 4
.IX Item "-j, --join string"
When generating a passphrase, connect the words with the specified
string rather than a space.
.IP "\fB\-P\fR" 4
.IX Item "-P"
Uses the author's favorite options by default (\f(CW\*(C`\-p 2 \-l 3\-5\*(C'\fR) and adds the
option \f(CW\*(C`\-s /usr/share/dict/freli\*(C'\fR if there is a file at that location.
.IP "\fB\-V\fR, \fB\-\-version\fR" 4
.IX Item "-V, --version"
Display version information.
.IP "\fB\-h\fR, \fB\-\-help\fR" 4
.IX Item "-h, --help"
Display help.
.SH "AUTHOR"
.IX Header "AUTHOR"
Paul Hoffman ( nkuitse \s-1AT\s0 cpan \s-1DOT\s0 org )
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright 2003\-2008 Paul M. Hoffman.
.SH "LICENSE"
.IX Header "LICENSE"
This script is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.