Mark B. – tech

Hashed Password Encryption

here is a simple function to create hashed password in .net :

public static string ParsePassword(string password)
{
byte[] dataHash = (new UnicodeEncoding()).GetBytes(password);
byte[] hashValue = ((HashAlgorithm)CryptoConfig.CreateFromName("SHA1")).ComputeHash(dataHash);

StringBuilder sb = new StringBuilder(BitConverter.ToString(hashValue));
sb.Replace("-", "");
return sb.ToString();
}

*note : add this reference before using this function
using System.Security.Cryptography;

Advertisements
This entry was published on April 28, 2011 at 2:59 am and is filed under IT - Tutorial. Bookmark the permalink. Follow any comments here with the RSS feed for this post.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: