When PBKDF2 was originally chosen as the default, it was selected because
it was the most secure option that could reasonably be implemented in pure
Python with the stdlib.
As of Python 3.6, scrypt is available in the stdlib. scrypt is also
substantially more secure than PBKDF2, because it is memory hard. See
https://www.tarsnap.com/scrypt/scrypt.pdf (page 14) for a table that
assess the relative cost-to-brute-force of scrypt vs. PBKDF2 at the
interactive latency.
For these reasons, I think it'd be appropriate for Django to include an
scrypt based hasher, and even to default to it for new installations.
--
Ticket URL: <https://code.djangoproject.com/ticket/32275>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Alex Gaynor):
I should note, that while I can't make any commitments on behalf of a 3rd
party, I think there's a reasonable chance this would qualify for a reward
under Google's Patch Rewards program:
https://www.google.com/about/appsecurity/patch-rewards/ (I have no
affiliation with Google)
Link to the scrypt docs:
https://docs.python.org/3/library/hashlib.html#hashlib.scrypt
--
Ticket URL: <https://code.djangoproject.com/ticket/32275#comment:1>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/32275#comment:2>
* cc: Anthony Wright (added)
* owner: nobody => Anthony Wright
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/32275#comment:3>
Comment (by Anthony Wright):
Wrote scrypt function in crypto.py which uses the hashlib.scrypt function.
Wrote ScryptPasswordHasher class in Hashers.py and added it as an option
in global_settings. Currently working on tests.
--
Ticket URL: <https://code.djangoproject.com/ticket/32275#comment:4>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/32275#comment:5>
* has_patch: 1 => 0
Comment:
Please send PR via GitHub before marking this flag.
--
Ticket URL: <https://code.djangoproject.com/ticket/32275#comment:6>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/32275#comment:7>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/32275#comment:8>
* needs_better_patch: 1 => 0
* needs_docs: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/32275#comment:9>
* needs_docs: 1 => 0
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/32275#comment:10>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"1783b3cb24cdefd8e1e3d73acd1d1ef3011c96be" 1783b3c]:
{{{
#!CommitTicketReference repository=""
revision="1783b3cb24cdefd8e1e3d73acd1d1ef3011c96be"
Fixed #32275 -- Added scrypt password hasher.
Co-authored-by: Mariusz Felisiak <felisiak...@gmail.com>
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32275#comment:11>
Comment (by GitHub <noreply@…>):
In [changeset:"90c75dc4f37bee19b7c3790519d187e38e293800" 90c75dc4]:
{{{
#!CommitTicketReference repository=""
revision="90c75dc4f37bee19b7c3790519d187e38e293800"
Refs #32275 -- Added scrypt password hasher to PASSWORD_HASHERS setting
docs.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32275#comment:12>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"d5b093a2c5d968dc11447bc9b84848788f297737" d5b093a2]:
{{{
#!CommitTicketReference repository=""
revision="d5b093a2c5d968dc11447bc9b84848788f297737"
[5.0.x] Refs #32275 -- Added scrypt password hasher to PASSWORD_HASHERS
setting docs.
Backport of 90c75dc4f37bee19b7c3790519d187e38e293800 from main
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32275#comment:13>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"99dcba90b4d36272d6c2e0fd96eec1ee5883db4c" 99dcba9]:
{{{
#!CommitTicketReference repository=""
revision="99dcba90b4d36272d6c2e0fd96eec1ee5883db4c"
[4.2.x] Refs #32275 -- Added scrypt password hasher to PASSWORD_HASHERS
setting docs.
Backport of 90c75dc4f37bee19b7c3790519d187e38e293800 from main
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32275#comment:14>