diff options
author | Alex Stapleton <alexs@prol.etari.at> | 2014-12-19 10:48:12 +0000 |
---|---|---|
committer | Alex Stapleton <alexs@prol.etari.at> | 2014-12-19 10:48:12 +0000 |
commit | 850dab4fb7d619e19f12953b9f4952e09e91cb16 (patch) | |
tree | 70bb7d1b934131127303a0fd59d1351dccb1a8cc /docs/random-numbers.rst | |
parent | c8c3331afdff6cc9558843a60a82f1858825ace1 (diff) | |
parent | ae7dfce5a383c6f3cb79f49ad728e9b642d6aaa7 (diff) | |
download | cryptography-850dab4fb7d619e19f12953b9f4952e09e91cb16.tar.gz cryptography-850dab4fb7d619e19f12953b9f4952e09e91cb16.tar.bz2 cryptography-850dab4fb7d619e19f12953b9f4952e09e91cb16.zip |
Merge pull request #1558 from alex/full-details2
Let people who are curious know how os.urandom is implemented
Diffstat (limited to 'docs/random-numbers.rst')
-rw-r--r-- | docs/random-numbers.rst | 9 |
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/ |