mpmul.[ch]: Move internal `HWM' and `LWM' constants to implementation.
[u/mdw/catacomb] / mkphrase.1
CommitLineData
6abcf20f 1.\" -*-nroff-*-
2.ie t \{\
3. if \n(.g \{\
4. fam P
5. \}
6. ds ss \s8\u
7. ds se \d\s0
8. ds us \s8\d
9. ds ue \u\s0
10. ds *b \(*b
11.\}
12.el \{\
13. ds ss ^
14. ds se
15. ds us _
16. ds ue
17. ds *b \fIbeta\fP
18.\}
19.de VS
20.sp 1
21.RS
22.nf
23.ft B
24..
25.de VE
26.ft R
27.fi
28.RE
29.sp 1
30..
31.TH mkphrase 1 "9 June 2005" "Straylight/Edgeware" "Catacomb cryptographic library"
32.SH NAME
33mkphrase \- generate passphrases with guaranteed minimum entropy
34.SH SYNOPSIS
35.B mkphrase
36.RB [ \-p ]
37.RB [ \-b
38.IR bits ]
39.RB [ \-g
40.IR generator ]
41.br
45c0fd36 42
6abcf20f 43.RB [ \-n
44.IR count ]
45.RB [ \-r
46.RI [ min\fB\- ] max ]
47.IR wordlist ...
48.SH DESCRIPTION
49The
50.B mkphrase
51program generates pronounceable but random passphrases in such a way
52that they're guaranteed to have at least a given level of entropy.
53.PP
54The program generates phrases using a wordlist. Usually this will be
55something like
56.BR /usr/share/dict/words ,
57though you can use anything you want. Wordlist files are expected to
58contain whitespace-separated words. Letters are smashed to lowercase;
59apostrophes are retained; other funny characters are ignored.
60.PP
61Options provided are:
62.TP
63.B "\-h, \-\-help"
64Write a help summary for
65.B mkphrase
66to standard output and exit.
67.TP
68.B "\-v, \-\-version"
45c0fd36 69Write
6abcf20f 70.BR mkphrase 's
71version information to standard output and exit.
72.TP
73.B "\-u, \-\-usage"
74Write a really brief usage summary for
75.B mkphrase
76to standard output and exit.
77.TP
78.BI "\-b, \-\-bits=" bits
79Set the minimum entropy for acceptable phrases. The default is 128
80bits. This might increase in future.
81.TP
82.BI "\-g, \-\-generator=" generator
83Use the given
84.I generator
85to construct passphrases. See below. The default generator is
86.BR markov .
87.TP
88.BI "\-n, \-\-count=" count
45c0fd36 89Produce
6abcf20f 90.I count
91phrases. The default is to produce only one.
92.TP
93.B "\-p, \-\-probability"
94After each phrase, write the entropy of the passphrase, in bits.
95.TP
96.BR "\-r, \-\-range=" [\fImin - ]\fImax
97Set a range for acceptable word lengths. The default is to allow
98(almost) arbitrary length words, though these can be hard to remember.
99.PP
100The following phrase generators are implemented.
101.TP
102.B markov
103Builds a Markov model of the words in the wordlist(s). It then uses
104this to produce new `words' with similar statistical properties.
105They're usually pronounceable and often absurdly memorable.
106.IP
107Here's how it actually works. The program builds a big table which
108remembers how often each given letter occurs given the three preceding
109letters. There is a special placeholder letter for `before-the-start',
110and another for `end-of-word'. On output, we remember the last three
111letters emitted as our `state': then we choose a letter to emit at
112random, with the probability for each choice determined by how often it
113turned up following the letters in the state in the wordlists. The new
114letter is then shifted into the state and we try again, until we choose
115the end-of-word letter. The initial state is three before-the-start
116placeholder `letters'.
117.IP
118The word length limits are imposed by filtering the output of the Markov
119word generator. Strict limits make the program run slowly. The
120generator tracks the probability it had of making each choice of letter
121as it goes, and we just produce words until the phrase is sufficiently
122entropic.
123.TP
124.B wordlist
125Very simple: just choose random words from the wordlist until the phrase
126has enough entropy. Phrases are usually longer than Markov-generated
127ones.
128.SH BUGS
129Three letters work fairly well for English. However, they may not work
130so well for other languages.
131.SH AUTHOR
f387fcb1 132Mark Wooding, <mdw@distorted.org.uk>.