Sunday, February 15, 2015

XKCD password generator

My old password was one of those that is hard to remember, but easy for computers to guess.
I decided to take that comic's advice and use randomly selected common words. To do that, I needed a list of common words and a way to randomly select them. I'm using Ubuntu these days, and fortunately, everything I need is a one liner in the terminal:

sort -R /usr/share/dict/american-english | head -n 4

In this case, 4 is the number of words. To gauge the strength of this password, I looked at the number of words in the file, about 100000 or 10^5. Four words as the comic suggests then would be about 10^20 or 67 bits in base 2 according to wolframalpha. Eight words from this file, it seems, would give more bits of entropy than a 128bit encryption key

Edit: I noticed the random function here isn't very random. To fix that,

sort -R --random-source=/dev/random /usr/share/dict/american-english | head -n 4

No comments:

Post a Comment