Account
Result

Choosing an algorithm

apr1 is the default of Apache htpasswd -m and is understood by both Nginx and Apache, so it is the safe choice. SHA-1 (the {SHA} prefix, htpasswd -s) is weaker and only worth using when the other end supports nothing else. plain is for debugging only. bcrypt needs an extra module and is not offered here.

htpasswd Generator

Protecting a directory behind a username and password takes one line of user:$apr1$... in a .htpasswd file. But plenty of machines have no httpd-tools installed, and pulling in all of Apache for one password is a poor trade. This page does the arithmetic in your browser.

The apr1 implementation follows Apache and produces byte-identical results to htpasswd -m, so it can be swapped in directly. Passwords never leave the page.

Features

How to use

  1. Enter a username and password. Usernames allow letters, digits and . _ @ - only.
  2. Pick an algorithm; apr1 is the usual choice.
  3. Copy the generated line into your .htpasswd file.

FAQ

apr1 or SHA-1?

Prefer apr1. It is the default of Apache htpasswd -m, works with both Nginx and Apache, and is salted with 1000 iterations, so it resists cracking far better than SHA-1. Fall back to {SHA} only when the other end supports nothing else.

Why does the same password produce a different string every time?

Because of the salt. apr1 picks eight random characters per hash and stores them in the result ($apr1$salt$hash), so verification recomputes with that salt and any of those strings will match.

Is the password sent anywhere?

No. Everything runs locally and the page contains no upload path; it works offline. Clearing the field afterwards is still good hygiene.

Related tools & reading

フィードバック

このサイトはフロントエンドのみでバックエンドやアカウントはなく、フィードバックはGitHub Issues・ディスカッション・メールで受け付けています。

issueやメールに貼り付けていただくと問題特定が早まります。入力内容は含まれません

その他:既存の報告を見る · メールでのフィードバック(GitHubアカウント不要):278975598@qq.com