From: Joe Orton
htpasswd encrypts passwords using either bcrypt,
- a version of MD5 modified for Apache, SHA1, or the system's
- crypt() routine. Files
- managed by htpasswd may contain a mixture of different encoding
- types of passwords; some
- user records may have bcrypt or MD5-encrypted passwords while others in the
- same file may have passwords encrypted with crypt().
htpasswd encrypts passwords using either bcrypt, a
+ version of MD5 modified for Apache, SHA-1, or the system's
+ crypt() routine. SHA-2-based hashes (SHA-256 and
+ SHA-512) are supported for crypt(). Files managed by
+ htpasswd may contain a mixture of different encoding
+ types of passwords; some user records may have bcrypt or
+ MD5-encrypted passwords while others in the same file may have
+ passwords encrypted with crypt().
This manual page only lists the command line arguments. For details of the directives necessary to configure user authentication in @@ -64,9 +65,12 @@ distribution. [ -i ] [ -m | -B | + -2 | + -5 | -d | -s | -p ] + [ -r rounds ] [ -C cost ] [ -D ] [ -v ] passwdfile username
@@ -75,9 +79,12 @@ distribution. [ -c ] [ -m | -B | + -2 | + -5 | -d | -s | -p ] + [ -r rounds ] [ -C cost ] [ -D ] [ -v ] passwdfile username @@ -87,17 +94,23 @@ distribution. [ -i ] [ -m | -B | + -2 | + -5 | -d | -s | -p ] + [ -r rounds ] [ -C cost ] usernamehtpasswd -nb
[ -m |
- -B |
+ -B |
+ -2 |
+ -5 |
-d |
-s |
-p ]
+ [ -r rounds ]
[ -C cost ] username
password
-2crypt() based hashes for passwords. This is
+ supported on most Unix platforms.-5crypt() based hashes for passwords. This is
+ supported on most Unix platforms.-B-r-2
+ or -5. It sets the number of hash rounds used for the
+ SHA-2 algorithms (higher is more secure but slower; the default is
+ 5,000).-dcrypt() encryption for passwords. This is not
supported by the -s-phtpasswd will support
@@ -238,13 +266,20 @@ distribution.
8 characters of the password are used to form the password. If the supplied
password is longer, the extra characters will be silently discarded.
- The SHA encryption format does not use salting: for a given password,
- there is only one encrypted representation. The crypt() and
- MD5 formats permute the representation by prepending a random salt string,
- to make dictionary attacks against the passwords more difficult.
The SHA-1 encryption format does not use salting: for a given
+ password, there is only one encrypted representation. The
+ crypt() and MD5 formats permute the representation by
+ prepending a random salt string, to make dictionary attacks
+ against the passwords more difficult.
The SHA-1 and crypt() formats are insecure by
+ today's standards.
The SHA and crypt() formats are insecure by today's
- standards.
The SHA-2-based crypt() formats (SHA-256 and
+ SHA-512) are supported on most modern Unix systems, and follow the
+ specification at https://www.akkadia.org/drepper/SHA-crypt.txt.