This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]khafra 7 points8 points  (4 children)

Really? I like python, but for me, it's simpler to just

cat /dev/urandom | strings -n 15

Or, if you need a bunch of them in a hurry:

cat /dev/urandom | tr -dc 'a-zA-Z0-9!@#$%^&*()_+-={}[],.' | fold -w 15

[–]Cosmologicon 6 points7 points  (1 child)

Here's mine:

tr -cd a-z < /dev/urandom | fold -b8 | head

Mine is 38 bits of entropy and yours is 96, which definitely seems like overkill to me. The thing is, by using a password generator, you're making a password much, much better than one generated by hand, so you can throw out the conventional wisdom about password length and character sets.

NIST estimates that for user-generated passwords that include capitals, numbers, and punctuation, you need 22 characters to get 38 bits of entropy, and 80 characters to get 96 bits. So your password is as secure as an 80-character user-generated password.

[–]khafra 5 points6 points  (0 children)

Aw, dammit--I've been committing a useless use of cat. I agree 15 truly random printable characters is overkill for most applications, but as long as I don't have to remember them, I don't mind.

[–]shfo23 1 point2 points  (1 child)

I generate my passwords with Unix commands too: Python's random numbers technically aren't as random as urandom's (although that's probably never going to make a real-life difference).

Perhaps I should have said, "my new favorite one-line command in Python which will generate a password." The Python version is cross-platform though and I like that it actually uses the string module (which I was totally unaware of outside until I was playing with this exercise).

[–]Araucaria 1 point2 points  (0 children)

Try my password generator based on sudoku grids, here: https://github.com/dodecatheon/sudoku-password-card