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.
You Know we can't decrypt MD5
For Example:
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.
You Know we can't decrypt MD5
For Example:
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