mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-10-24 04:09:07 +03:00
781 B
781 B
Random Number Generation
A cryptographically secure pseudo-random number generator (CSPRNG) is a pseudo-random number generator (PRNG) with properties that make it suitable for use in cryptography.
Using the standard random module APIs for cryptographic keys or initialization vectors can result in major security issues depending on the algorithms in use.
wolfcrypt provides the following CSPRNG
implementation:
wolfcrypt.random
Random
Example
>>> from wolfcrypt.random import Random >>> >>> r = Random() >>> b = r.byte() >>> b # doctest: +SKIP b'x8c' >>> b16 = r.bytes(16) >>> b16 # doctest: +SKIP b']x93nkx95xbc@xffXxabxdcBxdax11xf7x03'