Password Strength
Password Strength
The comic illustrates the relative strength of passwords assuming basic knowledge of the system used to generate them. A set of boxes is used to indicate how many bits of entropy a section of the password provides. The comic is laid out with 6 panels arranged in a 3x2 grid. On each row, the first panel explains the breakdown of a password, the second panel shows how long it would take for a computer to guess, and the third panel provides an example scene showing someone trying to remember the password.
[The password "Tr0ub4dor&3" is shown in the center of the panel. A line from each annotation indicates the word section the comment applies to.]
Uncommon (non-gibberish) base word [Highlighting the base word - 16 bits of entropy.] Caps? [Highlighting the first letter - 1 bit of entropy.] Common Substitutions [Highlighting the letters 'a' (substituted by '4') and both 'o's (the first of which is substituted by '0') - 3 bits of entropy.] Punctuation [Highlighting the symbol appended to the word - 4 bits of entropy.] Numeral [Highlighting the number appended to the word - 3 bits of entropy.] Order unknown [Highlighting the appended characters - 1 bit of entropy.] (You can add a few more bits to account for the fact that this is only one of a few common formats.)
~28 bits of entropy 2 28 = 3 days at 1000 guesses/sec (Plausible attack on a weak remote web service. Yes, cracking a stolen hash is faster, but it's not what the average user should worry about.) Difficulty to guess: Easy
[Cueball stands scratching his head trying to remember the password.] Cueball: Was it trombone? No, Troubador. And one of the O's was a zero? Cueball: And there was some symbol... Difficulty to remember: Hard
[The passphrase "correct horse battery staple" is shown in the center of the panel.] Four random common words {Each word has 11 bits of entropy.}
~52 bits of entropy 2 44 = 550 years at 1000 guesses/sec Difficulty to guess: Hard
[Cueball is thinking, in his thought bubble a horse is standing to one side talking to an off-screen observer. An arrow points to a staple attached to the side of a battery.] Horse: That's a battery staple. Observer: Correct! Difficulty to remember: You've already memorized it
Through 20 years of effort, we've successfully trained everyone to use passwords that are hard for humans to remember, but easy for computers to guess.

This comic says that a password such as "Tr0ub4dor&3" is bad because it is easy for password cracking software and hard for humans to remember, leading to insecure practices like writing the password down on a post-it attached to the monitor. On the other hand, a password such as "correct horse battery staple" is hard for computers to guess due to having more entropy but quite easy for humans to remember.
Entropy is a measure of "uncertainty" in an outcome. In this context, it can be thought of as a value representing how unpredictable the next character of a password is. It is calculated as log2(a^b) where a is the number of allowed symbols and b is its length.
A truly random string of length 11 (not like "Tr0ub4dor&3", but more like "J4I/tyJ&Acy") has log2(94^11) = 72.1 bits, with 94 being the total number of letters, numbers, and symbols one can choose. However the comic shows that "Tr0ub4dor&3" has only 28 bits of entropy. This is because the password follows a simple pattern of a dictionary word + a couple extra numbers or symbols, hence the entropy calculation is more appropriately expressed with log2(65000*94*94), with 65000 representing a rough estimate of all dictionary words people are likely to choose. (For related info, see https://what-if.xkcd.com/34/ ).
Another way of selecting a password is to have 2048 "symbols" (common words) and select only 4 of those symbols. log2(2048^4) = 44 bits, much better than 28. Using such symbols was again visited in one of the tips in 1820: Security Advice .
It is absolutely true that people make passwords hard to remember because they think they are "safer", and it is certainly true that length, all other things being equal, tends to make for very strong passwords and this can be confirmed by using rumkin.com's password strength checker . Even if the individual characters are all limited to [a-z], the exponent implied in "we added another lowercase character, so multiply by 26 again" tends to dominate the results.
In addition to being easier to remember, long strings of lowercase characters are also easier to type on smartphones and soft keyboards .
xkcd's password generation scheme requires the user to have a list of 2048 common words (log 2 (2048) = 11). For any attack we must assume that the attacker knows our password generation algorithm, but not the exact password. In this case the attacker knows the 2048 words, and knows that we selected 4 words, but not which words. The number of combinations of 4 words from this list of words is (2 11 ) 4 = 2 44 , i.e. 44 bits. For comparison, the entropy offered by Diceware's 7776 word list is 13 bits per word . If the attacker doesn't know the algorithm used, and only knows that lowercase letters are selected, the "common words" password would take even longer to crack than depicted. 25 random lowercase characters would have 117 bits of entropy , vs 44 bits for the common words list.
Example
Below there is a detailed example which shows how different rules of complexity work to generate a password with supposed 44 bits of entropy. The examples of expected passwords were generated in random.org.(*)
If n is the number of symbols and L is the length of the password, then L = 44 / log 2 (n).
a = lowercase letters A = uppercase letters 9 = digits & = the 32 special characters in an American keyboard; Randall assumes only the 16 most common characters are used in practice (4 bits)
(*) The use of random.org explains why jAwwBYne has two consecutive w's, why Re-:aRo has two R's, why [email protected] ~"#^.2 has no letters, why ewpltiayq has no numbers, why "constant yield" is part of a password, etc. A human would have attempted at passwords that looked random.
The title text likely refers to the fact that this comic could cause people who understand information theory and agree with the message of the comic to get into an infuriating argument with people who do not — and disagree with the comic.
If you're confused, don't worry; you're in good company; even security "experts" don't understand the comic:
Sigh. 🤦‍♂️
The comic illustrates the relative strength of passwords assuming basic knowledge of the system used to generate them. A set of boxes is used to indicate how many bits of entropy a section of the password provides. The comic is laid out with 6 panels arranged in a 3x2 grid. On each row, the first panel explains the breakdown of a password, the second panel shows how long it would take for a computer to guess, and the third panel provides an example scene showing someone trying to remember the password.
[The password "Tr0ub4dor&3" is shown in the center of the panel. A line from each annotation indicates the word section the comment applies to.]
Uncommon (non-gibberish) base word [Highlighting the base word - 16 bits of entropy.] Caps? [Highlighting the first letter - 1 bit of entropy.] Common Substitutions [Highlighting the letters 'a' (substituted by '4') and both 'o's (the first of which is substituted by '0') - 3 bits of entropy.] Punctuation [Highlighting the symbol appended to the word - 4 bits of entropy.] Numeral [Highlighting the number appended to the word - 3 bits of entropy.] Order unknown [Highlighting the appended characters - 1 bit of entropy.] (You can add a few more bits to account for the fact that this is only one of a few common formats.)
~28 bits of entropy 2 28 = 3 days at 1000 guesses/sec (Plausible attack on a weak remote web service. Yes, cracking a stolen hash is faster, but it's not what the average user should worry about.) Difficulty to guess: Easy
[Cueball stands scratching his head trying to remember the password.] Cueball: Was it trombone? No, Troubador. And one of the O's was a zero? Cueball: And there was some symbol... Difficulty to remember: Hard
[The passphrase "correct horse battery staple" is shown in the center of the panel.] Four random common words {Each word has 11 bits of entropy.}
~52 bits of entropy 2 44 = 550 years at 1000 guesses/sec Difficulty to guess: Hard
[Cueball is thinking, in his thought bubble a horse is standing to one side talking to an off-screen observer. An arrow points to a staple attached to the side of a battery.] Horse: That's a battery staple. Observer: Correct! Difficulty to remember: You've already memorized it
Through 20 years of effort, we've successfully trained everyone to use passwords that are hard for humans to remember, but easy for computers to guess.
