MD5 encryption in ASP. NET and ASP Encryption

Source: Internet
Author: User

1 ASP. NET ------> Asp

Formsauthentication. hashpasswordforstoringinconfigfile (password. Text, "MD5 ")

Result:
12c403b91165d25d8cd021d5f9b5bb7f

The strings encrypted by MD5 in ASP are as follows:
1165d25d8cd021d5
The string obtained from Asp.net is 9-25 characters long and lowercase. The encrypted result in ASP is obtained.

2 ASP --------> ASP. NET
If you want to use ASP Web pages first, but change the encryption result to a string such as ASP. NET 12c403b91165d25d8cd021d5f9b5bb7f, it will be convenient to use ASP. NET later. You can verify the encryption used during login.

<! -- # Include file = "../INC/md5.asp" -->
<! -- # Include file = "../INC/md5_net.asp" -->

<%
Pwd = Replace (TRIM (Request ("password ")),"'","")
Pwd_net = Replace (TRIM (Request ("password ")),"'","")
Pwd = MD5 (PWD)
Pwd_net = md5_net (pwd_net)

... Rs. open ()
If RS ("password") = PWD or RS ("password") = pwd_net then

RS ("password") = pwd_net

End if
.....

%>

In this way, if the user logs on, the 16-bit password will be automatically converted to ASP. NET.

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.