April 2008
Intermediate to advanced
704 pages
17h 49m
English
Problem
You need to create a random number that is suitable for use in cryptographic and security applications.
Solution
Use a cryptographic random number generator, derived from System.Security.Cryptography.RandomNumberGenerator such as the System.Security.Cryptography.RNGCryptoServiceProvider class.
How It Works
The System.Random class is a pseudo-random number generator that uses a mathematical algorithm to simulate the generation of random numbers. In fact, the algorithm it uses is deterministic, meaning that you can always calculate what the next number will be based on the previously generated number. This means that numbers generated by the Random class are unsuitable for use in situations ...
Read now
Unlock full access