09/05/11 21:30:05

Four Word Passwords - xkcd #936


Here’s how to generate a quick four-worder from the command line:

shuf -n4 /usr/share/dict/words | tr -d '\n'

Source: Command Line Fu

Unfortunately this only works on Linux. On OS X we could use something like jot (which is mentioned on Command Line Fu as well), but here’s a rather convenient Perl solution:

perl -le 'chomp(@words= <>); print join " ", map {@words[rand @words]} 1..4' /usr/share/dict/words

(Yes, this post took a while. I know…)

#security #passwords