aboutsummaryrefslogtreecommitdiffstats
path: root/docs/random-numbers.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/random-numbers.rst')
-rw-r--r--docs/random-numbers.rst9
1 files changed, 6 insertions, 3 deletions
diff --git a/docs/random-numbers.rst b/docs/random-numbers.rst
index 68a72cf7..8b119a3e 100644
--- a/docs/random-numbers.rst
+++ b/docs/random-numbers.rst
@@ -9,13 +9,16 @@ provide a cryptographically secure random number generator, which can result in
major security issues depending on the algorithms in use.
Therefore, it is our recommendation to `always use your operating system's
-provided random number generator`_, which is available as ``os.urandom()``. For
-example, if you need 16 bytes of random data for an initialization vector, you
-can obtain them with:
+provided random number generator`_, which is available as :func:`os.urandom`.
+For example, if you need 16 bytes of random data for an initialization vector,
+you can obtain them with:
.. doctest::
>>> import os
>>> iv = os.urandom(16)
+This will use ``/dev/urandom`` on UNIX platforms, and ``CryptGenRandom`` on
+Windows.
+
.. _`always use your operating system's provided random number generator`: http://sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers/