Linux server.nvwebsoft.co.in 3.10.0-1160.114.2.el7.x86_64 #1 SMP Wed Mar 20 15:54:52 UTC 2024 x86_64
Apache
: 162.240.12.249 | : 3.133.147.193
202 Domain
8.1.31
nbspublicschool
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
python2-cryptography-1.7.2 /
docs /
[ HOME SHELL ]
Name
Size
Permission
Action
_static
[ DIR ]
drwxr-xr-x
development
[ DIR ]
drwxr-xr-x
hazmat
[ DIR ]
drwxr-xr-x
x509
[ DIR ]
drwxr-xr-x
Makefile
5.46
KB
-rw-r--r--
api-stability.rst
1.63
KB
-rw-r--r--
changelog.rst
30
B
-rw-r--r--
community.rst
609
B
-rw-r--r--
conf.py
5.55
KB
-rw-r--r--
cryptography-docs.py
1.72
KB
-rw-r--r--
doing-a-release.rst
3.07
KB
-rw-r--r--
exceptions.rst
853
B
-rw-r--r--
faq.rst
3.51
KB
-rw-r--r--
fernet.rst
6.44
KB
-rw-r--r--
glossary.rst
3.09
KB
-rw-r--r--
index.rst
2.93
KB
-rw-r--r--
installation.rst
9.41
KB
-rw-r--r--
limitations.rst
949
B
-rw-r--r--
make.bat
4.99
KB
-rw-r--r--
random-numbers.rst
1.27
KB
-rw-r--r--
security.rst
4.76
KB
-rw-r--r--
spelling_wordlist.txt
883
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : random-numbers.rst
Random number generation ======================== When generating random data for use in cryptographic operations, such as an initialization vector for encryption in :class:`~cryptography.hazmat.primitives.ciphers.modes.CBC` mode, you do not 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 :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. If you need your random number as an integer (for example, for :meth:`~cryptography.x509.CertificateBuilder.serial_number`), you can use ``int.from_bytes`` to convert the result of ``os.urandom``: .. code-block:: pycon >>> serial = int.from_bytes(os.urandom(20), byteorder="big") .. _`always use your operating system's provided random number generator`: https://sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers/
Close