• [$] Python's two modules for random numbers

    From LWN.net@1337:1/100 to All on Tue Oct 6 16:15:05 2026
    [$] Python's two modules for random numbers

    Date:
    Tue, 06 Oct 2026 15:02:09 +0000

    Description:
    Python's random and secrets modules 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 . The random module is still misused at times, so it is instructive
    to look into how the random-number modules should be used.

    ======================================================================
    Link to news story:
    https://lwn.net/Articles/1097468/


    --- Mystic BBS v1.12 A49 (Linux/64)
    * Origin: tqwNet UK HUB @ hub.uk.erb.pw (1337:1/100)