#27635: django.utils.crypto should use secrets on Python 3.6+
-------------------------------------+-------------------------------------
     Reporter:  Adam Chainz          |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  Utilities            |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Someday/Maybe
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Emett Speer):

 Replying to [comment:3 Tim Graham]:
 > Python's `secrets.py` does `from random import SystemRandom` so this
 doesn't change any behavior or add security for now. Adam said,
 "Presumably the intention is that secrets might one day use a different
 PRNG's on some OS's." Let's make the change if the benefits become more
 than theoretical or when only Python 3.6+ is supported.
 >
 > Another possibility Aymeric mentioned, "In the long run I think we
 should deprecate get_random_string in favor of similar functions provided
 by the secrets module. I didn't check whether there was a sensible
 transition plan to make use of secrets on Python 3.6 while still
 supporting older versions."

 I'm with you on this. The vast majority of people are not going to use
 this for a long time and it will add an extra bit of overhead just to
 support an update in a single version of Python none of the big distros
 ship. Once more of the Django community has migrated to Python3.6+ it
 would be worth looking into.

--
Ticket URL: <https://code.djangoproject.com/ticket/27635#comment:4>
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/068.55ed8bd43e516849876df5378cba223a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to