Hacker News .hnnew | past | comments | ask | show | jobs | submitlogin
Correct Horse Battery Staple: Secure Password Generator (correcthorsebatterystaple.net)
31 points by DerekBickerton on May 23, 2023 | hide | past | favorite | 57 comments


Promoting diceware is admirable, but I don't like the idea of trusting a remote website generator.

A local diceware generator is probably available in your package manager, e.g:

  sudo apt install diceware

  diceware -n 6

  QuickenPrisonThermosDefilingBasicsVengeful


Diceware is supposed to be done with Dice in an entirely offline manner. I guess a local program is still useful, but in theory the program could be a shoddy RNG with non-random passwords. The program shouldn't be trusted unless you wrote it yourself, or otherwise performed a security audit yourself.

For all of its faults, 5x six-sided dice looking up this wordlist (https://theworld.com/~reinhold/diceware.wordlist.asc) is something that can be accomplished by hand, without computer assistance.

Assuming you have trustworthy dice (they don't have to be perfectly balanced, just something you can trust to be random), then you can diceware your own password by hand.


> The program shouldn't be trusted unless you wrote it yourself, or otherwise performed a security audit yourself.

I'm just a humble non-crytographic-programmer making practical suggestions with the most substantial security improvement for the least effort... Of course personally - I roll dice, dice that I whittled out of sticks, sticks from different trees that I collected from different parks, parks that I visited in a random order based on the results of a PRNG of my own secret design, a PRNG I built out of swarm crab based logic gates on a secret beach, seeded with a number collected from a geiger counter and small sample of u238, a geiger counter I constructed from photodiodes and aluminium foil, photodiodes I fabricated out of mud, rocks and fire. One day I hope to finish implementing my own general purpose computer and browser, then I will finally be able to use my passwords :)


Well, there's questions like why use 6^5 (46656) words if you're just not going to be rolling six-sided dice? There are other wordlists and dictionaries out there.

For example, randomly selecting words from the Basic English Wordlist (https://simple.wikipedia.org/wiki/Wikipedia:Basic_English_co...), a list of 2626 words, could be a better methodology.


I feel like having words like "eee" and "eeee" or "g's" and "gs" on the list sort of defeats the point of "correct horse battery staple" - that the words are easily memorable and non ambiguous.



https://pypi.org/project/xkcdpass/ this uses eff-long as the default (but also has other lists). It's available over pip and/or through most distro package managers.


I don't like the original diceware list. The EFF made a pretty good list though: https://www.eff.org/dice


Well, you only need one six-sided die really. It's really fun to do as well. I highly recommend the EFF wordlist though.


Or could just do something like this:

    cat /usr/share/dict/words | shuf | head -n 4


on debian, 'sudo apt install pwgen'

pwgen with the -s option will generate 'random' passwords, up to the randomness limit of whatever random source is provided by your kernel and system.

https://packages.debian.org/search?keywords=pwgen


But having a wordlist of ~2281 words means the search space is 2281^4 = 2.7e+13 which is less than an ascii password (roughly 100 usable ascii characters?) of length 7 i.e. 100^7 = 1e+14


Diceware recommended going to six words back in 2014:

* https://arstechnica.com/information-technology/2014/03/dicew...

They have 7,776 words in their list; that gives 77.5 bits.

* https://en.wikipedia.org/wiki/Diceware


  )=*vZqV

  Grateful-Afternoon-Resistance-South-0
The second is much easier to remember, and common security measures need to be practical.

Incidentally, I have two small shell functions to generate these. Tweaked slightly:

  < /dev/urandom tr -dc '!-~' | head -c${1:-7}; echo

  for i in `seq 5`; do
    echo -n `grep --perl-regexp '^[a-z]{4,7}$' /usr/share/dict/words | shuf -n 1`
    echo -n ' '
  done


You should not have to remember more than 2 or 3 passwords, enough to log in to your main computers and password managers. If you have few enough passwords that you use frequently enough, they can be completely random, and there is no need to get creative with “memorable” generation schemes.


It's a password generator hosted on a domain with zero reputation. Insufficient entopy is nowhere near as concerning as the software distribution mechanism.

Audit the code? Maybe it's different tomorrow. Maybe it's different based on client fingerprint! Internet explorer users in retirement communities get the version with a known, fixed random number seed.


The default settings append a number at the end, so that's 2.7e+14. Moreover, there's a separator character that may or may not be there, and may or may not be changed from the default. Furthermore, I don't know why the "jargon" list isn't included by default, which adds 8,800 relatively common words (e.g. born, advice, engine, perspective). So with the digit at the end and all other default settings, that's 11000^4*10 = 1.46e+17.


1Password uses a Word List [1] of 18k words: 1.09e+17 which is more than an 8 character password from 100 usable characters.


I had a idea similar to this, where you would misspell one or two words randomly - and then generate a sentence below the password to help with remembering the built-in obfuscation.

Such as the Generate Password would be listed as:

> Correct Horce Battery Staple

> "Correct Horse-with-a-C Battery Staple"


Why not just use "Correct Horse-with-a-C Battery Staple" as your password then?


My thought was that it would add some protection against a dictionary attack.

"Horse-with-a-C" is a longer password, but could possibly be hit using an algorithm that expects "with-a-[letter]" to be generated as part of a password.

The randomized misspelling of a word-or-two was intended to break a dictionary attack.


Adding grammar will make it more predictable and less secure for the same word count.


It doesn't reduce the entropy any, so I don't see how it could be less secure (assuming you don't count "with a C" as the additional words, which obviously you wouldn't).


What’s the point? Obfuscation doesn’t increase entropy.


The obfuscation is to break a dictionary attack.


At this point, average users are better off with a password manager and/or passkeys. The fraction of users willing to learn more than one decent password and not use it in multiple places is probably 1% or less.


Yes, but this is a great way to create a master password for your manager


"Correct horse battery staple?! That's amazing. I've got the same password on my luggage."


I generally agree. I've used an XKCD-style password for a long time for my 1Password master password. But it does have downsides -- on a mobile device, it's a lot of typing, if you need to enter it.


This could really use a entropy measure for the options you pick. Also what is the default dictionary?

If it is diceware, then the site's default 4 words hasn't been considered secure for a while. There is an Ars Technica article from 2014 that says 6 should be the minimum. I bet it is higher now.


And save every generated password for later use. Nice

Reminds me of the online bitcoin wallet public key QR code generator that just generated a code for some attacker’s wallet and got themselves some free coins.


Like many others, I've written my own correct-horse-battery-staple-based passphrase generator.

"gen-password" generates random passwords, allowing your to specify length and character set.

"gen-passphrase" generates correct-horse-battery-staple-style passphrases.

Both are written in Perl, using /dev/urandom by default for randomness.

https://github.com/Keith-S-Thompson/random-passwords


For those wondering, the source including word list is linked [1].

At a glance, the base dictionary is 2280 words; jargon is 8800; science is 575. So, definitely consider adding all the lists! That gives (check my math) ~13.5 bits entropy per word.

[1] https://bitbucket.org/jvdl/correcthorsebatterystaple/src/mas...


There are a number of such generators, but this one has good defaults (with the number at the end).

IMHO, it would be better if it would generate a list of passwords, so if the site is malicious, it wouldn't know which one you picked. It's weak, I know... But for this reason, I like this one: https://xkpasswd.net/s/


There's no way people actually use random websites to generate their passwords, right? Like, I can't just post or comment a password generator to a reasonably-tech-savvy forum like HN and have people actually use it to generate their next email password, can I? Surely there's at least some communal wisdom about how to correctly obtain software that you can reasonably trust with such an important task?


This is a fun project, and I respect implementing anything birthed from XKCD, but I agree and don't think I'd use this sort of thing to generate my passwords. ( Or I'll just stick to Password123 )


Unless the list is long enough for the selection process to have enough entropy to make an at least halfway decent password, that's pointless. And if it is, good luck downloading the list.


Why? Supposing 600,000 English words with an average length of ten letters that just around 6 megs uncompressed.


A password space of 600,000 options is under 20 bits of entropy. That's basically pointless. If you want 40 bits, you're going to need a little over 1,000,000,000,000.


Sure, but I thought it was obvious you wouldn't use one word. I'm saying a six megabyte file plus a one line shell script is enough to generate secure passwords with just four words by producing something like "Gargantuan Lackadaisical Lugubrious Flibbertigibbet" which while a bit of a mouthful isn't terribly difficult to memorize compared to 76 bits of line noise or even base64.


But that's not what was being discussed. Someone suggested that if one were to use a website that generates passwords, they should use one that generates multiple passwords to pick from to mitigate the risk of the site being malicious and knowing your password. And I'm saying that that is not useful for any practical length of password candidate list.


This is nice. I previously wrote up a KornShell script that did that with the 3000 most common English words, added the dashes, and two digit numbers to make up a suitable password for my password manager and places where I could not use a password manager.

I also used dashes as a word separator and to count as a special character. Nearly everyone allows for - , but it is hit or miss for other special characters.


Would be neat if it had stable diffusion powered image generation, to help people visualize and remember their passwords.


Memory's a real issue. In principle this is a nice demo; in practice I will be able to retain like five to seven of these high-entropy blobs before they all run together.

The fundamental problem with passwords is still the need for them.


You only really need three passwords, four at most; for your own computer, your own email, your password manager, probably your work computer.

Have a passphrase for each and let the password manager generate noise for everything else.


It's been noted elsewhere in the comments, but I think it's worth pointing out that 1Password incorporates a similar algorithm for random password generation. It allows you to configure a series of uppercase words, lowercase words, special characters, and numbers. i.e. CAR-horse7ambulance



Bitwarden also supports this out-of-the-box

https://bitwarden.com/help/generator/#password-types see "Passphrase"


See also (mostly for fun / ideas); http://www.manly-man.net/


i’ve used https://diceware.rempe.us/#eff fairy happily over the years


It's a cute idea and I love the concept from XKCD, but the best practice is just to use a password manager and stop trying to remember passwords (and absolutely never reusing passwords).


But:

- you need a password for your password manager

- you also need a password for your actual desktop/phone, when the manager is inaccessible.

- you may have a work computer requiring a different password as well

Here are already 3, ideally different, passwords you need to remember.


I only have to remember one password: to my password manager. My phone uses a different unlock method entirely, and my work computer's password is stored in my password manager.

Although after a couple of days of using a new password regularly, I can't help but have it memorized anyhow.


Most humans create terrible passwords (myself included) and I really benefit from simply having a random word generator. I use generators like these to create a random word cloud to pick and chose from to create my actual password. I also might have to read particular passwords over the phone to someone in a rare emergency so real words help with that a lot. This particular one doesn't throw enough random symbols in between words IMO, I also like to throw in misspellings and random caps which none of them seem to do.


Yes, I use a random password generator for all of my passwords. But I don't use the XKCD method because I actually find that style of password more difficult to remember and more of a pain to type in.


This goes against the whole idea of that XKCD comic. If you want to come up with a password you can remember, you should string together a bunch of words that make sense to you. But if you want a password you can remember, randomly generating it (especially in a way that has low overall entropy per the current top comment) seems like a bad way to do it.

IMO the days of remembering multiple passwords are gone - either use a password manager, or thankfully the industry is moving to passkeys.


The XKCD comic was absolutely about randomly generating a four word password, not picking four words that mean something to you. That's how the math works is if each word is random.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: