]> granicus.if.org Git - apache/commitdiff
Document SHA-2 support.
authorJoe Orton <jorton@apache.org>
Fri, 5 Jul 2019 12:20:55 +0000 (12:20 +0000)
committerJoe Orton <jorton@apache.org>
Fri, 5 Jul 2019 12:20:55 +0000 (12:20 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1862609 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/programs/htpasswd.xml

index efbf21022dd1f8d84d56549e5ee065a63b3d03e7..7777a8b4e3375e2de5098c66ca48948f5aac664e 100644 (file)
     stores, though. To use a DBM database see <program>dbmmanage</program> or
     <program>htdbm</program>.</p>
 
-    <p><code>htpasswd</code> encrypts passwords using either bcrypt,
-    a version of MD5 modified for Apache, SHA1, or the system's
-    <code>crypt()</code> routine. Files
-    managed by <code>htpasswd</code> 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 <code>crypt()</code>.</p>
+    <p><code>htpasswd</code> encrypts passwords using either bcrypt, a
+    version of MD5 modified for Apache, SHA-1, or the system's
+    <code>crypt()</code> routine. SHA-2-based hashes (SHA-256 and
+    SHA-512) are supported for <code>crypt()</code>.  Files managed by
+    <code>htpasswd</code> 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 <code>crypt()</code>.</p>
 
     <p>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.</seealso>
     [ -<strong>i</strong> ]
     [ -<strong>m</strong> |
       -<strong>B</strong> |
+      -<strong>2</strong> | 
+      -<strong>5</strong> | 
       -<strong>d</strong> |
       -<strong>s</strong> |
       -<strong>p</strong> ]
+    [ -<strong>r</strong> <var>rounds</var> ]
     [ -<strong>C</strong> <var>cost</var> ]
     [ -<strong>D</strong> ]
     [ -<strong>v</strong> ]  <var>passwdfile</var> <var>username</var></code></p>
@@ -75,9 +79,12 @@ distribution.</seealso>
     [ -<strong>c</strong> ]
     [ -<strong>m</strong> |
       -<strong>B</strong> |
+      -<strong>2</strong> | 
+      -<strong>5</strong> | 
       -<strong>d</strong> |
       -<strong>s</strong> |
       -<strong>p</strong> ]
+    [ -<strong>r</strong> <var>rounds</var> ]
     [ -<strong>C</strong> <var>cost</var> ]
     [ -<strong>D</strong> ]
     [ -<strong>v</strong> ]  <var>passwdfile</var> <var>username</var>
@@ -87,17 +94,23 @@ distribution.</seealso>
     [ -<strong>i</strong> ]
     [ -<strong>m</strong> |
       -<strong>B</strong> |
+      -<strong>2</strong> | 
+      -<strong>5</strong> | 
       -<strong>d</strong> |
       -<strong>s</strong> |
       -<strong>p</strong> ]
+    [ -<strong>r</strong> <var>rounds</var> ]
     [ -<strong>C</strong> <var>cost</var> ] <var>username</var></code></p>
 
     <p><code><strong>htpasswd</strong> -<strong>nb</strong>
     [ -<strong>m</strong> |
-      -<strong>B</strong> |
+      -<strong>B</strong> | 
+      -<strong>2</strong> | 
+      -<strong>5</strong> | 
       -<strong>d</strong> |
       -<strong>s</strong> |
       -<strong>p</strong> ]
+    [ -<strong>r</strong> <var>rounds</var> ]
     [ -<strong>C</strong> <var>cost</var> ] <var>username</var>
     <var>password</var></code></p>
 </section>
@@ -130,6 +143,14 @@ distribution.</seealso>
     <dd>Use MD5 encryption for passwords. This is the default (since version
     2.2.18).</dd>
 
+    <dt><code>-2</code></dt>
+    <dd>Use SHA-256 <code>crypt()</code> based hashes for passwords.  This is
+    supported on most Unix platforms.</dd>
+
+    <dt><code>-5</code></dt>
+    <dd>Use SHA-512 <code>crypt()</code> based hashes for passwords.  This is
+    supported on most Unix platforms.</dd>
+
     <dt><code>-B</code></dt>
     <dd>Use bcrypt encryption for passwords. This is currently considered to
     be very secure.</dd>
@@ -139,6 +160,12 @@ distribution.</seealso>
     encryption). It sets the computing time used for the bcrypt algorithm
     (higher is more secure but slower, default: 5, valid: 4 to 17).</dd>
 
+    <dt><code>-r</code></dt>
+    <dd>This flag is only allowed in combination with <code>-2</code>
+    or <code>-5</code>. It sets the number of hash rounds used for the
+    SHA-2 algorithms (higher is more secure but slower; the default is
+    5,000).</dd>
+
     <dt><code>-d</code></dt>
     <dd>Use <code>crypt()</code> encryption for passwords. This is not
     supported by the <program>httpd</program> server on Windows and
@@ -147,9 +174,10 @@ distribution.</seealso>
     It used to be the default algorithm until version 2.2.17.</dd>
 
     <dt><code>-s</code></dt>
-    <dd>Use SHA encryption for passwords. Facilitates migration from/to Netscape
-    servers using the LDAP Directory Interchange Format (ldif).
-    This algorithm is <strong>insecure</strong> by today's standards.</dd>
+    <dd>Use SHA-1 (160-bit) encryption for passwords. Facilitates migration
+    from/to Netscape servers using the LDAP Directory Interchange
+    Format (ldif).  This algorithm is <strong>insecure</strong> by
+    today's standards.</dd>
 
     <dt><code>-p</code></dt>
     <dd>Use plaintext passwords. Though <code>htpasswd</code> will support
@@ -238,13 +266,20 @@ distribution.</seealso>
     8 characters of the password are used  to form the password. If the supplied
     password is longer, the extra characters will be silently discarded.</p>
 
-    <p>The SHA encryption format does not use salting: for a given password,
-    there is only one encrypted representation. The <code>crypt()</code> and
-    MD5 formats permute the representation by prepending a random salt string,
-    to make dictionary attacks against the passwords more difficult.</p>
+    <p>The SHA-1 encryption format does not use salting: for a given
+    password, there is only one encrypted representation. The
+    <code>crypt()</code> and MD5 formats permute the representation by
+    prepending a random salt string, to make dictionary attacks
+    against the passwords more difficult.</p>
+
+    <p>The SHA-1 and <code>crypt()</code> formats are insecure by
+    today's standards.</p>
 
-    <p>The SHA and <code>crypt()</code> formats are insecure by today's
-    standards.</p>
+    <p>The SHA-2-based <code>crypt()</code> formats (SHA-256 and
+    SHA-512) are supported on most modern Unix systems, and follow the
+    specification at <a
+    href="https://www.akkadia.org/drepper/SHA-crypt.txt">https://www.akkadia.org/drepper/SHA-crypt.txt</a>.</p>
+    
 </section>
 
 <section id="restrictions"><title>Restrictions</title>