码迷,mamicode.com
首页 > Web开发 > 详细

RSA JS 加密解密DEMO

时间:2014-12-05 12:07:23      阅读:277      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   io   ar   color   sp   for   java   

  <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

RSA JS 加密解密DEMO

标签:style   blog   http   io   ar   color   sp   for   java   

原文地址:http://www.cnblogs.com/dannywang/p/4146157.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!