6

I got inspired by this xkcd webcomic:

The topic is also discussed here: https://www.ted.com/talks/lorrie_faith_cranor_what_s_wrong_with_your_pa_w0rd

Now I wonder:
How can I create a password out of four random dictionary words without using the internet?

dessert
  • 39,982

4 Answers4

6

Locally installed dictionaries are stored in /usr/share/dict/, for example:

$ ls -1 /usr/share/dict/
american-english
british-english                                                                                                          
cracklib-small                                                                                                             
README.select-wordlist                                                                                                  
words                                                                                                                    
words.pre-dictionaries-common

Here the first two are interesting, those dictionaries are simple word lists with one word per line. We can use shuf to output 4 random lines from one of them (and awk to replace newlines with spaces):

shuf -n4 /usr/share/dict/american-english | awk NF=NF RS= OFS=' '

Here's some example output:

contributions autumn's catalepsy's hemline's
footlights Levi's awfuller rascals
fogies flavoring preregistering requital's
Coleman's cartel halfpennies Williamson
étude's maintainers reviler's dapperest
pizazz Galahads McDowell derby
corroborate bureaucracies anchovy meager
filet Tawney feudalistic backstabbing
Beatriz sitcom surpasses guttural's
warehouse's unfamiliarity's Ashlee's sanguinary
dessert
  • 39,982
  • Or you can use and actual paper edition dictionary or any other book, open it in a random page and drop a pen ballpoint down. There's your first word. Repeat 3 more times. You can use the same method to write dadaist poetry. –  Nov 15 '17 at 22:42
  • This is a very easy way to generate random words, but I would check carefully, that shuf is using a good random generator before letting it create my passwords; 2. If shuf is good, I would still prefer a word list, that is made for this purpose, for example the default list of xkcdpass or the custom word list from https://help.ubuntu.com/community/StrongPasswords#Custom_word_list
  • – sudodus Nov 16 '17 at 14:55
  • I made a shellscript that prunes the files in your computer, so that they work better with the xkcd method. See my edited answer and compare with the results from the original files. – sudodus Nov 17 '17 at 20:05
  • @sudodus So no feudalistic backstabbing? Thank you very much for working so hard on this, the pruner is great! It's a pity xkcdpass doesn't allow (truly) custom wordlists… – dessert Nov 17 '17 at 20:24
  • You are welcome. I enjoy cooperating with you :-) No feudalistic backstabbing and no étude's after pruning :-D ; I can use xkcdpass with the option -w like so: for i in *pruned*; do echo "$i:";xkcdpass -w "$i";echo "-----";done and of course add other options too, to get more precisely the format I want. – sudodus Nov 17 '17 at 20:31
  • @sudodus That's a case of RTFM, in fact I did know the option, but thought it would only allow the provided wordlists… facepalm – dessert Nov 17 '17 at 20:41