Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rewrite password generation for more secure and convivial options #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anarcat
Copy link

@anarcat anarcat commented Mar 10, 2024

When I boot a GRML system with ssh (without arguments) right now, it generates a 8 character, hex password. Now, I'm not a cryptographer, but I believe that gives about 32 bits of entropy (log2(16)*8), roughly the equivalent of a 8 character, all lowercase, [a-z] password, which is now widely recognized to be extremely poor.

That password is generated by dumping random bytes and piping them into hexdump, taking the first four bytes (hey, look, 32 bits again).

There are other routines in there: if pwgen, gpw, or apg are available, they are used. But pwgen was dropped from in 2009 (#511613), and gpw is not present at all.

apg is in GRML_FULL, but I would argue it fares as poorly as hexdump: with the given configuration, it also generates a 8 to 12 character, lowercase and digits "pronouncable" password. It's hard to estimate the damage the "pronouncable" algorithm does to the entropy, but even just relying on the 36 character possibilities (26 + 10), we end up with a meager 41 bits of entropy on those passwords.

In comparison, the passwords generated by diceware and xkcdpass each use 6 words from a ~8000 words dictionnary, which adds up to a whopping 77 bits of entropy, while still generating a rememberable password, much more than apg or pwgen.

If those are not available, we fall back to a much simpler routine: extract alphanumeric characters from /dev/urandom (non-depleting), and dump 28 characters, which gives us 167 bits of entropy.

I'm not directly proposing to install diceware or xkcdpass here yet, but I believe that would also be a nice addition (and I would deprecate apg).

That's a different discussion, however: let's get rid of 8-character passwords for now, first.

When I boot a GRML system with `ssh` (without arguments) right now, it
generates a 8 character, hex password. Now, I'm not a cryptographer,
but I believe that gives about 32 bits of entropy (log2(16)*8),
roughly the equivalent of a 8 character, all lowercase, [a-z]
password, which is now widely recognized to be extremely poor.

That password is generated by dumping random bytes and piping them
into hexdump, taking the first four bytes (hey, look, 32 bits again).

There are other routines in there: if pwgen, gpw, or apg are
available, they are used. But pwgen was dropped from in
2009 (#511613), and gpw is not present at all.

apg *is* in GRML_FULL, but I would argue it fares as poorly as
hexdump: with the given configuration, it also generates a
8 to 12 character, lowercase and digits "pronouncable" password. It's
hard to estimate the damage the "pronouncable" algorithm does to the
entropy, but even just relying on the 36 character possibilities (26 +
10), we end up with a meager 41 bits of entropy on those passwords.

In comparison, the passwords generated by diceware and xkcdpass each
use 6 words from a ~8000 words dictionnary, which adds up to a
whopping 77 bits of entropy, while still generating a rememberable
password, much more than apg or pwgen.

If those are not available, we fall back to a much simpler routine:
extract alphanumeric characters from /dev/urandom (non-depleting), and
dump 28 characters, which gives us 167 bits of entropy.

I'm not directly proposing to install diceware or xkcdpass here yet,
but I believe that would also be a nice addition (and I would
deprecate apg).

That's a different discussion, however: let's get rid of 8-character
passwords for now, first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant