You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Martin Kraemer <ma...@apache.org> on 2007/09/03 14:13:20 UTC
[PATCH] htpasswd.c: New -S option?
The Topics addressed in this patch are:
* As a debugging aid, the salt can be preseeded by specifying the
base64-string to use:
$ htpasswd -S ........ -nb Apache Apache
Apache:..TowpWtYvRfQ
which allows regression testing of the various salted password
algorithms crypt() and md5. It is debatable whether the switch
should be called -S<salt> (there is a lower-case -s switch
already).
* The salt for md5, when generated automatically, now uses 8 bytes of
pseudo-random data instead of 4. Not that they contain more entropy,
but at least they make brute-force attacks *much* more difficult.
Before, the upper 32 bits were zero in the 48 bit number used for
initialization of the salt (8 bytes output, each one shifting the
random number right by 6 bits). In a present version of htpasswd,
you can see the missing initialization as a run of 3 or 4 '.'
characters in the salt string (before the 3rd '$ char):
$ htpasswd -nbm Apache Apache
Apache:$apr1$mV/um...$Nz1nYy20Cd3TywjHU74I6.
* The usage() function now takes an optional errstr, explaining why
htpasswd decided to exit. This may improve the user interface in
situations where certain switch combinations caused an exit via
usage().
WDYT?
Martin
--
<Ma...@Fujitsu-Siemens.com> | Fujitsu Siemens
http://www.fujitsu-siemens.com/imprint.html | 81730 Munich, Germany
Re: [PATCH] htpasswd.c: New -S option?
Posted by Martin Kraemer <ma...@apache.org>.
On Mon, Sep 03, 2007 at 02:13:20PM +0200, Martin Kraemer wrote:
> The Topics addressed in this patch are:
...
> --- httpd-2.2.x/support/htpasswd.c Wed Jul 12 05:38:44 2006
> +++ /tmp/htpasswd.c Mon Sep 3 13:22:05 2007
> @@ -101,6 +101,7 @@
The patch is against 2.2.x BTW.
Martin
--
<Ma...@Fujitsu-Siemens.com> | Fujitsu Siemens
http://www.fujitsu-siemens.com/imprint.html | 81730 Munich, Germany