⚡ DevToolKit

htpasswd Generator (bcrypt)

Generate an Apache htpasswd line (username:bcrypt-hash) for basic auth. Runs locally in your browser.

Apache configuration example:

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

After adding the entry to .htpasswd, reload your web server (Apache/Nginx).

使用说明

  1. 输入用户名和密码。
  2. 选择加密算法(推荐 bcrypt 或 Apache MD5)。
  3. 点击'生成'获取 .htpasswd 格式的条目。
  4. 将生成的条目添加到您的 .htpasswd 文件中,用于 Apache/Nginx 基本身份验证。

常见问题

密码会被发送到服务器吗?

不会。所有哈希计算都在您的浏览器本地完成,密码始终保持私密。

我应该选择哪种加密算法?

bcrypt 是最安全的选择。如果服务器不支持,可使用 Apache MD5(apr1)作为备选方案。