ASP.NET - Encryption using Forms Authentication



Encrypting passwords using the algorithms SHA1/MD5

//name space to import for HashPasswordForStoringInConfigFile class
using System.Web.Security  

Encryption using the algorithm SHA1

//stringtoEncrypt can be ,value from password text box control that is used for encryption
FormsAuthentication.HashPasswordForStoringInConfigFile(“stringtoEncrypt”, “SHA1”) ;

Encryption using the algorithm MD5

//string to encrypt can be the parameter you are using for  password 
FormsAuthentication.HashPasswordForStoringInConfigFile(“stringtoEncrypt”, “MD5”) ;

Share |

 Cant find the page you are looking for?
 Help us to improve by adding the content that you are looking for.
 Leave a feedback
 We look forward to hear your comments and feedback.