首页 > 代码库 > RSA JS 加密解密DEMO

RSA JS 加密解密DEMO

  <script src="http://www.mamicode.com/Scripts/jquery-1.4.1.js" type="text/javascript"></script>    <script src="http://www.mamicode.com/Scripts/jQuery.md5.js" type="text/javascript" ></script>    <script src="http://www.mamicode.com/Scripts/BigInt.js" type="text/javascript"></script>    <script src="http://www.mamicode.com/Scripts/RSA.js" type="text/javascript"></script>    <script src="http://www.mamicode.com/Scripts/Barrett.js" type="text/javascript"></script>    <script type="text/javascript">        function cmdEncrypt() {            setMaxDigits(129);            var key = new RSAKeyPair("<%=strPublicKeyExponent%>", "", "<%=strPublicKeyModulus%>");            var pwdMD5Twice = $.md5($.md5($("#txtPassword").attr("value")));            var pwdRtn = encryptedString(key, pwdMD5Twice);            $("#encrypted_pwd").attr("value", pwdRtn);            $("#formLogin").submit();            return;        }    </script>

类库JS:

http://www.ohdave.com/rsa/

 

其他参考:

http://yajiao.iteye.com/blog/1772680

http://www.cnblogs.com/guogangj/archive/2012/03/05/2381117.html

RSA JS 加密解密DEMO