Password Encryption Using ASP.Net

Password Encryption can be used for encrypting password. Here in this article I am going to explain how you can create the hashed passwords. This method can be used for storing passwords in the credentials section of a database or inside an XML file.

Some of commonly used Hash Encryption Algorithms are ‘MD5‘ and ‘SHA-1

SHA-1 (Secure Hash Algorithm 1) is slower than MD5 but the message digest is larger, which makes it more resistant to brute force attacks. Therefore, it is recommended that Secure Hash Algorithm is preferred to MD5 for all of your digest needs.

Creating Hashed Passwords Using “SHA-1” (Secure Hash Algoritham)

  • Source Code “VB.NET”

    Dim strEncryptPassword As String
    strEncryptPassword = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text, “sha1”)

  • Source Code “C#”

    string strEncryptPassword;
    strEncryptPassword = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text, “sha1”);

+CMS Content Management System

+CMS is a web content management system for small and medium sized websites. +CMS enables your web enterprise and legacy data through powerful application and database connectors, Web services, and XML feeds.

For more information please visit us