O'Reilly logo

.NET Framework Security by Kevin T. Price, Rudi Martin, Matthew Lyons, Sebastian Lange, Brian A. LaMacchia

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Random Number Generation and Key Derivation

In all of the examples so far in this chapter, when a secret key was necessary, it has been specified as an input parameter to the method. This is all well and good in the abstract, but somewhere in your program you will need to generate a good sequence of bytes to use as a random key for an encryption or keyed hash algorithm. How one generates good values to use as secret key material is the subject of this section. We now discuss two smaller portions of the cryptographic object hierarchy that are still extremely important to writing crypto-aware applications—random number generators and secret key derivation classes.

Generating Pseudo-Random Numbers

The ability to generate a random number, or a random ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required