Wednesday, November 2, 2011

How To use MD5 in asp.Net.

Introduction

Its quite simple to use MD5 in asp.Net.its a one type of Encryption Method.It is basically used for high security.because it is not possible to decrypt the encrypted string using MD5.MD5 is a one way function thats why it is impossible to decrypt it.

For Example..

This is .aspx code


Just click on image to see it well.



Now in aspx.cs page code....
Add namespace using System.Web.Security;

protected void btnEncrypt_Click(object sender, EventArgs e)
{
lblEncryptAns.Text = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text,"MD5");

}

Now see the text of
lblEncryptAns and Encrypt again with the Output Result.Then You will get the Original string it will show you the different string.

0 comments:

Post a Comment