RSA JS 加密解密DEMO

  <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="Scripts/jQuery.md5.js" type="text/javascript" ></script>
    <script src="Scripts/BigInt.js" type="text/javascript"></script>
    <script src="Scripts/RSA.js" type="text/javascript"></script>
    <script src="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

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。