https://www.youtube.com/watch?v=3NjQ9b3pgIg
How many words could I safely use for a passphrase if I, say, include an obscure fictional name and slightly misspell one of the words?
https://www.youtube.com/watch?v=3NjQ9b3pgIg
How many words could I safely use for a passphrase if I, say, include an obscure fictional name and slightly misspell one of the words?
It depends on your threat model.
It depends on several things. Are you trying to secure a physical device like your computer or phone? Then you’ll need a memorable password that you can type out.
What threats are you trying to defend against? If you’re worried about being targeted by an adversary like the government with physical access to your device and basically infinite resources, then you should never try to come up with your password from your head, humans are terrible at randomness. You should instead create a Diceware passphrase that’s at least around 8 words long.
If you’re just worried about basic thieves/nosy people, then I would still go with a Diceware passphrase but you can make it shorter so you are able to remember it better.
For online accounts, you should always use a password manager to generate and use those passwords. You don’t have to worry about making them memorable since you won’t need to remember them. Also use passkeys whenever you’re able to.
Slightly misspelling a word or using weird characters doesn’t improve the security as much as you think and makes it difficult to remember (I know people that have lost passwords multiple times because they couldn’t remember the special characters they used), so just stick with Diceware.
This is for passwords I expect to type a lot and don’t want to be too tedious or error-prone, like for my laptop or bank, but still want to be hard to crack, like for passive attacks or a password hash breach. My plan is to make a dicephrase, like you suggested, then add something hard or impossible to dictionary attack, like an obscure fictional name or a gibberish word inserted randomly. If that’s effective, I could hypothetically reduce the number of words I need and make it easier to remember and type.
I think that will just cause you more frustration in the long run than you’ll be gaining in security. The security chip in your phone and computer have rate limiting built in so you can take advantage of that and use a smaller password as long as you don’t mind relying on the hardware protection to not be bypassed. Recent Google Pixels and iPhones have been shown to hold up to brute force attacks.
For bank passwords you shouldn’t ever be typing them anyway since you should be using a password manager for that. Your password manager will generate a highly secure password so you don’t have to worry about password breaches. You should only be worrying about memorable passwords for things like your computer where you can’t use a password manager.
Do you reply under every post like this?
No.
Example to generate memorable master pasword:
Color + Animal + Verb + Object + Number + Symbol
For example:
PinkWhalePlaysWith#08Bals
(this one have 64bit entropy only
)
But this one have 189 bit of entropy
APurpleCatOnAHotRoofJumps@1FootAnd#23InchesBecauseItsPawsGotBurned
“PinkWhale” password check (didn’t found better tester)
“APurpleCat” report
Remember that you can use the space character (’ ') in passwords. So your password could be a grammatically correct sentence. Still, I recommend to use a “diceware” passphrase without digits or special characters as @fria explained.
But diceware is harder to remember, for example diceware around 190 bit entropy:
Winner Self Surfacing Gangrene Decathlon Croon Aide Tractor Finicky Boggle
Report:
That will depend on your desired password bit strength and word list length as so:
import random
import math
word_list = ['insert', 'words', 'here']
BIT_STRENGTH = 128
word_space = len(word_list)
combinations = 2 ** BIT_STRENGTH
words_in_pwd = math.ceil(math.log(combinations, word_space))
rng = random.SystemRandom()
password = ' '.join(rng.choice(word_list) for _ in range(words_in_pwd))
print(words_in_pwd)
print(password)
For EFF’s word list that has 7776 words, you need 10 words to exceed 128 bit entropy which is suitable for practically anything.
You might be able to get away with 10-20 bits less security if you use heavy Argon2id key derivation parameters, but outside KeepassXC master password, you don’t really get to fine-tune the Argon2 parameters.
But, you’ll only need to memorize 3-4 passwords:
The last one is there because you can probably restore access to your email and reset majority of online account passwords even if you’d lose access to all of your password databases. But you do not want to lose access to your files even in that event, so I’d recommend the fourth one.
Everything else should be managed by the password manager passwords. The passwords should be unique, and 128-256 bits strong. You don’t really have to care about length and charspace because the manager will remember them for you. Just use whatever chars are allowed by the service and adjust length until you hit the 128-256 area. It’s only if the service complains about password being too long, that you should really fine tune the types of characters used, like enable upper case, or even customize the punctuation marks used.
Also, make sure to adhere to best practices for password manager database backups:
There’s a website, I believe the developer is on the forums, that will generate something closer to grammatically correct sentences for you that are secure and much easier to remember:
They’re actually a lot like newspaper headlines which helps me imagine the scenario in my head to remember it.
I’ve started using it personally and considering recommending it to people in the future instead of Diceware passwords.
Iirc it isn’t actually want to use common pseudo-random number generators for password generation.
Yes and no.
So password is just a value that’s hard to guess. As are encryption keys. Both translate to ones and zeroes to computer so it doesn’t really matter which one is in question.
Passphrase that consists of multiple words is best when there’s equal probability that it’s any word from the word list. Diceware lists work too provided it’s a proper dice throw with lots of bounces.
The code I provided above shows how to reason about how many words you want in your passphrase to get to some specific entropy level.
But what I think your post really discussed was “common pseudo-random nubmer generators”. With that you’re absolutely right! You need to use a cryptographically secure pseudo-random number generator, or, CSPRNG. Which is what I used above:
rng = random.SystemRandom() builds on top of os.urandom() syscall that calls the OS kernel CSPRNG. The choice method of the SystemRandom() object performs uniform sampling over bias-free integer math, and the list comp does repeated independent calls. So it’s the current best practice and a recipe in Python.
You’re right that e.g.
import random
random.choice
is horribly insecure. But that’s not what was going on in the code above.
pwgen 30 1
Should be good enough for virtually anything.
It is recommended to use six words for your diceware passphrase.
That’s not how entropy works. This does not actually have 64 bits of entropy because you used a non random method of generation. Any patterns in how you generate the password reduces entropy. Entropy would need to be calculated as the number of possible passwords that could be generated. This method does not produce 2^64 possible passwords. Whatever calculator you used to arrive at 64 bits assumed you used a secure RNG to generate the password.
This is a horrible way to generate passwords. No one should listen to it. Just use diceware.
Yes, a less secure password will be easier to remember. Of course.
No one needs 190 bits of entropy in their password. 5-8 words of diceware, depending on hashing algorithm used, is perfectly fine for almost all use cases. At most, if your hashing algorithm is something like bare SHA256 single-round, you need ~128 bits to make it unbreakable in any amount of time where the information it protects would still be useful to anyone. This can be achieved with just 10 words.
I still remember my first attempt at using the xkcd password method. It was:
Parsnip Stone Bridge SpongeBob Tinkle
I was also learning about Mnemonic Imagery, so I envisioned a personified cartoon parsnip running directly at me with a very angry scowl, horrible, crooked and filthy teeth, and a substantial unibrow. It pulled out a stone and threw it at me. The camera in my mind panned around and I saw the stone continue on toward a big bridge like you see in movies where folks are standing there contemplating bad things. On the edge of the bridge, SpongeBob is standing with his back to me urinating into the river below.
The second one was:
Homestead today light nightmare food
although I don’t remember the capitalization on that one anymore. I won’t bore you with the imagery for that one, but it involved Freddy Krueger.
None of these are in use. They have been retired and I will never use them again, so I don’t mind sharing them here. Now I use a password manager.
But, honestly, there are some sites I genuinely don’t care if someone logs in as me and does whatever. My password on chess.com is Jovial17. Have at it. You won’t play any worse than I already do ![]()