Apache .htpasswd Generator

Generate secure password entries for Apache .htpasswd files with multiple encryption methods

🔐

Multiple Encryption Methods

Support for bcrypt, MD5, SHA1, and crypt encryption algorithms

Instant Generation

Get your .htpasswd entry immediately with client-side processing

📋

Complete Entry

Generate full username:password entries ready for .htpasswd files

🔒 Client-Side Processing
All password hashing is done in your browser using JavaScript. Your passwords never leave your device, ensuring maximum privacy and security.

Your .htpasswd entry will appear here...
💡 For developers: Create .htpasswd files with:
htpasswd -c /path/to/.htpasswd username
# Create new .htpasswd file and add user
htpasswd /path/to/.htpasswd username
# Add user to existing .htpasswd file
htpasswd -b /path/to/.htpasswd username password
# Add user with password from command line

About Apache .htpasswd

.htpasswd is a flat-file used by Apache web server to store usernames and passwords for HTTP authentication. It provides basic access authentication to protect directories and files on your web server.

Encryption Methods Comparison

Method Security Performance Recommendation
bcrypt Excellent Slow (intentionally) Highly recommended for new implementations
MD5 (Apache) Good Fast Acceptable for existing systems
SHA1 Moderate Fast Use only for compatibility
crypt Weak Very Fast Not recommended

How to Use .htpasswd Files

1. Create .htpasswd File

Create a file named .htpasswd in a secure location (not in your web root). Add entries using the format:

username:encrypted_password

2. Create .htaccess File

In the directory you want to protect, create or edit .htaccess file with:

AuthType Basic
AuthName "Restricted Area"
AuthUserFile /path/to/.htpasswd
Require valid-user

3. Set Proper Permissions

Ensure your .htpasswd file has proper permissions (readable by web server, not by public):

chmod 644 .htpasswd

⚠️ Security Best Practices: Always use strong passwords, store .htpasswd files outside web root, use HTTPS to prevent password sniffing, and prefer bcrypt encryption for new implementations.

Example .htpasswd File

# Apache .htpasswd file
admin:$2y$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy
user:$apr1$r31.....$Hhp4w1A3U.zpAw3W5f4eS0
guest:{SHA}W6ph5Mm5Pz8GgiULbPgzG37mj9g=
# Format: username:encrypted_password

💡 Tip: For better security, consider using HTTP authentication in combination with other security measures like IP restrictions or two-factor authentication for sensitive areas.

🛠️ Free Smart Tools

English English