![]() You can use OS_GenerateRandomBlock to gather entropy using whatever the underlying operating system provides. ![]() Both generators use OS_GenerateRandomBlock to gather seed material, so neither generator suffered the DUHK attacks. In the former FIPS DLL builds the library used AutoSeededX917RNG as the typedef. In the non-FIPS DLL builds DefaultAutoSeededRNG is AutoSeededRandomPool. The library provides a typedef for DefaultAutoSeededRNG. You should reseed the generator after a fork() to avoid multiple generators with the same internal state. Additionally, see WORKAROUND_MS_BUG_Q258000. Wei Dai recommends using a generator on a per thread basis. If you are using a generator in a multithreaded program, then use a single generator per thread or provide an external lock for a single generator. Using the peer's entropy before extracting your random bits will help mitigate some classes of attacks, like Virtual Machine playback attacks. Entropy can include anything specific to the use, including any entropy a peer offers like a nonce used during key exchange. In addition to automatice seeds, you should seed the generator with any entropy you can get your hands on, even less than perfect ones. On Linux, OS_GenerateRandomBlock uses /dev/random ( blocking=true) or /dev/urandom ( blocking=false) on Windows, it uses CryptGenRandom, and on the BSDs, it uses /dev/srandom ( blocking=true) or /dev/urandom ( blocking=false). Entropy is retrieved using Crypto++'s OS_GenerateRandomBlock. AutoSeeded* generators automatically seed the generator using the underlying OS's entropy pools. In general, use an auto-seeded generator like AutoSeededRandomPool. It is OK to use a RandomNumberGenerator pointer or reference since polymorphism will ensure the derived object's implementation is used. Trying to generate random numbers with RandomNumberGenerator will result in infinite stack recursion. ![]() RandomNumberGenerator is intended to set up the interface, and you should not instantiate one. Some of the generators are cryptographically secure, while others are not. ![]() The library abstracts them with the RandomNumberGenerator base class and its derivatives. They are used frequently, from generating asymmetric and symmetric keys, to initialization vectors, salts and nonces. Random numbers are a primitive for cryptographic operations. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |