Random here means "what will be time-consuming for the attacker".
Passwords are technically made up from various characters (which may be lowercase, uppercase, ...) because they are handled as a string. There are two kind of passwords:
- the ones which are handled by the users
- the ones which are handled by a password manager
The second case is easy: go for long, complicated combinations of whatever you can, up to the limits of the application asking for the password (they put some limits, sometimes these limits are horrendous). !sg8Itp2%hjxXxo6a6TGMbJs8Jcxtk205XgZ@M^C2CmAgfC*q6
is a great password I just came up with, random and everything.
The first case is more complicated as you have a conflict between your memory, what is "random" for you and what is a "character".
Let's make it clear from the start that anything other that the truly random password above reduces considerably the so called 'key space', that is the number of possibilities for a password. the larger the key space, the better. But this is not a problem, when approached carefully.
Your only aim is to build a password which takes a "long time" to be cracked. You define yourself what is a long time. This can be 1 minute or 100 years. Due to statistics and the fact that CPU is cheap let's aim for 1000 years. 1000 years of efforts by a dedicated cracker who will have the computing power of the NSA at his disposal.
The cracker will attack you passwords by trying all possible combinations (I made some assumptions here regarding the proper quality of password storage by the application owner). This means that he will try a
, b
, ... aa
, ab
, ...
Well, no. He will not try that because he knows that your password is likely to be at least 6 characters long. And here comes one of the key points regarding randomness: you must absolutely assume that the cracker knows how your password is built. No "security by obscurity" here (it is useful in other places, but not here).
Which leads me to the last part: your memory. You will not be good at remembering the 50 characters password I gave earlier. You will end up with something which resemble words and their variations. Embrace that! Go full monthy and build a password made up from a few (4 or 5) random words!
But "everybody says that using dictionary words is bad". The ones who did not do the math do.
Let's compute that: you have a password made up of 4 words, each of them being one out of 7000 possibilities (this is the average vocabulary of the population. Please note that:
- the total vocabulary is in the range of 70,000-100,000 words (French or English) ...
- ... so we take a small subset of words you can actually think of ...
- ... as you will probably not choose your words with the dice method but rather out of the blue
You therefore have 7000^4 ~= 10^15
passwords. Top-end dedicated cracking environments can try 10^10
combinations per seconds, which is about 1 day with the 4 words version. 5 words bring you to 30 years. This is for offline attacks, when the attacker got hold of your password database. An online attack is impractical (about 1000 combinations pers second best case).
As a comparison, a 8 characters password with lower case, upper case and digits has 10^14
combinations.
Notes:
- the information above is pertinent when attacking passwords either online or offline, for correctly stored passwords. This is to say that if the password is stored in plain text or is a non-salted short one, it will be cracked immediately
- I strongly belive that the password stategy must be chosen wisely. Sometimes no password is OK, sometimes multifactor authentication is the way to go. There is no "one size fits all" solution.
- I also strongly belive that the password startegy must be pragmatic and address real-world constraints. Not everyone can remember 253 passwords which are 25 characters long and chnage every three months.
- sadly, many standards and official recommendations are dumb as [censored] and we still end up with
Hello1
passwords because they happen to fit the construction rules.
I did recently a comparison of password recommendations from NIST, ISO27002, HIPAA, SANS, PCI-DSS, French and German governmental agencies, ISF and CobIT (specifically on password expiration). The order above is from "well thought" to "I took whatever was invented by a random guy or gal in the 90' and put that on paper because I stopped math in 6th grade and my 4 neurons do not allow me to concentrate more that 20 seconds on a problem"
EDIT: following a request in comments, below is the conclusion from the review of the standards. This is in contrast with research showing that password expiration does not improve security.
- no recommendation at all (NIST)
- no recommendation other than “regular changes” (ISO27002)
- risk-assessment based changes, less than 2 years (HIPAA)
- 180 days (SANS)
- 90 days (PCI-DSS, French and German governmental agencies, ISF, CobIT)
The ISF recommendation is particularly disappointing, taken into account the great work they do.