From 276a9a1014c50e7b517714cb173a91acd6b888d5 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 5 Jul 2019 12:20:55 +0000 Subject: [PATCH] Document SHA-2 support. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1862609 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/programs/htpasswd.xml | 69 +++++++++++++++++++++++-------- 1 file changed, 52 insertions(+), 17 deletions(-) diff --git a/docs/manual/programs/htpasswd.xml b/docs/manual/programs/htpasswd.xml index efbf21022d..7777a8b4e3 100644 --- a/docs/manual/programs/htpasswd.xml +++ b/docs/manual/programs/htpasswd.xml @@ -39,13 +39,14 @@ stores, though. To use a DBM database see dbmmanage or htdbm.

-

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 ] username

htpasswd -nb [ -m | - -B | + -B | + -2 | + -5 | -d | -s | -p ] + [ -r rounds ] [ -C cost ] username password

@@ -130,6 +143,14 @@ distribution.
Use MD5 encryption for passwords. This is the default (since version 2.2.18).
+
-2
+
Use SHA-256 crypt() based hashes for passwords. This is + supported on most Unix platforms.
+ +
-5
+
Use SHA-512 crypt() based hashes for passwords. This is + supported on most Unix platforms.
+
-B
Use bcrypt encryption for passwords. This is currently considered to be very secure.
@@ -139,6 +160,12 @@ distribution. encryption). It sets the computing time used for the bcrypt algorithm (higher is more secure but slower, default: 5, valid: 4 to 17). +
-r
+
This flag is only allowed in combination with -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).
+
-d
Use crypt() encryption for passwords. This is not supported by the httpd server on Windows and @@ -147,9 +174,10 @@ distribution. It used to be the default algorithm until version 2.2.17.
-s
-
Use SHA encryption for passwords. Facilitates migration from/to Netscape - servers using the LDAP Directory Interchange Format (ldif). - This algorithm is insecure by today's standards.
+
Use SHA-1 (160-bit) encryption for passwords. Facilitates migration + from/to Netscape servers using the LDAP Directory Interchange + Format (ldif). This algorithm is insecure by + today's standards.
-p
Use plaintext passwords. Though htpasswd 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.

+
Restrictions -- 2.50.1