Issue 27249: Add os.urandom_info - Python tracker (original) (raw)
Issue27249
This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
This issue has been migrated to GitHub: https://github.com/python/cpython/issues/71436
classification
Title: | Add os.urandom_info | |
---|---|---|
Type: | Stage: | |
Components: | Versions: | Python 3.6 |
process
Status: | closed | Resolution: | postponed |
---|---|---|---|
Dependencies: | Superseder: | Always use getrandom() in os.random() on Linux and add block=False parameter to os.urandom() View:27266 | |
Assigned To: | Nosy List: | alex, christian.heimes, vstinner | |
Priority: | normal | Keywords: |
Created on 2016-06-07 12:06 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.
Messages (3) | ||
---|---|---|
msg267641 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2016-06-07 12:06 |
It seems like in some cases, you do need to know how os.urandom() generates random numbers. On Linux, using getrandom() to read /dev/urandom in blocking mode or reading from /dev/urandom give a different level of security if the urandom entropy pool is not feeded with enough entropy yet. See the issue #26839 for the background. | ||
msg267659 - (view) | Author: Christian Heimes (christian.heimes) * ![]() |
Date: 2016-06-07 12:46 |
+1 How are you planning to handle initialization? Run getentropy() and check if the syscall succeeds? | ||
msg267918 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2016-06-08 22:33 |
The current trend in the random discussion (see https://haypo-notes.readthedocs.io/pep_random.html and the issue #26839) is more to use weak entropy to start Python (hash seed and random constructor) and os.urandom() blocks until the kernel collected enough entropy. In this case, such information is no more needed. So I close this issue, superseded by the issue #27266. |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:58:32 | admin | set | github: 71436 |
2016-06-08 22:33:02 | vstinner | set | status: open -> closedsuperseder: Always use getrandom() in os.random() on Linux and add block=False parameter to os.urandom()resolution: postponedmessages: + |
2016-06-07 12:46:04 | christian.heimes | set | nosy: + christian.heimesmessages: + |
2016-06-07 12:22:51 | alex | set | nosy: + alex |
2016-06-07 12:06:14 | vstinner | create |