Live data from Hacker News

Show HN: Correct Horse Battery Staple password generator

correcthorse.pw

41–50 of 99 posts

Re: Show HN: Correct Horse Battery Staple password generator

#41

Nice work! A passphrase, as opposed to a password, has spaces between each word. If you added those it would be easier to read, especially for mobile, if you used a multiline textarea, because the generated content isn’t fully readable at a glance. (Or don’t use a form input field at all — just put the passphrase in a div so the word breaks flow normally.)

Yup. With the ability to add a separator (like a space, -, .) I'd switch over to this.

Currently I use and recommend https://preshing.com/20110811/xkcd-password-generator/

Re: Show HN: Correct Horse Battery Staple password generator

#42
post #27

Earlier quoted context omitted.

This may not be cryptographically secure. Shuf can default to using a small amount of entropy.[1,2,3] To be certain, you can add the --random-source option: shuf --random-source=/dev/urandom -n 4 /usr/share/dict/words [1] https://www.gnu.org/software/coreutils/manual/html_node/Rand... [2] https://github.com/coreutils/coreutils/blob/v8.5/gl/lib/rand... [3] https://github.com/coreutils/coreutils/blob/v8.32/gl/lib/ran..…

I'm curious how practical an RNG attack actually is here (which absolutely isn't meant to serve as criticism of your surfacing the issue!). In any case, I expect it's much harder than a random "free password gen!" website saving results on the sly (... which is meant to be mild criticism of your framing, but not your recommendation :-p).

shuf uses randint(), which defaults to /dev/urandom as the nonce source:

https://github.com/coreutils/coreutils/blob/v8.31/gl/lib/ran...

It's going to be as practical to attack as anything that uses /dev/urandom.

Re: Show HN: Correct Horse Battery Staple password generator

#43
post #42

Earlier quoted context omitted.

I'm curious how practical an RNG attack actually is here (which absolutely isn't meant to serve as criticism of your surfacing the issue!). In any case, I expect it's much harder than a random "free password gen!" website saving results on the sly (... which is meant to be mild criticism of your framing, but not your recommendation :-p).

shuf uses randint(), which defaults to /dev/urandom as the nonce source: https://github.com/coreutils/coreutils/blob/v8.31/gl/lib/ran... It's going to be as practical to attack as anything that uses /dev/urandom.

For sufficiently recent versions of shuf. It looks (... at a skim of the history, I could be confused) like older versions use pid, ppid, uid, gid, and time. In that case that's likely to be more practical than brute force if you've generated a password with notionally more than ~40 bits of entropy.

That said, I suspect most people are indeed on a platform with a sufficiently recent version of shuf.

(And a sufficiently old version may lack the random-source option.)

Re: Show HN: Correct Horse Battery Staple password generator

#44
post #42

Earlier quoted context omitted.

I'm curious how practical an RNG attack actually is here (which absolutely isn't meant to serve as criticism of your surfacing the issue!). In any case, I expect it's much harder than a random "free password gen!" website saving results on the sly (... which is meant to be mild criticism of your framing, but not your recommendation :-p).

shuf uses randint(), which defaults to /dev/urandom as the nonce source: https://github.com/coreutils/coreutils/blob/v8.31/gl/lib/ran... It's going to be as practical to attack as anything that uses /dev/urandom.

[deleted]

Re: Show HN: Correct Horse Battery Staple password generator

#45
post #37
post #27

Earlier quoted context omitted.

This may not be cryptographically secure. Shuf can default to using a small amount of entropy.[1,2,3] To be certain, you can add the --random-source option: shuf --random-source=/dev/urandom -n 4 /usr/share/dict/words [1] https://www.gnu.org/software/coreutils/manual/html_node/Rand... [2] https://github.com/coreutils/coreutils/blob/v8.5/gl/lib/rand... [3] https://github.com/coreutils/coreutils/blob/v8.32/gl/lib/ran..…

shuf uses randint(), which defaults to /dev/urandom as the nonce source: https://github.com/coreutils/coreutils/blob/v8.31/gl/lib/ran... Your "--random-source=/dev/urandom" line is superfluous. My original line is as secure as yours.

Interesting. They stopped using /dev/urandom as the default random file in version 7.3, which created the insecure default situation. Later, in version 8.6, they updated to use a default nonce from /dev/urandom. It's odd that the documentation has not be updated. Perhaps it's because the latest version will still default to an insecure nonce if there is no /dev/urandom?

Re: Show HN: Correct Horse Battery Staple password generator

#47

I tend to rely on https://www.rempe.us/diceware/#eff for my typeable password needs. 80% of my passwords are just line noise, because they live in a keepass database. 20% (workstation account logins, etc) are diceware.

you type "glove blinks abruptly avatar salvaging marbled" every time you need to unlock your screen?

Mine's a more meaningful sentence, but about the same length, yes.

It doesn't take long to type a wholly-memorized sentence.

Re: Show HN: Correct Horse Battery Staple password generator

#48

Nice work! A passphrase, as opposed to a password, has spaces between each word. If you added those it would be easier to read, especially for mobile, if you used a multiline textarea, because the generated content isn’t fully readable at a glance. (Or don’t use a form input field at all — just put the passphrase in a div so the word breaks flow normally.)

Yup. With the ability to add a separator (like a space, -, .) I'd switch over to this. Currently I use and recommend https://preshing.com/20110811/xkcd-password-generator/

Good idea, just added separators to the website.

Re: Show HN: Correct Horse Battery Staple password generator

#49

Nice work! A passphrase, as opposed to a password, has spaces between each word. If you added those it would be easier to read, especially for mobile, if you used a multiline textarea, because the generated content isn’t fully readable at a glance. (Or don’t use a form input field at all — just put the passphrase in a div so the word breaks flow normally.)

I just updated the site to display the password on multiple lines for mobile.

Re: Show HN: Correct Horse Battery Staple password generator

#50
post #45
post #37

Earlier quoted context omitted.

shuf uses randint(), which defaults to /dev/urandom as the nonce source: https://github.com/coreutils/coreutils/blob/v8.31/gl/lib/ran... Your "--random-source=/dev/urandom" line is superfluous. My original line is as secure as yours.

Interesting. They stopped using /dev/urandom as the default random file in version 7.3, which created the insecure default situation. Later, in version 8.6, they updated to use a default nonce from /dev/urandom. It's odd that the documentation has not be updated. Perhaps it's because the latest version will still default to an insecure nonce if there is no /dev/urandom?

If you're on a Linux OS that's from ~2013 or later, then you're most likely on a version of coreutils that will default to /dev/urandom.

The master branch of coreutils is using getrandom(2). It will continue to draw entropy from the urandom source by default.

Post reply on HN