Re:Master password in Firefox or Thunderbird? Do not bother
by kerkeslager on Saturday March 10, 2018 @10:35PM
(#16561573)
I prefer to use Diceware[1] as I find these passwords easier to memorize. But for a master password it doesn't matter as much since you only have to memorize it once.
If you're generating passwords from urandom, you can do this slightly nicer with:
head /dev/urandom | LC_ALL=C tr -dc "[:graph:]" | head -c 21
A few things about this:
1. In case it's not obvious, 21 is the number of characters this will generate. Change that to generate more or fewer characters.
2. LC_ALL=C isn't necessary on some systems, but it's necessary on Mac OS and some others where `tr` expects UTF-8 encoded input on Mac OS unless that is overridden by the environment variable.
3. If you are generating a password for one of those dumb systems that restricts which characters you can use, you can change `"[:graph:]"` to something like `'A-Za-z0-9~!@#$%^&*_='` depending on which characters are allowed.
If you're generating passwords from urandom, you can do this slightly nicer with:
A few things about this:1. In case it's not obvious, 21 is the number of characters this will generate. Change that to generate more or fewer characters.
2. LC_ALL=C isn't necessary on some systems, but it's necessary on Mac OS and some others where `tr` expects UTF-8 encoded input on Mac OS unless that is overridden by the environment variable.
3. If you are generating a password for one of those dumb systems that restricts which characters you can use, you can change `"[:graph:]"` to something like `'A-Za-z0-9~!@#$%^&*_='` depending on which characters are allowed.
[1] http://world.std.com/%7Ereinhold/diceware.html