It's my understanding that the purpose of .htpasswd
files is to restrict access to some files in the server filesystem. If an attacker gains access to it, he probably has access to everything else too, so it seems like there's little point in using a slow hash in this situation (would only increse the server load). However, I've just seen that Apache 2.4 introduced support for bcrypt
in these files:
*) htpasswd, htdbm: Add support for bcrypt algorithm (requires apr-util 1.5 or higher). PR 49288. [Stefan Fritsch]
The feature request does not offer any explanation about why using a simpler hash make "passwords stored in those hash functions vulnerable to cracking". Is this just "paranoia" or is there a good reason for using a stronger hash in this scenario?
.htpasswd
file - the attacker can just grab them already! But if the same passwords also protects something else (the likelyhood of which I can't guess), then I can see the benefit of properly protecting them. – mgibsonbr Apr 28 '14 at 08:52.htaccess
file don't contain salt values, which would provide protection against rainbow attacks. – Steven Volckaert Apr 28 '14 at 12:23.htaccess
files do contain salt values. For instance, in this value:blah:$apr1$FVk/v.Hx$s6bxoKMoIVK8RO26rR.2w1
the salt is the part between the second and third '$' signs (FVk/v.Hx
). Salts defeat precomputed tables (be they rainbow or not). – Thomas Pornin Apr 28 '14 at 12:55