Aug. 23, 2012, 1:03 p.m.

Passwords continued...

I am known to frequently carry on and on about passwords, but it is time to do so again. There is a widely popular comic on the web, basically explaining that all the advice given to people to choose strong passwords are incorrect, as people end up having to choose passwords that are almost impossible to remember however easy to brute force.

As an example, take this password:

!Q@w#e$r%T

Does it look strong? Sure you say. Based on what I wrote here, it is 10 characters long, has combination of all the character classes, does not seem obvious, so it should be secure, right? Wrong. This is an example (similar to, not the same) from a production environment representative of root user passwords.

The problem with that password is not complexity - brute forcing that password will not happen in our lifetime with current technology. Thing is, today hackers use large dictionaries and rule sets to crack passwords. In this case, the password exhibits a pattern on the QWERTY keyboard. Look closely, there is a clear pattern how to type that in. And once it follows some logic, it can be expected hence anticipated for inclusion in dictionaries / rules. Leaks such as the Linkedin, Yahoo, eHarmony etc. are much more than what it seems. Hackers from all over the world invest a lot of time and effort to crack the passwords, mainly to understand how the human brain choose passwords. So if a site is hacked that does not salt their passwords for instance, a rainbow table can be used to quickly crack all the passwords. The patterns and structure of those passwords then get fed in to the new dictionary lists and rule based engines, making them much stronger. Substituting 0 for o and 1 for i is no longer effective - in fact, it adds maybe one second to the time to crack your password. No matter what you do, if it can be expected it can be coded for and cracked.

By the way, I cracked that password above in 2 seconds on my system that runs through about 200 million passwords / second - rather slow by modern standards.

The problem I want to address is the huge amount of misinformation spread throughout the web regarding passwords. Lets take a look at some of them:

  1. Microsoft - I typed in passwordpassword and the system told me it is strong. It took me 2 seconds to crack it. It also told me the password in the opening paragraph is Medium strength.
  2. This site suggests this is a good password: tlpWENT2m and to an extent I agree, it is 9 characters and hard to guess. Yet the password validator above suggests it is Weak.
  3. Try another site, and passwordpassword now scores 11%, which is good. However !Q@w#e$r%T scores 100%, yet I cracked it within 2 seconds. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa is considered 0%, very weak. Yet I guarantee you nobody will crack it.
  4. 1Password considers !Q@w#e$r%T to be an excellent password.
  5. 1Password considers e^4AQF a "Good" password:
    1Password
    1Password

    yet any random 6 character password in the printable character set can be cracked within 13 minutes on mid range hardware using brute force techniques: adea7c09f7f73335dfadf4884923226e:e^4AQF

    Status.......: Cracked
    Input.Mode...: Mask (?1?1?1?1?1?1)
    Hash.Target..: adea7c09f7f73335dfadf4884923226e
    Hash.Type....: MD5
    Time.Running.: 4 mins, 23 secs
    Time.Util....: 263506.8ms/143.1ms Real/CPU, 0.1% idle
    Speed........: 924.0M c/s Real, 929.7M c/s GPU
    Recovered....: 1/1 Digests, 1/1 Salts
    Progress.....: 243481133056/735091890625 (33.12%)
    Rejected.....: 0/243481133056 (0.00%)
    HW.Monitor.#1: 0% GPU, 58c Temp
    
  6. This site tries to tell you that long pass phrases are useless.

So what does this mean?

  1. Do not rely on password strength validators for any useful information.
  2. Do not assume just because a password is long and looks random it is secure.
  3. Most people have no clue what a strong password is.
  4. The definition of a "strong" or "good" password is relative. Does it refer to how well a password will hold up against offline brute force attacks against its hash, or does it refer to how well it holds up against online attacks, such as your sister trying to log in to your gmail account. This article speaks to the latter case - i.e. worse case scenario. For avoiding purely online password guess attempts the bar can be lowered considerably. In that case a 6 character random password is next to impossible to crack. It will take 23 years to crack such a password if only 1000 guesses per second can be made.

