28.2. Techniques

Cryptographic techniques fall into four broad categories. In each of these categories, a number of algorithms are implemented in the .NET Framework via an inherited provider model. For each category there is typically an abstract class that provides common functionality. The specific providers implement the details of the algorithm.

28.2.1. Hashing

To achieve the goal of data integrity, a hashing algorithm can be applied to the data being transferred. This will generate a byte sequence that has a fixed length, referred to as the hash value. To ensure data integrity the hash value has to be unique, and the algorithm should always produce the same hash value for a specific piece of data.

For example, if a piece of information is being sent from Julie to David, you can check the integrity of the information by comparing the hash value generated by Julie, from the original information, with the hash value generated by David, from the information he received. If the hash values match, the goal of data integrity has been achieved. Because the hash value cannot be converted back into the original information, both the information and the hash value have to be sent. This is clearly a risk, as the information can easily be read. In addition, the information cannot be guaranteed to come from Julie, because someone else could have used the same hashing algorithm before sending information to David.

The following hashing algorithms have been implemented in the .NET Framework: ...

Get Professional Visual Studio® 2008 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.