.htpasswd Password Generator
Create hashed entries for Apache Basic Authentication. Supports MD5 (apr1), SHA-1, and Crypt algorithms with automatic formatting for .htpasswd files.
About
The .htpasswd file is used by Apache HTTP Server to store usernames and passwords for basic authentication of HTTP users. When you protect a directory using .htaccess, the server checks the credentials provided by the user against this file.
This tool generates the correctly hashed strings required for this file. It is crucial to note that .htpasswd does not store plain text passwords; it stores a hash. When a user logs in, the server hashes their input and compares it to the stored hash.
Formulas
The structure of an .htpasswd entry is always:
For example, if the user is 'admin' and the algorithm is MD5, the file content might look like:
Reference Data
| Algorithm | Prefix | Security Level | Compatibility |
|---|---|---|---|
| MD5 (APR1) | $apr1$ | Medium (Standard) | Apache, Nginx (Most common) |
| Bcrypt | $2y$ or $2a$ | High | Apache 2.4+ |
| SHA-1 | {SHA} | Low (Fast) | Legacy Systems |
| Crypt | (none) | Very Low | Very Old Systems (Unix) |