2020-11-20

Suggestions For Creating Passwords

Scope And Purpose Of This Post


Even after someone makes the very wise decision to start using a password manager so they can start having strong, unique passwords, they still have to decide what password generator settings to use.  They have to decide stuff like whether to use digits and punctuation in their passwords, how long their passwords should be, and whether they should use passphrases.

The password generator settings you use should depend on how you're going to use the password.  Passphrases are great for passwords you need to remember, but maybe not for your work password that you manually type >20 times a day.  My recommendations depend on the "password use case":

  • Remembered and typed <8 times a day.
    • This would be your master password for your password manager.
    • Use a passphrase.  Six words for your master password.  Five words are okay for passwords that are far less important than your master password.
    • If your password manager doesn't generate passphrases for you, make it generate a bunch of digits and use the diceware word list or an EFF word list.
  • Not remembered and rarely/never typed.
    • Your most common password use case, for stuff like Facebook.
    • I recommend a "1D+1U+15L" password: 1 digit, 1 upper case letter, 15 lower case letters, for a total length of 17.
    • If your password generator doesn't support that, go for 14 alphanum characters (uses lower case letters, upper case letters, digits)
  • Remembered and typed many times a day.
    • This is possibly the use case for your work password, which you have to type to unlock your computer and log in to many services.
    • Because you are typing this so frequently, you might not need the memorability of a passphrase, and you probably don't want the typing hassle.
    • I recommend something like a "1D+1U+12L" password, even if you have to manually modify a password generated by your password manager.
Note: for this blog post, we'll be assuming we never use an ambiguous letter or digit ("IOlo10"), except in passphrases.  It is tempting to think that if you know that a non-passphrase password only contains lower case letters, then "l" and "o" are unambiguous, but when you're looking at the computer-generated password two years after you generated it, you won't be confident.  For passphrases, you can disambiguate based on the words ("shallow" is a word, and "shaII0w" isn't), so "l" and "o" are okay.

Terminology

Terminology for character sets:

  • lower: lower case letters
  • alpha: lower case and upper case letters
  • alphanum: digits and alpha characters
  • punctuation: sometimes called "special characters", basically any character on your keyboard that isn't a letter or a digit.  Example: `~!@#$%^&*()-_=+[]{};:'",.<>/?\|
  • PuncAlphaNum: punctuation and alphanum characters
  • #P+#D+#U+#L: this is short hand for a password that contains a set number of each character type.
    • For instance, "1P+2D+3U+XL" would mean a password with 1 punctuation, 2 digits, 3 upper case letters, and a variable number of lower case letters.
    • Example nonrandom 1P+1D+1U+12L password: "ab2cdEfgh^ijkmn".

When I mention a "16-alphanum password", I mean a 16 character password where each character is randomly selected from the set of alphanum characters.


Lower Case Letters Are Effort Efficient

Lower case letters give you the most password strength per unit-of-effort.  Imagine typing a password on a smart phone, like an iPhone.  Let's do a crude estimate of effort to type various character types in terms of "quick taps"/"qt":

  • Lower case letter, 1qt: usually you don't have to do any mode/capitalization switching and each lowercase letter takes 1qt.
  • Upper case letter, 2qt: usually you have to tap the shift key, then tap the letter, resulting in 2qt.
  • Digit, 2qt: many touch keyboard require a mode change to do digits, so you might have to tap the mode button, tap the digit, then maybe tap the mode button again.  Let's count this as 2qt on average.
  • Punctuation, 3-5qt: usually you have to tap the mode button, look for the character, then tap the character, then tap the mode button again.  Sometimes it's even worse with requiring multiple mode button taps to get to the right set of punctuation buttons.  Alternatively, some keyboards let you long-press a letter to get a particular punctuation character, but I still take some time to find the right button.  I think it's reasonable to estimate that I could type three lower case letters in the time it takes me to type "&".

For calculations of strength and typing effort of different passwords, see the "pwd_typing_effort" tab of this Google Sheet.

A PuncAlphaNum password will require the equivalent of 2.1qt per character on average.  So an average 12-PuncAlphaNum password will require 25.2qt and has 89^12 = 2.5e23 possibilities.

A 17-lower password will require 17qt and has 24^17 = 2.9e23 possibilities (remember, no "l" or "o").  So, going with lower case letters gives you more strength for roughly two-thirds the effort.

Lower case letter passwords are more efficient than alpha, alphanum, PuncAlphaNum, and 1P+1D+1U+XL passwords.  If we try to estimate effort on a desktop keyboard instead of a mobile device, I don't think the superiority of lower-case-letter passwords will go away.  Desktop keyboards are designed to optimize typing of lower case letters at the expense of extra key strokes or awkward key locations for upper case letters, digits, and punctuation.

The efficiency of lower case letters is why I recommend lower case letters make up as much of your password as possible.  The efficiency is also why lower-case-letter-only passphrases are not actually that bad to type despite their length.

If a service imposes a maximum password length, like 12, then I encourage you to use additional character types, perhaps using PuncAlphaNum.

 

Passwords Remembered And Typed <8 Times Per Day

This password use case is probably applies to your master password and possibly applies to disk encryption passwords or cryptocurrency wallets.  In this use case, you really want to maximize memorability and you usually don't have annoying requirements to use digits or special characters.

