Replace pbkdf2 with bcrypt (#16071)

* Replace pbkdf2 with bcrypt

bcrypt isn't inherently better than pbkdf2, but everything "just works"
out of the box.

  * the hash verification routine now only computes one hash per call
  * a per-user salt is built into the hash as opposed to the current
  global salt
  * bcrypt.checkpw() is immune to timing attacks regardless of input
  * hash strength is a function of real time benchmarks and a
  "difficulty" level, meaning we won't have to ever update the iteration
  count

* WIP: add hash upgrade mechanism

* WIP: clarify decode issue

* remove stale testing code

* Fix test

* Ensure incorrect legacy passwords fail

* Add better invalid legacy password test

* Lint

* Run tests in async scope
This commit is contained in:
Matt Hamilton authored and Paulus Schoutsen committed 2018-08-26 22:50:31 +02:00
1 parent 47755fb1e9
commit bacecb4249
5 files changed
+135 -8

No files matched your search

+1
View File
@@ -36,6 +36,7 @@ REQUIRES = [
'astral==1.6.1',
'async_timeout==3.0.0',
'attrs==18.1.0',
'bcrypt==3.1.4',
'certifi>=2018.04.16',
'jinja2>=2.10',
'PyJWT==1.6.4',