Create password lines for Apache .htpasswd files. Choose between bcrypt (recommended), APR1 (MD5), or SHA1. All hashing is done locally in your browser – your password never leaves your device.
htpasswd is a file format used by the Apache HTTP Server to store usernames and passwords for HTTP Basic Authentication. Each line contains a username and a password hash separated by a colon. The hash format is identified by a prefix: $2y$ for bcrypt, $apr1$ for Apache's MD5 variant, and {SHA} for SHA‑1. Apache uses this file to authenticate users requesting protected resources.
Line Format
username:hashed_password
Example: admin:$2y$10$N9qo8uLOickgx2ZMRZoMy.Mr/.PpE1xLZw5oV1Vm4pKtYdQ1N1S/q
| Algorithm | Prefix | Security Level | Apache Support |
|---|---|---|---|
| bcrypt |
$2y$ (or $2a$/$2b$)
|
High – adaptive, recommended | Apache 2.4+ (mod_authn_dbm, mod_authn_file with apr-util 1.5+) |
| APR1 (MD5) |
$apr1$
|
Medium – salted MD5 (Apache specific) | All versions since Apache 1.3 |
| SHA1 |
{SHA}
|
Low – unsalted, fast to brute‑force | Apache 2.0+ (mod_auth_basic with mod_authn_file) |
All hash generation is performed client‑side using well‑audited libraries:
bcrypt.js (based on OpenBSD's implementation) with configurable cost.
htpasswd -m). It generates a random 8‑character salt using crypto.getRandomValues for security.
{SHA} prefix.
The APR1 algorithm (also called "Apache MD5") is a custom construction based on MD5. It iterates 1000 times and produces a hash of the form $apr1$<salt>$<hash>. Our implementation follows the same logic used by the official Apache htpasswd utility.
.htpasswd in the directory you want to protect (outside web root for security).
.htaccess file, add:
AuthType Basic
AuthName "Restricted Area"
AuthUserFile /path/to/.htpasswd
Require valid-user
A development team hosts a staging server with several internal tools. They use .htpasswd to restrict access to these tools. By switching from SHA1 to bcrypt (cost 12), they increased password cracking resistance without noticeable performance impact because the site has only a handful of users. The team uses this generator to onboard new developers quickly, ensuring each password is hashed with a unique salt.
A company maintaining a legacy Apache server with hundreds of APR1 hashed passwords plans to migrate to bcrypt. They use this tool to test bcrypt generation and validate that Apache 2.4 with apr-util 1.5+ correctly recognizes bcrypt hashes. The migration improves security for user credentials.
httpd -V and verifying the APR version.
AuthUserFile directive points to the same location.
htpasswd command does the same.