39
39
stores, though. To use a DBM database see <program >dbmmanage</program > or
40
40
<program >htdbm</program >.</p >
41
41
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 >
49
42
<p ><code >htpasswd</code > hashes passwords using either bcrypt, a
50
43
version of MD5 modified for Apache, SHA-1, or the system's
51
44
<code >crypt()</code > routine. SHA-2-based hashes (SHA-256 and
@@ -72,9 +65,12 @@ distribution.</seealso>
72
65
[ -<strong >i</strong > ]
73
66
[ -<strong >m</strong > |
74
67
-<strong >B</strong > |
68
+ -<strong >2</strong > |
69
+ -<strong >5</strong > |
75
70
-<strong >d</strong > |
76
71
-<strong >s</strong > |
77
72
-<strong >p</strong > ]
73
+ [ -<strong >r</strong > <var >rounds</var > ]
78
74
[ -<strong >C</strong > <var >cost</var > ]
79
75
[ -<strong >D</strong > ]
80
76
[ -<strong >v</strong > ] <var >passwdfile</var > <var >username</var ></code ></p >
@@ -83,9 +79,12 @@ distribution.</seealso>
83
79
[ -<strong >c</strong > ]
84
80
[ -<strong >m</strong > |
85
81
-<strong >B</strong > |
82
+ -<strong >2</strong > |
83
+ -<strong >5</strong > |
86
84
-<strong >d</strong > |
87
85
-<strong >s</strong > |
88
86
-<strong >p</strong > ]
87
+ [ -<strong >r</strong > <var >rounds</var > ]
89
88
[ -<strong >C</strong > <var >cost</var > ]
90
89
[ -<strong >D</strong > ]
91
90
[ -<strong >v</strong > ] <var >passwdfile</var > <var >username</var >
@@ -95,17 +94,23 @@ distribution.</seealso>
95
94
[ -<strong >i</strong > ]
96
95
[ -<strong >m</strong > |
97
96
-<strong >B</strong > |
97
+ -<strong >2</strong > |
98
+ -<strong >5</strong > |
98
99
-<strong >d</strong > |
99
100
-<strong >s</strong > |
100
101
-<strong >p</strong > ]
102
+ [ -<strong >r</strong > <var >rounds</var > ]
101
103
[ -<strong >C</strong > <var >cost</var > ] <var >username</var ></code ></p >
102
104
103
105
<p ><code ><strong >htpasswd</strong > -<strong >nb</strong >
104
106
[ -<strong >m</strong > |
105
- -<strong >B</strong > |
107
+ -<strong >B</strong > |
108
+ -<strong >2</strong > |
109
+ -<strong >5</strong > |
106
110
-<strong >d</strong > |
107
111
-<strong >s</strong > |
108
112
-<strong >p</strong > ]
113
+ [ -<strong >r</strong > <var >rounds</var > ]
109
114
[ -<strong >C</strong > <var >cost</var > ] <var >username</var >
110
115
<var >password</var ></code ></p >
111
116
</section >
@@ -138,6 +143,14 @@ distribution.</seealso>
138
143
<dd >Use MD5 hashing for passwords. This is the default (since version
139
144
2.2.18).</dd >
140
145
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
+
141
154
<dt ><code >-B</code ></dt >
142
155
<dd >Use bcrypt hashing for passwords. This is currently considered to
143
156
be very secure.</dd >
@@ -147,6 +160,12 @@ distribution.</seealso>
147
160
hashing). It sets the computing time used for the bcrypt algorithm
148
161
(higher is more secure but slower, default: 5, valid: 4 to 17).</dd >
149
162
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
+
150
169
<dt ><code >-d</code ></dt >
151
170
<dd >Use <code >crypt()</code > hashing for passwords. This is not
152
171
supported by the <program >httpd</program > server on Windows and
@@ -253,8 +272,14 @@ distribution.</seealso>
253
272
prepending a random salt string, to make dictionary attacks
254
273
against the passwords more difficult.</p >
255
274
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
+
258
283
</section >
259
284
260
285
<section id =" restrictions" ><title >Restrictions</title >
0 commit comments