What this tool does
An .htpasswd file stores one username and one password hash per line. Apache reads it to protect a folder or site with basic authentication. This generator builds those lines for you, so you do not need command-line access to the htpasswd program.
Which hash should you choose?
- bcrypt is salted and deliberately slow, which makes guessing attacks expensive. It is the best choice on Apache 2.4.4 and later.
- APR1-MD5 is what the htpasswd command creates by default. It works on every Apache version and is acceptable for low-risk use.
- SHA-1 ({SHA}) has no salt and is fast to attack. Use it only for old systems that need it.
How to use the result
- Add one or more users with the form above.
- Copy the lines or download the file, and save it as .htpasswd outside your public web folder.
- Copy the Apache configuration into your .htaccess file and set the correct AuthUserFile path.
Security notes
Basic authentication sends the username and password with every request, only lightly encoded. Always serve protected pages over HTTPS. Choose long, unique passwords, because anyone who obtains the file can try to crack the hashes offline.
New to the format? Read what an .htpasswd file is, or follow the Apache basic authentication guide. For stronger hashes see the bcrypt generator.