Create .htpasswd entries to password-protect a site or folder with HTTP basic auth. Enter one or more usernames and passwords, pick the hash format, and copy or download the file — with ready-made Apache and Nginx configuration. Your passwords are hashed in your browser and never sent anywhere.
| Prefix | Algorithm | Supported by |
|---|---|---|
| $apr1$ | Salted MD5, 1,000 rounds | Apache, Nginx |
| {SHA} | Unsalted SHA-1 | Apache, Nginx |
| $2y$ | bcrypt | Apache 2.4+, Nginx with system crypt |
APR1-MD5 works in both Apache and Nginx. For stronger hashing, use bcrypt with `htpasswd -B` on the server.
The hash is computed in your browser; nothing is sent. You can disconnect from the internet to be sure.
A random salt is used every time, which is expected.
Outside your web root, referenced by AuthUserFile (Apache) or auth_basic_user_file (Nginx).
No — the colon separates the username from the hash.
APR1-MD5 is Apache's variant of the md5crypt algorithm: a random 8-character salt, an initial digest mixing password, salt and password, then 1,000 rounds of MD5 that alternate password, salt and the previous digest, and finally a custom base-64 encoding with the alphabet ./0-9A-Za-z, prefixed with $apr1$. The output is identical to `htpasswd -m` and `openssl passwd -apr1` and is verified against OpenSSL in the tool's test suite. The SHA-1 option is base-64 of an unsalted SHA-1 digest prefixed with {SHA}, which Apache and Nginx accept but which is weak against cracking. Usernames containing a colon are rejected because the colon separates user and hash. Salts come from the browser's cryptographic random generator.