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)