mirror of
https://github.com/saymrwulf/cryptography.git
synced 2026-05-14 20:37:55 +00:00
Merge pull request #691 from alex/cite-random
Cite Thomas Ptacek for urandom
This commit is contained in:
commit
8bae14b62b
1 changed files with 4 additions and 2 deletions
|
|
@ -8,8 +8,8 @@ want to use the standard :mod:`random` module APIs. This is because they do not
|
|||
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
|
||||
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:
|
||||
|
||||
|
|
@ -18,3 +18,5 @@ can obtain them with:
|
|||
>>> import os
|
||||
>>> os.urandom(16)
|
||||
'...'
|
||||
|
||||
.. _`always use your operating system's provided random number generator`: http://sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers/
|
||||
|
|
|
|||
Loading…
Reference in a new issue