by runeks · 14y ago · 0 comments
cat /usr/share/dict/words|egrep -v "é|'s$|[Åå]|[Øø]"|shuf --random-source=/dev/random -n4
This uses the dictionary /usr/share/dict/words and skips all the words containing characters like é, å, ø and all those ending in 's. The resulting word list has 72,940 words in it. Then it chooses 4 random words from this dictionary and prints them to the screen. This gives a password with about 65 bits of entropy.By adding another word, thus creating a 5-word passphrase, a botnet capable of checking 1,000 trillion passwords per second would spend, on average, 1600 years cracking away before it would find the correct passphrase.
Here are some example 4-word passphrases produced using this method:
poetically archaisms accept constrictors
leukemia shuttlecocked checkout benevolently
climactic gyrate dynamical predominates
massage beef Concords recliners
These are surprisingly easy to remember. I use a 7-word passphrase for the most important things and it didn't take me more than a day or two to learn it. WeampE6quaph (Weamp-E-SIX-quaph)
2hoov2Klypfo (TWO-hoov-TWO-Klyp-fo)
GicutOj8 (Gic-ut-Oj-EIGHT)
HegEmWydwev5 (Heg-Em-Wyd-wev-FIVE)
Tegdijetyik4 (Teg-dij-et-yik-FOUR)
Fon7ochry (Fon-SEVEN-och-ry)
I usually take the password and type it about 100 times to see how it feels, subtly changing any characters that feel awkward to type. This gives me a password that is very fast and natural to type (less likely to have errors), but still has a lot of randomness and obeys all the stupid password rules. 72940^4 = 2.8304992 × 10^19
To put it in perspective, a 14-character password using only lower case English alphabet letters as individual tokens already beats this: 26^14 = 6.45099747 × 10^19The key takeaway here is that every word adds another 16.15 bits (assuming good random source and no non-random decisions by the user), whereas another character adds only 4.7 bits. I'd argue that the effort to remember another 4 random characters (to reach those 16 bits) is far more than the one to remember another random word. We're quite good with words, you know :)
Edit: also, for anyone wanting something like the above technique, I recommend Diceware.
I haven't seen any passphrase advocates say that.
The ones I've seen all say "use 4-5 random dictionary words". Come up with a meaning for the phrase, and it'll be easy to remember.
LC_ALL=C egrep '^[[:lower:]]{4,8}$' /usr/share/dict/words |
shuf --random-source=/dev/random -n4 |
fmt
That's picking from ~35,000 words, which I think is still good enough but avoids ending up with "interpreters incredibility disciplinary constitutionality". (I need the C locale to stop this old GNU grep being painfully slow.)Even relatively high-stakes companies like banks and credit card companies make obscenely stupid mistakes when it comes to security. For example, there was a case fairly recently where you could log into your Citibank account and change the account number in the GET query string, and you'd instantly have access to anybody else's account. Given that they're capable of that type of idiocy, all it takes is for one mental giant to decide that encrypting your password is better than hashing it, and you're vulnerable.
Malicious behavior isn't the only thing to watch out for. By doing business with the outside world, we're putting ourselves at the mercy of complete morons every day. If you use a different passphrase for every account, then you can at least limit your risk to one service.
egrep -v "é|'s$|[Åå]|[Øø]" /usr/share/dict/words|shuf --random-source=/dev/random -n4http://en.wikipedia.org/wiki/Cat_%28Unix%29#Useless_use_of_c...
function mkpw () {
if (( $# == 0 )) then
head /dev/urandom | uuencode -m - | sed -n 2p | cut -c1-${1:-12}
else
head /dev/urandom | uuencode -m - | sed -n 2p | cut -c1-${1:-$1}
fi
}
By default it generates an alphanumeric string of length 12. Given an integer argument n it generates an alphanumeric string of length n. massage beef Concords recliners
Damn you.