There are two sides of this coin to consider. The first being that most people do not see the value in protecting their passwords. The second being people choosing poor passwords as they do not understand the mechanics of password cracking.

Lets first consider the social issue. Many people I speak to, this includes business people, tell me things such as:

Unfortunately these comments are not based on reality. In reality:

Finally, lets consider the issue of poor passwords - something even seasoned IT professionals are struggling with:

A random password consisting of 10 characters in the set a-z, A-Z, 0-9, special characters has an entropy of about 66 bits (that set of characters consists of 95 unique characters, and the entropy per character is given as log2(n). Since n is 95, the entropy of a single character is 6.6 bits). I just said that this is basically unbreakable using today's computing power.

If you treat a word as a character, and use a couple of truly random words in a pass phrase, with very few words you can create an incredibly strong password. If you have a word list such as Diceware that consists of about 7776 words, each word will have an entropy of log2(n) which is 12.92 bits per word. Since we are using words as characters, and since the entropy per word is so much bigger than per character, we need fewer words. It is as easy for a human remembering a word as remembering a single character, yet for a computer this is not true. So if you choose 4 truly random words, say

dog cat patio peach

then the total entropy of that phrase is 51.68. It sounds low, and probably is too depending on the words chosen. That can be cracked on top end hardware in about 10 hours provided the correct dictionary is used (Diceware in this case). Change the passphrase to

dog cat flies pasta

and suddenly it gets much tougher, as two of those words are not in the diceware list. So now the attacker has to expand his word list. Lets say he chooses a dictionary containing the most common words, lets assume this is a 50 000 word list dictionary and that it contains these words listed above. Suddenly the entropy per word is 15.6, meaning that passphrase is now 62.4 bits strong, which will take 2 years to crack. Spice it up by including an uncommon word and you are quite safe. Lets use this passphrase:

dog skirr flies run

The word "skirr" is very uncommon, and to catch that you need to use a larger dictionary. Currently it is estimated that there are between 250 000 and 1 000 000 english words. Lets take an average - 500 000. Lets assume this is a well represented dictionary. If that is my dictionary, cracking the password above suddenly involves 18.9 bits of entropy per word, which is 75.6 bits total entropy which will take 20 000 years to crack assuming (like in all instances above) one can try 100 billion passwords per second.

Since hackers would always take parallel approaches, we need to ensure the password is long enough. This one is 19 characters long, all lowercase. It will take half a billion years to crack, even though it only consists of lowercase characters, via brute force. We are OK.

One thing to keep in mind though - this works only of you do not make the !Q@w#e$r%T mistake with pass phrases by choosing something obvious. This is BAD:

twinkle twinkle little star

as it is a common phrase. Even this is bad:

people love to dance

because it is grammatically sound English, and that introduces a pattern that can be anticipated and countered by refining the way the hacker combines words from the word list. Verbs will follow nouns for instance, significantly reducing the entropy. The whole point is to choose purely random words that makes no sense to any human.

Take note that the password below does not increase entropy and actually is easily crackable:

d0g cat P4tio

Common substitutions does not make the password stronger.

A great password should be a truly random combination of uppercase and lowercase letters, digits and symbols, be at least 10 characters long and should not be shared between multiple accounts. Example: 1(w8Ymq"c

Another great password is a truly random combination of at least 4 words, ensuring at least one word is uncommon (not by virtue of fancy substitutions but rather just not likely to be found in a common word list), and ensuring the total length of the password exceeds 15 characters. Also, it should not be re-used between accounts. Example: dog skirr flies run

If you are trying to protect against online attacks only, a truly random 6 character random password will be as strong as a 10 character password. Likewise, a truly random 3 word pass phrase - even using common words, as long as it consists of at least 9 characters - will be as strong as a four word pass phrase with an uncommon word in the mix. This is based on the assumption of a maximum of 1000 password guess attempts per second.