55 <p> |
55 <p> |
56 Module function to hash a password according to the PBKDF2 specification. |
56 Module function to hash a password according to the PBKDF2 specification. |
57 </p> |
57 </p> |
58 <dl> |
58 <dl> |
59 |
59 |
60 <dt><i>password</i></dt> |
60 <dt><i>password</i> (str)</dt> |
61 <dd> |
61 <dd> |
62 clear text password (string) |
62 clear text password |
63 </dd> |
63 </dd> |
64 <dt><i>digestMod</i></dt> |
64 <dt><i>digestMod</i> (function)</dt> |
65 <dd> |
65 <dd> |
66 hash function |
66 hash function |
67 </dd> |
67 </dd> |
68 <dt><i>iterations</i></dt> |
68 <dt><i>iterations</i> (int)</dt> |
69 <dd> |
69 <dd> |
70 number of times hash function should be applied (integer) |
70 number of times hash function should be applied |
71 </dd> |
71 </dd> |
72 <dt><i>saltSize</i></dt> |
72 <dt><i>saltSize</i> (int)</dt> |
73 <dd> |
73 <dd> |
74 size of the salt (integer) |
74 size of the salt |
75 </dd> |
75 </dd> |
76 </dl> |
76 </dl> |
77 <dl> |
77 <dl> |
78 <dt>Return:</dt> |
78 <dt>Return:</dt> |
79 <dd> |
79 <dd> |
80 hashed password entry according to PBKDF2 specification (string) |
80 hashed password entry according to PBKDF2 specification |
|
81 </dd> |
|
82 </dl> |
|
83 <dl> |
|
84 <dt>Return Type:</dt> |
|
85 <dd> |
|
86 str |
81 </dd> |
87 </dd> |
82 </dl> |
88 </dl> |
83 <div align="right"><a href="#top">Up</a></div> |
89 <div align="right"><a href="#top">Up</a></div> |
84 <hr /> |
90 <hr /> |
85 <hr /> |
91 <hr /> |
90 <p> |
96 <p> |
91 Module function to hash a password according to the PBKDF2 specification. |
97 Module function to hash a password according to the PBKDF2 specification. |
92 </p> |
98 </p> |
93 <dl> |
99 <dl> |
94 |
100 |
95 <dt><i>password</i></dt> |
101 <dt><i>password</i> (str)</dt> |
96 <dd> |
102 <dd> |
97 clear text password (string) |
103 clear text password |
98 </dd> |
104 </dd> |
99 <dt><i>digestMod</i></dt> |
105 <dt><i>digestMod</i> (function)</dt> |
100 <dd> |
106 <dd> |
101 hash function |
107 hash function |
102 </dd> |
108 </dd> |
103 <dt><i>iterations</i></dt> |
109 <dt><i>iterations</i> (int)</dt> |
104 <dd> |
110 <dd> |
105 number of times hash function should be applied (integer) |
111 number of times hash function should be applied |
106 </dd> |
112 </dd> |
107 <dt><i>saltSize</i></dt> |
113 <dt><i>saltSize</i> (int)</dt> |
108 <dd> |
114 <dd> |
109 size of the salt (integer) |
115 size of the salt |
110 </dd> |
116 </dd> |
111 </dl> |
117 </dl> |
112 <dl> |
118 <dl> |
113 <dt>Return:</dt> |
119 <dt>Return:</dt> |
114 <dd> |
120 <dd> |
115 tuple of digestname (string), number of iterations (integer), |
121 tuple of digestname, number of iterations, salt and hashed password |
116 salt (bytes) and hashed password (bytes) |
122 </dd> |
|
123 </dl> |
|
124 <dl> |
|
125 <dt>Return Type:</dt> |
|
126 <dd> |
|
127 tuple of (str, int, bytes, bytes) |
117 </dd> |
128 </dd> |
118 </dl> |
129 </dl> |
119 <div align="right"><a href="#top">Up</a></div> |
130 <div align="right"><a href="#top">Up</a></div> |
120 <hr /> |
131 <hr /> |
121 <hr /> |
132 <hr /> |
126 <p> |
137 <p> |
127 Module function to hash a password according to the PBKDF2 specification. |
138 Module function to hash a password according to the PBKDF2 specification. |
128 </p> |
139 </p> |
129 <dl> |
140 <dl> |
130 |
141 |
131 <dt><i>password</i></dt> |
142 <dt><i>password</i> (bytes)</dt> |
132 <dd> |
143 <dd> |
133 clear text password (bytes) |
144 clear text password |
134 </dd> |
145 </dd> |
135 <dt><i>salt</i></dt> |
146 <dt><i>salt</i> (bytes)</dt> |
136 <dd> |
147 <dd> |
137 salt value (bytes) |
148 salt value |
138 </dd> |
149 </dd> |
139 <dt><i>iterations</i></dt> |
150 <dt><i>iterations</i> (int)</dt> |
140 <dd> |
151 <dd> |
141 number of times hash function should be applied (integer) |
152 number of times hash function should be applied |
142 </dd> |
153 </dd> |
143 <dt><i>digestMod</i></dt> |
154 <dt><i>digestMod</i> (function)</dt> |
144 <dd> |
155 <dd> |
145 hash function |
156 hash function |
146 </dd> |
157 </dd> |
147 </dl> |
158 </dl> |
148 <dl> |
159 <dl> |
149 <dt>Return:</dt> |
160 <dt>Return:</dt> |
150 <dd> |
161 <dd> |
151 hashed password (bytes) |
162 hashed password |
|
163 </dd> |
|
164 </dl> |
|
165 <dl> |
|
166 <dt>Return Type:</dt> |
|
167 <dd> |
|
168 bytes |
152 </dd> |
169 </dd> |
153 </dl> |
170 </dl> |
154 <div align="right"><a href="#top">Up</a></div> |
171 <div align="right"><a href="#top">Up</a></div> |
155 <hr /> |
172 <hr /> |
156 <hr /> |
173 <hr /> |
161 <p> |
178 <p> |
162 Module function to recreate a password hash given the hash parameters. |
179 Module function to recreate a password hash given the hash parameters. |
163 </p> |
180 </p> |
164 <dl> |
181 <dl> |
165 |
182 |
166 <dt><i>password</i></dt> |
183 <dt><i>password</i> (str)</dt> |
167 <dd> |
184 <dd> |
168 clear text password (string) |
185 clear text password |
169 </dd> |
186 </dd> |
170 <dt><i>hashParameters</i></dt> |
187 <dt><i>hashParameters</i> (str)</dt> |
171 <dd> |
188 <dd> |
172 hash parameters in the form |
189 hash parameters in the form |
173 'digestmod$iterations$salt' (string) |
190 'digestmod$iterations$salt' |
174 </dd> |
191 </dd> |
175 </dl> |
192 </dl> |
176 <dl> |
193 <dl> |
177 <dt>Return:</dt> |
194 <dt>Return:</dt> |
178 <dd> |
195 <dd> |
179 hashed password (bytes) |
196 hashed password |
|
197 </dd> |
|
198 </dl> |
|
199 <dl> |
|
200 <dt>Return Type:</dt> |
|
201 <dd> |
|
202 bytes |
180 </dd> |
203 </dd> |
181 </dl> |
204 </dl> |
182 <dl> |
205 <dl> |
183 |
206 |
184 <dt>Raises <b>ValueError</b>:</dt> |
207 <dt>Raises <b>ValueError</b>:</dt> |
197 <p> |
220 <p> |
198 Module function to verify a password against a hash encoded password. |
221 Module function to verify a password against a hash encoded password. |
199 </p> |
222 </p> |
200 <dl> |
223 <dl> |
201 |
224 |
202 <dt><i>password</i></dt> |
225 <dt><i>password</i> (str)</dt> |
203 <dd> |
226 <dd> |
204 clear text password (string) |
227 clear text password |
205 </dd> |
228 </dd> |
206 <dt><i>pwHash</i></dt> |
229 <dt><i>pwHash</i> (str)</dt> |
207 <dd> |
230 <dd> |
208 hash encoded password in the form |
231 hash encoded password in the form |
209 'digestmod$iterations$salt$hashed_password' as produced by the |
232 'digestmod$iterations$salt$hashed_password' as produced by the |
210 hashPassword function (string) |
233 hashPassword function |
211 </dd> |
234 </dd> |
212 </dl> |
235 </dl> |
213 <dl> |
236 <dl> |
214 <dt>Return:</dt> |
237 <dt>Return:</dt> |
215 <dd> |
238 <dd> |
216 flag indicating a successfull verification (boolean) |
239 flag indicating a successfull verification |
|
240 </dd> |
|
241 </dl> |
|
242 <dl> |
|
243 <dt>Return Type:</dt> |
|
244 <dd> |
|
245 bool |
217 </dd> |
246 </dd> |
218 </dl> |
247 </dl> |
219 <dl> |
248 <dl> |
220 |
249 |
221 <dt>Raises <b>ValueError</b>:</dt> |
250 <dt>Raises <b>ValueError</b>:</dt> |