Seeding the Random Number Generator
Random numbers are critical to the functioning of the SSL/TLS protocol. A random number is used as a key for the symmetric cipher, which is used to encrypt the application’s data.
Truly random numbers are hard to generate, so pseudo-random numbers are used instead. Pseudo-random numbers are obtained from a pseudo-random number generator (PRNG), which is supplied by the cryptographic library. PRNGs need one starting value, called the seed, in order to generate pseudo-random numbers. Setting this initial value in the PRNG is known as seeding the PRNG.
Explicitly seeding the pseudo-random number generator is not necess ary for OpenSSL on Linux or any platform that has a /dev/urandom device —The random seed is read from that device automatically.
The PRNG can be seeded from a file, directly from memory, or, if you are using Microsoft Windows, from the pixels on the screen.
NOTE: The more unpredictable the seed, the better. If someone guesses the seed, they can put it into the PRNG and generate the same pseudo-random numbers that you did, which foils any security that you have. See RFC 1750 (available at: www.ietf.org) for information about seeding random number generators.
If the macro RW_SECSOCK_RNG_NEEDS_SEEDING is defined, you must seed the PRNG using either the constructors or static functions in RWSecureSocketPackageInit. If your application fails to seed the PRNG when it is needed, an exception is thrown. See the SourcePro API Reference Guide for more information.