. NET password plaintext Transfer encryption delivery method

Source: Internet
Author: User
Tags md5 encryption

Unencrypted delivery is the case

HTML tag encryption using Jquery.md5.js's own website download

HTML code

"Server"><meta http-equiv="Content-type"Content="text/html; Charset=utf-8"/> <title></title> <script src="Scripts/jquery-1.10.2.min.js"></script> <script src="Scripts/jquery.md5.js"></script> <script>$ (function () {$ ("#Button1"). Click (function () {$ ("#TextBox2"). Val ($.md5 ($ ('#TextBox2'). Val ()));        }); })    </script>"Form1"runat="Server"> <div> <asp:textbox id="TextBox1"runat="Server"></asp:TextBox> <asp:textbox id="TextBox2"runat="Server"Textmode="Password"></asp:TextBox> <asp:button id="Button1"runat="Server"text="Button"onclick="Button1_Click"/> </div> </form></body>

Next run the code, the password part is encrypted. The next step is background processing.

Background MD5 encryption method

      stringDP = Encrypt.md5encrypt ("123",Newutf8encoding ()); /// <summary>        ///MD5 Encryption/// </summary>        /// <param name= "Input" >strings that need to be encrypted</param>        /// <param name= "encode" >Encoding of characters</param>        /// <returns></returns>         Public Static stringMd5encrypt (stringinput, Encoding encode) {MD5 MD5=NewMD5CryptoServiceProvider (); byte[] t =Md5.computehash (encode.            GetBytes (input)); StringBuilder SB=NewStringBuilder ( +);  for(inti =0; i < t.length; i++) sb. Append (T[i]. ToString ("x"). PadLeft (2,'0')); returnsb.        ToString (); }

Matches a string after two encryption.

. NET password plaintext transfer encryption delivery method

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.