Article 78W3K [$] Python's two modules for random numbers

[$] Python's two modules for random numbers

by
jake
from LWN.net on (#78W3K)
Python's randomand secretsmodules both include utilities for obtaining random values, but only one of them is suitable for generating passwords and security tokens.For much of Python's history, random was used for passwords and tokens anyway, despite documentation that called it unsuitable for cryptography.In 2015, Python's core team debated whether to fix that misuse by making random secure by default.Instead, in 2016, Python 3.6 added a second module: secrets. Therandom module is still misused at times, so it is instructiveto look into how the random-number modules should be used.
External Content
Source RSS or Atom Feed
Feed Location http://lwn.net/headlines/rss
Feed Title LWN.net
Feed Link https://lwn.net/
Reply 0 comments