Implementing encrypted transmission of Web single sign-on password with RSA

Source: Internet
Author: User
Tags asymmetric encryption

When using the single sign-on feature of the Universal Rights Management System (Gizhgara), RSA encryption (asymmetric encryption) is used for the login password, with reference to the use of this rights management system.

Front-end section, please refer to the following JS files:

<script type= "Text/javascript" src= "extjs/jquery.js" ></script><script type= "Text/javascript" src= " Extjs/bigint.js "></script><script type=" Text/javascript "src=" Extjs/rsa.js "></script>< Script type= "Text/javascript" src= "Extjs/barrett.js" ></script>

Download: Http://files.cnblogs.com/hnsongbiao/ExtJS.zip

Login page front-end main code:

Setmaxdigits (129); var key = new Rsakeypair ("<%=strPublicKeyExponent%>", "", "<%=strPublicKeyModulus%>"); var password = document.getElementById ("password"); var pwd = encryptedstring (key, Password.value);


Background main function code:

RSACryptoServiceProvider RSA =NewRSACryptoServiceProvider (); session["Private_key"] = RSA. Toxmlstring (true); RSAParameters parameter= RSA. Exportparameters (true); Strpublickeyexponent=bytestohexstring (parameter. Exponent); Strpublickeymodulus=bytestohexstring (parameter.    modulus); 。。。。。。 Rsa. Fromxmlstring ((string) session["Private_key"]);byte[] results = RSA. Decrypt (hexstringtobytes (password),false); System.Text.ASCIIEncoding Enc=Newasciiencoding ();p assword= Enc. GetString (results);

The following can be seen in the transmission of the password has been RSA Asymmetric encryption (I also have a symmetric encryption here)

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.