Monday, 20 August 2012

Hashing algorithms in .Net Framework

Hashing algorithms are one way cryptographic functions that accept plain text of any length and generate a numeric value. These are one-way because it’s almost impossible to get the original plain text from the hash code. Hashing algorithms are useful for encrypt the password.

Use the same hashing algorithm to a specific text always generates the same hash code. This makes hash codes useful for check if two blocks of plain text are the same.
Generating hash codes in the .NET Framework is possbile.

The abstract class "HashAlgorithm" provides a base from which all hashing algorithm implementations.
The .NET Framework has the seven hashing algorithm implementations.
This class is in the System.Security.Cryptography namespace.

Here is list of Algorithms. 

Algorithm Name Class Name Hash Code Size (in Bits)
MD5 MD5CryptoServiceProvider 128
RIPEMD160 or RIPEMD-160    RIPEMD160Managed 160
SHA or SHA1 SHA1CryptoServiceProvider   160
SHA1Managed SHA1Managed 160
SHA256 or SHA-256 SHA256Managed 256
SHA384 or SHA-384 SHA384Managed 384
SHA512 or SHA-512 SHA512Managed 512

Visit this link for C# Examples and VB.net Example on Hashing Algorithm Implementation. Click Here...

Note : Give Us your valuable feedback in comments. Give your suggestions in this article so we can update our articles accordingly that.

No comments:

Post a comment