[Toybox] [CLEANUP] mkpasswd.c

Isaac Dunham ibid.ag at gmail.com
Wed Jun 25 22:20:29 PDT 2014


On Wed, Jun 25, 2014 at 11:02:03PM -0500, Rob Landley wrote:
> We don't need "-m help" when we can put the list of supported types in
> the help text itself. (Unless this is used programmatically to
> autodetect support? The ubuntu version outputs a lot of extra verbiage
> that would make parsing hard, and the busybox-1.19.0 I have lying around
> doesn't support -m help at all?) I've yanked it for now, I can put -m
> help back if anybody's actually using it...

I'd just been looking into bcrypt support, where it theoretically
could be handy. bcrypt is supported on musl, some patched versions
of glibc, and a lot of non-linux systems.
To support it, we can either advertise bcrypt support everywhere and
fail sometimes or else probe for it.

Relevant information:
bcrypt is obtained via a salt starting with:
$2y$NN$
where NN is a 2-digit number not less than 04 nor more than 31 (at present),
limiting the number of rounds.
musl limits it a bit lower (I think ~20?); even 16 rounds takes a looonnnnggg
time on an Atom N270 at 1.6 GHz, while 4-8 rounds is practically instant.

I'd suggest setting rounds to 8 at minimum, 12 at maximum.

Following this you need 22 characters of the usual sort for a salt;
traditionally it's terminated with a '$', but musl at least does not
require this.

Thanks,
Isaac Dunham

 1403760029.0


More information about the Toybox mailing list