#27468: Move utils.crypto.salted_hmac() from SHA1 toward SHA256
------------------------------------------------+------------------------
Reporter: Tim Graham | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Utilities | Version: master
Severity: Normal | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
The `salted_hmac()` function uses SHA-1 in two places, for key derivation
and as the hash function of the HMAC algorithm. HMAC-SHA1 is
[http://crypto.stackexchange.com/questions/26510/why-is-hmac-sha1-still-
considered-secure/26518#26518 still considered secure], but it would be
nice to move toward SHA256. Some work is needed to ensure backward
compatibility (like we've done with password storage).
Ramifications:
- Changing the algorithm will make all the old HMACs invalid. This means
that when users upgrade, old sessions, signed cookies, and session
authentication hashes will be rejected as invalid and replaced (hence the
need for a backwards-compatibility layer of some sort).
- SHA-256 is slower than SHA-1, though hopefully no Django servers are
bottlenecked on hashing speed.
Thanks Predrag Gruevski (obi1kenobi on Github) for the report.
--
Ticket URL: <https://code.djangoproject.com/ticket/27468>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.a91037b0e27241be521f2820f70ecaf0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.