Passphrases of five or six words are a good fit for this use case.  Six words for your master password.  Five words is okay for passwords a lot less valuable than your master password.  For wifi passwords that you have to type with a TV remote, go with four words if you wish.

Example passphrase: "smatterfibersepticprioramebatakeover".  Note that the example contains only lower case letters and no separation between words in order to maximize ease of typing.  If the readability of your physical backups bothers you, your physical backup can have spaces and make a note that the passphrase does not contain the spaces.  Or you can just put in spaces if you really wish.

Don't try to add a flourish to a passphrase, like changing one "s" to a "$" or throwing in a digit between words.  Adding words to a passphrase is the most efficient way of adding memorable strength to a passphrase.

If your password manager does not support generating passphrases, then generate a bunch of digits (ideally digits 1-6 but 0-9 is okay) and use a diceware or EFF word list.

For example, the diceware list has a different word for every possible roll of five dice.  To work through an example:

  • Your password generator generates "483629804247".
  • You use the first five digits that are 1-6: "43624".
  • You Ctrl+F for "43624", and the word is "nook".  You add "nook" to your passphrase.
  • Repeat the above steps until you have enough words.
  • It is okay to reject certain words that are hard to type and not memorable.  For instance, the word for 11112 is "a&p".  I would reject that word and try again with new digits.  You might like the words in the EFF 5-dice word list better.
There are online password generators with passphrase options, like the 1Password password generator, but I'm not comfortable officially recommending the use of an online password generator.  I trust the 1Password people, and the page is served over https, but I hesitate to recommend exceptions to the excellent general policy of "don't use free online password generators; use your password manager instead".

Passwords Not Remembered And Rarely/Never Typed

Most of my passwords are passwords for websites like Amazon or Chase.  These are passwords that I don't have to remember and rarely/never have to type, because my password manager handles it >99% of the time.  Often, these passwords have to meet requirements like "must be 8-20 characters in length and include at least one digit, one uppercase letter, and one lowercase letter".

I have a few things I want out of my password generator:

  • I very much want passwords that are acceptably strong.
  • I moderately want passwords that are efficient for the rare occasions we have to type or manually communicate the password.
  • I moderately want passwords that need minimal or zero alteration to meet a service's password requirements.
Thus, I want a 1D+1U+XL password.

The single digit and upper case letter are simply to fit common password requirements so that you can usually use the generated password with zero or minimal manual modification.  Special characters are also a common requirement, but there is very little consistency on which special characters are allowed.  Special characters that are allowed on one service are often forbidden on another service.  My strategy is to auto-generate a password with no special characters, and if the service requires a special character, then I manually add an appropriate special character.

The use of unambiguous characters and mostly lower case letters are for the sake of minimizing effort when you have to type or say the password for a given strength.  Ambiguous characters are bad; it is unpleasant to try to decipher "I0l0IO10l0".

For deciding how many lower case letters to provide enough password strength, here's my thinking:

  • Let's have a goal that the password should cost at least $10M on average to crack it, even 10 years from now.
  • Assuming cracking costs halve every 2 years, that means my password should cost 32*$10M = $320M to crack now.
  • If we pessimistically assume that the password will be hashed with NTLM, an attacker can perform 7.8e15 guesses per dollar, so the password needs to have 7.8e15*3.2e8*2 = 5.0e24 possibilities.  The "*2" is because the attacker will crack the password after guessing half of the possibilities, on average.
  • A "1U+1D+15L" password (15 lower case letters, 1 upper case letter, 1 digit, total length of 17 characters) has 2.6e25 possibilities, so that meets the strength goal.

By this criteria, I would want my password generator to make 1U+1D+15L passwords for stuff like Amazon and Chase.

The KeePass password manager allows you to make 1U+1D+XL passwords, but my current password manager, 1Password, does not.  The closest 1Password can do is alphanum passwords (without ambiguous characters).  So, for the same desired strength of at least 5.0e24 possibilities, I can use 14-alphanum passwords (because ln(5.0e24)/ln(24+24+8) = ~14).


Passwords Remembered And Typed Many Times Per Day

My work password is a password I must remember and type many, many times a day.  The frequent typing helps me remember my password, so the easy memorability of passphrases has reduced benefit.  My employer also takes greater-than-average security precautions for preventing and detecting the theft of password hashes.  Unfortunately, my employer requires PuncAlphaNum passwords.

In contrast to the previous use case of passwords never/rarely typed, ease of typing is very important for this use case.  If your password is a pain to type, and you need to type the password to unlock your computer, you're going to hate locking your computer and perhaps do it less than you should.

With these factors combined, I think a 1P+1U+1D+10L password (total of 13 characters) is appropriate for my work password.  (Password length was decided because I assumed NTLM hashing and I wanted at least ~$100K to crack now, so at least ~7.8e20 password possibilities).

I think the following password structures are appropriate for the various character set requirements you face:

  • No requirement: 15L.
  • Requires upper and lower letters: 1U+14L (15 characters)
  • Requires digits, upper, lower: 1D+1U+12L (14 characters).
  • Requires punctuation, digits, upper, lower: 1P+1D+1U+10L (13 characters)

Also, I think it's okay to generate a few passwords (like six) and choose the password that is one of the easier ones to type since you'll be typing it so much.

No comments:

Post a Comment