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 hashes 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
@@ -72,9 +65,12 @@ distribution.
[ -i ]
[ -m |
-B |
+ -2 |
+ -5 |
-d |
-s |
-p ]
+ [ -r rounds ]
[ -C cost ]
[ -D ]
[ -v ] passwdfile username
htpasswd -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() hashing for passwords. This is not
supported by the The SHA and crypt() formats are insecure by today's
- standards.
The SHA-1 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.