![]() |
|
Choosing good passwords |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Date: 21 January 2009 Original URL: http://www.auscert.org.au/render.html?cid=3000&it=2260 References: How hard is it to choose a good password? Most people believe that choosing a good password is easy. After all, how is somebody going to guess my wife's maiden name? In reality, people usually choose poor passwords. In 1990 [Klein 1990] an attempt to crack a large password database revealed over three hundred passwords in the first fifteen minutes! One fifth of all password were obtained in the first week and approximately one quarter were cracked by the end of the search. More than half of the cracked passwords were six characters or less and some accounts didn't even have a password. An intruder only needs one password! Choosing a good password is a trade off between something that is difficult to guess versus something that is easy to remember. While @G7x.m^l is probably a good password, nobody will remember it and it is certain to appear as a sticky note attached to a terminal. Conversely, your first name is very easy to remember, but it is also trivial to guess. Some simple rules of thumbSome simple guidelines that will help you choose better passwords are:
Cracking passwordsThe principle behind password cracking is quite simple: take a large word list, encrypt each word and check if the encrypted string matches the user's password. Word lists that are used frequently include English and other language dictionaries, common names, pet names, television and movie characters, character patterns on keyboards (for example, qwerty) and jargon or slang terms. To allow for the case that the user has not chosen a word in your word list, an intruder can and usually will apply a large number of simple rules to each word in the word list and check if any of these encrypt to the user's passwords. Typical rules include appending and prepending digits and other punctuation characters to words, reversing words, capitalising words, converting words to all upper or all lower case, substituting letters or digits for other letters and naturally many combinations of these. Since computers are fast, applying these rules and encrypting the resulting guess doesn't take much time and a lot of guesses can be made in a very short time. In addition, a CD based database is supposed to have been produced that contains every word in a large dictionary plus many rule based permutations of these words encrypted in every possible manner. This reduces password cracking to a simple (and fast) database lookup. How long is a good password?The simple answer to this is that in general the longer the password the better. Assuming that you're using a reasonable selection of characters for your password, say letters and numbers, then the following table presents the number of passwords possible for the various choices of length. It also includes an estimate of how much time would be required to crack the password using a brute force attack. The cracking time field is derived from a report in September 1993, that claimed the record for the speed of cracking passwords. The claim was that 6.4 million passwords per second could be tested. Given that computer speeds are increasing continuously, the following times are almost certainly over estimates of the actual time required.
Having said that longer is better, it is important to note that many machines artificially restrict the length of the password usually by silently truncating what you enter to their maximum length. Since this length is often eight characters under Unix, the rest of this article will assume that an eight character password is being used. What characters should a good password contain?The previous section assumed that passwords consisted of upper and lower case letters and digits. What happens if this character set is increased or decreased? The following table presents some of the options for eight character passwords:
So clearly, the richer the character set being used, the harder it will be to crack passwords. You should attempt to include as a minimum both upper and lower case characters and if possible, you should also include some digits, punctuation symbols and/or control codes in your password. Rarely used passwords and secure storageThere is one situation where writing down your password is a good idea - protecting something important that doesn't require credentials very often. For instance, the root password on a server probably doesn't need to be used every day. In a case like this it is a good idea to create a long, very complex password that is hard to remember, write it down and store the password in some kind of secure storage (like a safe). On the rare occasion that the password is needed it can be retrieved from storage and used (and the password then returned to storage). The password should still be changed regularly. Balancing RiskOf course, situations vary. If you find that you (or your users) have a tendancy to forget passwords and start making simpler, less secure passwords it may be better to use a complex password and write it down. Just remember that if anyone gets a hold of the written down version they have a free pass into the system. Any written down passwords should not be kept on or near your computer and preferable should not be kept near any information that identifies you. Store it securely - a locked drawer is much better than your wallet. Examples of how to construct good passwordsSo now that typical bad passwords have been discussed, how is a good password constructed? Try combining two or more words together or taking the first (or second or last) letter of each word in an easily remembered phrase. Then mangle the result by adding capitals, digits and punctuation characters. As an extra measure, control characters can also be introduced. Some examples of using multiple words with punctuationHere is a pair of good examples of using multiple words:
And here is a bad one:
Some examples of using a phraseHere are three good examples of using phrases:
And here is a bad one:
Passwords to never, EVER useThere is a very handy list of the worst 500 passwords over at What's My Pass?. In addition to that, all the sample passwords listed in this article are now known, and should not be used by anyone. |