summaryrefslogtreecommitdiffstats
path: root/Doc/library/random.rst
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-05-24 19:32:40 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-05-24 19:32:40 (GMT)
commit19fb53c1195653e87b9197211015c624960c7b95 (patch)
tree1824b8ebfd999edff2278672b25789b9b1a5b4c1 /Doc/library/random.rst
parentabf22b405fb15835ac9e1a732dee624c1a6c805a (diff)
downloadcpython-19fb53c1195653e87b9197211015c624960c7b95.zip
cpython-19fb53c1195653e87b9197211015c624960c7b95.tar.gz
cpython-19fb53c1195653e87b9197211015c624960c7b95.tar.bz2
Issue #12049: improve RAND_bytes() and RAND_pseudo_bytes() documentation
Add also a security warning in the module random pointing to ssl.RAND_bytes().
Diffstat (limited to 'Doc/library/random.rst')
-rw-r--r--Doc/library/random.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/library/random.rst b/Doc/library/random.rst
index f0c4add..52419a1 100644
--- a/Doc/library/random.rst
+++ b/Doc/library/random.rst
@@ -43,6 +43,12 @@ The :mod:`random` module also provides the :class:`SystemRandom` class which
uses the system function :func:`os.urandom` to generate random numbers
from sources provided by the operating system.
+.. warning::
+
+ The generators of the :mod:`random` module should not be used for security
+ purposes, they are not cryptographic. Use :func:`ssl.RAND_bytes` if you
+ require a cryptographically secure pseudorandom number generator.
+
Bookkeeping functions: