Skip to content

Commit b07aa54

Browse files
committed
Merge r1916129 from trunk (htpasswd docs):
Document SHA-2 support. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1916749 13f79535-47bb-0310-9956-ffa450edef68
1 parent 135f45a commit b07aa54

File tree

1 file changed

+35
-10
lines changed

1 file changed

+35
-10
lines changed

docs/manual/programs/htpasswd.xml

+35-10
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@
3939
stores, though. To use a DBM database see <program>dbmmanage</program> or
4040
<program>htdbm</program>.</p>
4141

42-
<p><code>htpasswd</code> encrypts passwords using either bcrypt,
43-
a version of MD5 modified for Apache, SHA1, or the system's
44-
<code>crypt()</code> routine. Files
45-
managed by <code>htpasswd</code> may contain a mixture of different encoding
46-
types of passwords; some
47-
user records may have bcrypt or MD5-encrypted passwords while others in the
48-
same file may have passwords encrypted with <code>crypt()</code>.</p>
4942
<p><code>htpasswd</code> hashes passwords using either bcrypt, a
5043
version of MD5 modified for Apache, SHA-1, or the system's
5144
<code>crypt()</code> routine. SHA-2-based hashes (SHA-256 and
@@ -72,9 +65,12 @@ distribution.</seealso>
7265
[ -<strong>i</strong> ]
7366
[ -<strong>m</strong> |
7467
-<strong>B</strong> |
68+
-<strong>2</strong> |
69+
-<strong>5</strong> |
7570
-<strong>d</strong> |
7671
-<strong>s</strong> |
7772
-<strong>p</strong> ]
73+
[ -<strong>r</strong> <var>rounds</var> ]
7874
[ -<strong>C</strong> <var>cost</var> ]
7975
[ -<strong>D</strong> ]
8076
[ -<strong>v</strong> ] <var>passwdfile</var> <var>username</var></code></p>
@@ -83,9 +79,12 @@ distribution.</seealso>
8379
[ -<strong>c</strong> ]
8480
[ -<strong>m</strong> |
8581
-<strong>B</strong> |
82+
-<strong>2</strong> |
83+
-<strong>5</strong> |
8684
-<strong>d</strong> |
8785
-<strong>s</strong> |
8886
-<strong>p</strong> ]
87+
[ -<strong>r</strong> <var>rounds</var> ]
8988
[ -<strong>C</strong> <var>cost</var> ]
9089
[ -<strong>D</strong> ]
9190
[ -<strong>v</strong> ] <var>passwdfile</var> <var>username</var>
@@ -95,17 +94,23 @@ distribution.</seealso>
9594
[ -<strong>i</strong> ]
9695
[ -<strong>m</strong> |
9796
-<strong>B</strong> |
97+
-<strong>2</strong> |
98+
-<strong>5</strong> |
9899
-<strong>d</strong> |
99100
-<strong>s</strong> |
100101
-<strong>p</strong> ]
102+
[ -<strong>r</strong> <var>rounds</var> ]
101103
[ -<strong>C</strong> <var>cost</var> ] <var>username</var></code></p>
102104

103105
<p><code><strong>htpasswd</strong> -<strong>nb</strong>
104106
[ -<strong>m</strong> |
105-
-<strong>B</strong> |
107+
-<strong>B</strong> |
108+
-<strong>2</strong> |
109+
-<strong>5</strong> |
106110
-<strong>d</strong> |
107111
-<strong>s</strong> |
108112
-<strong>p</strong> ]
113+
[ -<strong>r</strong> <var>rounds</var> ]
109114
[ -<strong>C</strong> <var>cost</var> ] <var>username</var>
110115
<var>password</var></code></p>
111116
</section>
@@ -138,6 +143,14 @@ distribution.</seealso>
138143
<dd>Use MD5 hashing for passwords. This is the default (since version
139144
2.2.18).</dd>
140145

146+
<dt><code>-2</code></dt>
147+
<dd>Use SHA-256 <code>crypt()</code> based hashes for passwords. This is
148+
supported on most Unix platforms.</dd>
149+
150+
<dt><code>-5</code></dt>
151+
<dd>Use SHA-512 <code>crypt()</code> based hashes for passwords. This is
152+
supported on most Unix platforms.</dd>
153+
141154
<dt><code>-B</code></dt>
142155
<dd>Use bcrypt hashing for passwords. This is currently considered to
143156
be very secure.</dd>
@@ -147,6 +160,12 @@ distribution.</seealso>
147160
hashing). It sets the computing time used for the bcrypt algorithm
148161
(higher is more secure but slower, default: 5, valid: 4 to 17).</dd>
149162

163+
<dt><code>-r</code></dt>
164+
<dd>This flag is only allowed in combination with <code>-2</code>
165+
or <code>-5</code>. It sets the number of hash rounds used for the
166+
SHA-2 algorithms (higher is more secure but slower; the default is
167+
5,000).</dd>
168+
150169
<dt><code>-d</code></dt>
151170
<dd>Use <code>crypt()</code> hashing for passwords. This is not
152171
supported by the <program>httpd</program> server on Windows and
@@ -253,8 +272,14 @@ distribution.</seealso>
253272
prepending a random salt string, to make dictionary attacks
254273
against the passwords more difficult.</p>
255274

256-
<p>The SHA and <code>crypt()</code> formats are insecure by today's
257-
standards.</p>
275+
<p>The SHA-1 and <code>crypt()</code> formats are insecure by
276+
today's standards.</p>
277+
278+
<p>The SHA-2-based <code>crypt()</code> formats (SHA-256 and
279+
SHA-512) are supported on most modern Unix systems, and follow the
280+
specification at <a
281+
href="https://www.akkadia.org/drepper/SHA-crypt.txt">https://www.akkadia.org/drepper/SHA-crypt.txt</a>.</p>
282+
258283
</section>
259284

260285
<section id="restrictions"><title>Restrictions</title>

0 commit comments

Comments
 (0)