ASP. NET user authentication method and encryption processing

Source: Internet
Author: User

I learned ASP. NET yesterday to log on to users. I know there are three methods for user authentication:

  • Windows Verification
  • Form Verification
  • Passport (Windows Live ID) Verification

Of course, form verification is generally applied. For the method of passport (Windows Live ID) Verification, You can Google it and get a more detailed answer.

Form Verification. We can modify the Web. config file implementation as follows:

 1 <authentication mode="Forms">
2 <forms>
3 <credentials passwordFormat="SHA1">
4 <user name="jaychou" password="25B49F3D15E7BB34B208E993E3B3FE62B0FB33E6"/>
5 <user name="choujay" password="choujay"/>
6 </credentials>
7 </forms>
8 </authentication>

In passwordformat of credentials, we can set the encryption mode of the password string. The default mode is not encrypted. Here we can select MD5 or sha1 encryption methods, as shown below, in the user password, you must enter the encrypted string of the original password.

Of course, we usually put users into the database. After we select the encryption method, the encrypted password string is stored in the database, Asp.. Net encrypts the original password entered by the user and compares it with the password stored in the database to verify the validity of the user.

If you need to manually enter the encrypted string, you need an MD5/HASH encryption tool (right-click and save it as) to convert the original password into the encrypted text.

The specific method is as follows: MD5 and hash encryption in. NET and ciphertext output (C #)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.