[issue44611] CPython uses deprecated randomness API

Dan Stromberg report at bugs.python.org
Mon Jul 12 13:16:33 EDT 2021


New submission from Dan Stromberg <strombrg at gmail.com>:

CPython 3.9 uses CryptGenRandom(), which has been deprecated by Microsoft.

I'm told the randomness produced by CryptGenRandom() is fine, but Microsoft has introduced a newer API for getting randomness.

For these reasons, Python/bootstrap_hash.c should be updated to use https://docs.microsoft.com/en-us/windows/win32/seccng/cng-por , but it is not urgent, and is not needed in older versions of CPython.

Also the documentation that references CryptGenRandom() should be updated, EG: https://docs.python.org/3/library/os.html#os.urandom

----------
components: Windows
messages: 397339
nosy: paul.moore, steve.dower, strombrg, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: CPython uses deprecated randomness API
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44611>
_______________________________________


More information about the Python-bugs-list mailing list