by oelmekki · 9y ago · 0 comments
Currently, my way to generate a new password is this : `pwgen | md5sum`. And then, I use "lost password" everywhere (but for my mailbox, obviously), that is, the rare times my browser is not already prefilling the login form.
This makes me wonder why we don't just go with that : generate a random password for the user in registration form, allow the browser to save it. On the login form, check if fields are prefilled. If not, only display an email field and send an auth link as mail. User clicking it (once, and fast enough) is logged in.
You still have to remember your mailbox password, but that's the only one, quite akin the root password of a server.
Pick a really good password for your password manager and remember that. Doesn't matter too much which password manager. If you're paranoid use KeePass, otherwise I personally use LastPass.
In terms of generating a strong password: most browsers have password generators (which I didn't even know about until recently). They aren't all enabled by default and they don't work on all forms, and not all browsers have them. Browsers also have supported user certificates [which are more secure than passwords, sort of] for like 15 years, but nobody ever uses them. The main reason (afaik) is how shit the browser's UX for them was, in combination with a burden of complexity - and of course you can't use them on random public devices.
I think we are close to reaching an authentication nirvana. If U2F came embedded in all new computing devices, and an open method of securely synchronizing all devices and service providers was used, we could effectively skip passwords, and rely almost entirely on backup codes for the few times they were needed. A lot of laptops and phones come with fingerprint scanners now. If those scanners were used as part of a U2F solution we would have a pretty solid authentication mechanism. (fingerprints are not foolproof, but IMHO they are about as secure as a password)
dd if=/dev/urandom bs=2048 count=1 | od -A none -l |
sha512sum
Or just generate a long password: pwgen 2048 1(note for people who may not know pwgen : it outputs 20 lines of 8 random passwords)
Unfortunately, it only does this if STDOUT is a TTY. If it's a pipe, then it outputs a single 8 character long password. So I'm afraid you've been generating rather low entropy passwords by piping the output of pwgen through md5sum.
You can confirm this by piping pwgen through cat: pwgen | cat
Most annoying trying to use "watch" or "less" and have the color work. "watch --color juju status --color", ahh. :-)
Anyway, as far as password creation goes, here's another alternative based on more standard tools:
head -c NN /dev/urandom | base32 # or base64, or md5sum if you so prefer