http://www.sufeinet.com/plugin.php?id=keke_group

苏飞论坛

 找回密码
 马上注册

QQ登录

只需一步,快速开始

分布式系统框架(V2.0) 轻松承载百亿数据,千万流量!讨论专区 - 源码下载 - 官方教程

HttpHelper爬虫框架(V2.7-含.netcore) HttpHelper官方出品,爬虫框架讨论区 - 源码下载 - 在线测试和代码生成

HttpHelper爬虫类(V2.0) 开源的爬虫类,支持多种模式和属性 源码 - 代码生成器 - 讨论区 - 教程- 例子

查看: 3813|回复: 2

[求助] 麻烦大神帮忙看看,如何改造一下这个js,才能在框架里调用。

[复制链接]
发表于 2015-2-2 00:42:38 | 显示全部楼层 |阅读模式
本帖最后由 howzew 于 2015-2-2 07:38 编辑

我想使用苏飞大神的《根据传入的JS方法名和参数执行JavaScript》
发现我这个js不能直接调用
需要改造一下
麻烦哪位大神帮忙看看
如何改造一下才能让我直接调用里面的GetPW()方法
感谢!
[JavaScript] 纯文本查看 复制代码
var sinaSSOEncoder = sinaSSOEncoder || {}; (function() {
        var a = 0,
        b = 8;
        this.hex_sha1 = function(a) {
            return i(c(h(a), a.length * b))
        };
        var c = function(a, b) {
            a[b >> 5] |= 128 << 24 - b % 32;
            a[(b + 64 >> 9 << 4) + 15] = b;
            var c = Array(80),
            h = 1732584193,
            i = -271733879,
            j = -1732584194,
            k = 271733878,
            l = -1009589776;
            for (var m = 0; m < a.length; m += 16) {
                var n = h,
                o = i,
                p = j,
                q = k,
                r = l;
                for (var s = 0; s < 80; s++) {
                    s < 16 ? c[s] = a[m + s] : c[s] = g(c[s - 3] ^ c[s - 8] ^ c[s - 14] ^ c[s - 16], 1);
                    var t = f(f(g(h, 5), d(s, i, j, k)), f(f(l, c[s]), e(s)));
                    l = k;
                    k = j;
                    j = g(i, 30);
                    i = h;
                    h = t
                }
                h = f(h, n);
                i = f(i, o);
                j = f(j, p);
                k = f(k, q);
                l = f(l, r)
            }
            return [h, i, j, k, l]
        },
        d = function(a, b, c, d) {
            return a < 20 ? b & c | ~b & d: a < 40 ? b ^ c ^ d: a < 60 ? b & c | b & d | c & d: b ^ c ^ d
        },
        e = function(a) {
            return a < 20 ? 1518500249 : a < 40 ? 1859775393 : a < 60 ? -1894007588 : -899497514
        },
        f = function(a, b) {
            var c = (a & 65535) + (b & 65535),
            d = (a >> 16) + (b >> 16) + (c >> 16);
            return d << 16 | c & 65535
        },
        g = function(a, b) {
            return a << b | a >>> 32 - b
        },
        h = function(a) {
            var c = [],
            d = (1 << b) - 1;
            for (var e = 0; e < a.length * b; e += b) c[e >> 5] |= (a.charCodeAt(e / b) & d) << 24 - e % 32;
            return c
        },
        i = function(b) {
            var c = a ? "0123456789ABCDEF": "0123456789abcdef",
            d = "";
            for (var e = 0; e < b.length * 4; e++) d += c.charAt(b[e >> 2] >> (3 - e % 4) * 8 + 4 & 15) + c.charAt(b[e >> 2] >> (3 - e % 4) * 8 & 15);
            return d
        },
        j = function(a) {
            var b = "",
            c = 0;
            for (; c < a.length; c++) b += "%" + k(a[c]);
            return decodeURIComponent(b)
        },
        k = function(a) {
            var b = "0" + a.toString(16);
            return b.length <= 2 ? b: b.substr(1)
        };
        this.base64 = {
            encode: function(a) {
                a = "" + a;
                if (a == "") return "";
                var b = "",
                c, d, e = "",
                f, g, h, i = "",
                j = 0;
                do {
                    c = a.charCodeAt(j++);
                    d = a.charCodeAt(j++);
                    e = a.charCodeAt(j++);
                    f = c >> 2;
                    g = (c & 3) << 4 | d >> 4;
                    h = (d & 15) << 2 | e >> 6;
                    i = e & 63;
                    isNaN(d) ? h = i = 64 : isNaN(e) && (i = 64);
                    b = b + this._keys.charAt(f) + this._keys.charAt(g) + this._keys.charAt(h) + this._keys.charAt(i);
                    c = d = e = "";
                    f = g = h = i = ""
                } while ( j < a . length );
                return b
            },
            decode: function(a, b, c) {
                var d = function(a, b) {
                    for (var c = 0; c < a.length; c++) if (a[c] === b) return c;
                    return - 1
                };
                typeof a == "string" && (a = a.split(""));
                var e = [],
                f,
                g,
                h = "",
                i,
                j,
                k,
                l = "";
                a.length % 4 == 0;
                var m = /[^A-Za-z0-9+\/=]/,
                n = this._keys.split("");
                if (b == "urlsafe") {
                    m = /[^A-Za-z0-9-_=]/;
                    n = this._keys_urlsafe.split("")
                }
                if (b == "subp_v2") {
                    m = /[^A-Za-z0-9_=-]/;
                    n = this._subp_v2_keys.split("")
                }
                if (b == "subp_v3_3") {
                    m = /[^A-Za-z0-9-_.-]/;
                    n = this._subp_v3_keys_3.split("")
                }
                var o = 0;
                if (b == "binnary") {
                    n = [];
                    for (o = 0; o <= 64; o++) n[o] = o + 128
                }
                if (b != "binnary" && m.test(a.join(""))) return c == "array" ? [] : "";
                o = 0;
                do {
                    i = d(n, a[o++]);
                    j = d(n, a[o++]);
                    k = d(n, a[o++]);
                    l = d(n, a[o++]);
                    f = i << 2 | j >> 4;
                    g = (j & 15) << 4 | k >> 2;
                    h = (k & 3) << 6 | l;
                    e.push(f);
                    k != 64 && k != -1 && e.push(g);
                    l != 64 && l != -1 && e.push(h);
                    f = g = h = "";
                    i = j = k = l = ""
                } while ( o < a . length );
                if (c == "array") return e;
                var p = "",
                q = 0;
                for (; q < e.lenth; q++) p += String.fromCharCode(e[q]);
                return p
            },
            _keys: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
            _keys_urlsafe: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",
            _subp_v2_keys: "uAL715W8e3jJCcNU0lT_FSXVgxpbEDdQ4vKaIOH2GBPtfzqsmYZo-wRM9i6hynrk=",
            _subp_v3_keys_3: "5WFh28sGziZTeS1lBxCK-HgPq9IdMUwknybo.LJrQD3uj_Va7pE0XfcNR4AOYvm6t"
        };
        this.Cookie = {
            decode: function(a) {
                var b = [],
                c = a.substr(0, 3),
                d = a.substr(3);
                switch (c) {
                case "v01":
                    for (var e = 0; e < d.length; e += 2) b.push(parseInt(d.substr(e, 2), 16));
                    return decodeURIComponent(j(sinaSSOEncoder.base64.decode(b, "binnary", "array")));
                case "v02":
                    d = d.replace(/\./g, "=");
                    b = sinaSSOEncoder.base64.decode(d, "urlsafe", "array");
                    return j(sinaSSOEncoder.base64.decode(b, "binnary", "array"));
                default:
                    return decodeURIComponent(a)
                }
            }
        };
        this.getSUBPCookie = {
            __parse: function(a) {
                var b, c, d, e, f, g = 0,
                h, i = {},
                k = "",
                l = "";
                if (!a) return i;
                do {
                    c = a[g];
                    b = ++g;
                    for (h = g; h < c + b; h++, g++) k += String.fromCharCode(a[h]);
                    e = a[g];
                    b = ++g;
                    if (k == "status" || k == "flag") for (h = g; h < e + b; h++, g++) l += a[h];
                    else {
                        l = a.slice(h, e + b);
                        try {
                            l = j(l)
                        } catch(m) {
                            l = ""
                        }
                        g += e
                    }
                    i[k] = l;
                    k = "";
                    l = ""
                } while ( g < a . length );
                return i
            },
            decode: function(a) {
                var b = [],
                c,
                d = a.substr(0, 3),
                e = decodeURIComponent(a.substr(3));
                switch (d) {
                case "002":
                    b = sinaSSOEncoder.base64.decode(e, "subp_v2", "array");
                    return sinaSSOEncoder.getSUBPCookie.__parse(b);
                case "003":
                    c = e.substr(0, 1);
                    b = sinaSSOEncoder.base64.decode(e, "subp_v3_" + c, "array");
                    return sinaSSOEncoder.getSUBPCookie.__parse(b);
                default:
                    return decodeURIComponent(a)
                }
            }
        }
    }).call(sinaSSOEncoder); (function() {
        function bt(a) {
            var b = bp(a, this.n.bitLength() + 7 >> 3);
            if (b == null) return null;
            var c = this.doPublic(b);
            if (c == null) return null;
            var d = c.toString(16);
            return (d.length & 1) == 0 ? d: "0" + d
        }
        function bs(a) {
            return a.modPowInt(this.e, this.n)
        }
        function br(a, b) {
            if (a != null && b != null && a.length > 0 && b.length > 0) {
                this.n = bm(a, 16);
                this.e = parseInt(b, 16)
            } else alert("Invalid RSA public key")
        }
        function bq() {
            this.n = null;
            this.e = 0;
            this.d = null;
            this.p = null;
            this.q = null;
            this.dmp1 = null;
            this.dmq1 = null;
            this.coeff = null
        }
        function bp(a, b) {
            if (b < a.length + 11) {
                alert("Message too long for RSA");
                return null
            }
            var c = [],
            e = a.length - 1;
            while (e >= 0 && b > 0) {
                var f = a.charCodeAt(e--);
                if (f < 128) c[--b] = f;
                else if (f > 127 && f < 2048) {
                    c[--b] = f & 63 | 128;
                    c[--b] = f >> 6 | 192
                } else {
                    c[--b] = f & 63 | 128;
                    c[--b] = f >> 6 & 63 | 128;
                    c[--b] = f >> 12 | 224
                }
            }
            c[--b] = 0;
            var g = new bl,
            h = [];
            while (b > 2) {
                h[0] = 0;
                while (h[0] == 0) g.nextBytes(h);
                c[--b] = h[0]
            }
            c[--b] = 2;
            c[--b] = 0;
            return new d(c)
        }
        function bo(a) {
            return a < 16 ? "0" + a.toString(16) : a.toString(16)
        }
        function bn(a, b) {
            var c = "",
            d = 0;
            while (d + b < a.length) {
                c += a.substring(d, d + b) + "\n";
                d += b
            }
            return c + a.substring(d, a.length)
        }
        function bm(a, b) {
            return new d(a, b)
        }
        function bl() {}
        function bk(a) {
            var b;
            for (b = 0; b < a.length; ++b) a[b] = bj()
        }
        function bj() {
            if (bc == null) {
                bg();
                bc = ba();
                bc.init(bd);
                for (be = 0; be < bd.length; ++be) bd[be] = 0;
                be = 0
            }
            return bc.next()
        }
        function bg() {
            bf((new Date).getTime())
        }
        function bf(a) {
            bd[be++] ^= a & 255;
            bd[be++] ^= a >> 8 & 255;
            bd[be++] ^= a >> 16 & 255;
            bd[be++] ^= a >> 24 & 255;
            be >= bb && (be -= bb)
        }
        function ba() {
            return new Z
        }
        function _() {
            var a;
            this.i = this.i + 1 & 255;
            this.j = this.j + this.S[this.i] & 255;
            a = this.S[this.i];
            this.S[this.i] = this.S[this.j];
            this.S[this.j] = a;
            return this.S[a + this.S[this.i] & 255]
        }
        function $(a) {
            var b, c, d;
            for (b = 0; b < 256; ++b) this.S[b] = b;
            c = 0;
            for (b = 0; b < 256; ++b) {
                c = c + this.S[b] + a[b % a.length] & 255;
                d = this.S[b];
                this.S[b] = this.S[c];
                this.S[c] = d
            }
            this.i = 0;
            this.j = 0
        }
        function Z() {
            this.i = 0;
            this.j = 0;
            this.S = []
        }
        function Y(a, b) {
            var c;
            a < 256 || b.isEven() ? c = new J(b) : c = new Q(b);
            return this.exp(a, c)
        }
        function X(a, b) {
            if (a > 4294967295 || a < 1) return d.ONE;
            var c = e(),
            f = e(),
            g = b.convert(this),
            h = y(a) - 1;
            g.copyTo(c);
            while (--h >= 0) {
                b.sqrTo(c, f);
                if ((a & 1 << h) > 0) b.mulTo(f, g, c);
                else {
                    var i = c;
                    c = f;
                    f = i
                }
            }
            return b.revert(c)
        }
        function W() {
            return (this.t > 0 ? this[0] & 1 : this.s) == 0
        }
        function V(a, b, c) {
            a.multiplyTo(b, c);
            this.reduce(c)
        }
        function U(a, b) {
            a.squareTo(b);
            this.reduce(b)
        }
        function T(a) {
            while (a.t <= this.mt2) a[a.t++] = 0;
            for (var b = 0; b < this.m.t; ++b) {
                var c = a[b] & 32767,
                d = c * this.mpl + ((c * this.mph + (a[b] >> 15) * this.mpl & this.um) << 15) & a.DM;
                c = b + this.m.t;
                a[c] += this.m.am(0, d, a, b, 0, this.m.t);
                while (a[c] >= a.DV) {
                    a[c] -= a.DV;
                    a[++c]++
                }
            }
            a.clamp();
            a.drShiftTo(this.m.t, a);
            a.compareTo(this.m) >= 0 && a.subTo(this.m, a)
        }
        function S(a) {
            var b = e();
            a.copyTo(b);
            this.reduce(b);
            return b
        }
        function R(a) {
            var b = e();
            a.abs().dlShiftTo(this.m.t, b);
            b.divRemTo(this.m, null, b);
            a.s < 0 && b.compareTo(d.ZERO) > 0 && this.m.subTo(b, b);
            return b
        }
        function Q(a) {
            this.m = a;
            this.mp = a.invDigit();
            this.mpl = this.mp & 32767;
            this.mph = this.mp >> 15;
            this.um = (1 << a.DB - 15) - 1;
            this.mt2 = 2 * a.t
        }
        function P() {
            if (this.t < 1) return 0;
            var a = this[0];
            if ((a & 1) == 0) return 0;
            var b = a & 3;
            b = b * (2 - (a & 15) * b) & 15;
            b = b * (2 - (a & 255) * b) & 255;
            b = b * (2 - ((a & 65535) * b & 65535)) & 65535;
            b = b * (2 - a * b % this.DV) % this.DV;
            return b > 0 ? this.DV - b: -b
        }
        function O(a, b) {
            a.squareTo(b);
            this.reduce(b)
        }
        function N(a, b, c) {
            a.multiplyTo(b, c);
            this.reduce(c)
        }
        function M(a) {
            a.divRemTo(this.m, null, a)
        }
        function L(a) {
            return a
        }
        function K(a) {
            return a.s < 0 || a.compareTo(this.m) >= 0 ? a.mod(this.m) : a
        }
        function J(a) {
            this.m = a
        }
        function I(a) {
            var b = e();
            this.abs().divRemTo(a, null, b);
            this.s < 0 && b.compareTo(d.ZERO) > 0 && a.subTo(b, b);
            return b
        }
        function H(a, b, c) {
            var f = a.abs();
            if (! (f.t <= 0)) {
                var g = this.abs();
                if (g.t < f.t) {
                    b != null && b.fromInt(0);
                    c != null && this.copyTo(c);
                    return
                }
                c == null && (c = e());
                var h = e(),
                i = this.s,
                j = a.s,
                k = this.DB - y(f[f.t - 1]);
                if (k > 0) {
                    f.lShiftTo(k, h);
                    g.lShiftTo(k, c)
                } else {
                    f.copyTo(h);
                    g.copyTo(c)
                }
                var l = h.t,
                m = h[l - 1];
                if (m == 0) return;
                var n = m * (1 << this.F1) + (l > 1 ? h[l - 2] >> this.F2: 0),
                o = this.FV / n,
                p = (1 << this.F1) / n,
                q = 1 << this.F2,
                r = c.t,
                s = r - l,
                t = b == null ? e() : b;
                h.dlShiftTo(s, t);
                if (c.compareTo(t) >= 0) {
                    c[c.t++] = 1;
                    c.subTo(t, c)
                }
                d.ONE.dlShiftTo(l, t);
                t.subTo(h, h);
                while (h.t < l) h[h.t++] = 0;
                while (--s >= 0) {
                    var u = c[--r] == m ? this.DM: Math.floor(c[r] * o + (c[r - 1] + q) * p);
                    if ((c[r] += h.am(0, u, c, s, 0, l)) < u) {
                        h.dlShiftTo(s, t);
                        c.subTo(t, c);
                        while (c[r] < --u) c.subTo(t, c)
                    }
                }
                if (b != null) {
                    c.drShiftTo(l, b);
                    i != j && d.ZERO.subTo(b, b)
                }
                c.t = l;
                c.clamp();
                k > 0 && c.rShiftTo(k, c);
                i < 0 && d.ZERO.subTo(c, c)
            }
        }
        function G(a) {
            var b = this.abs(),
            c = a.t = 2 * b.t;
            while (--c >= 0) a[c] = 0;
            for (c = 0; c < b.t - 1; ++c) {
                var d = b.am(c, b[c], a, 2 * c, 0, 1);
                if ((a[c + b.t] += b.am(c + 1, 2 * b[c], a, 2 * c + 1, d, b.t - c - 1)) >= b.DV) {
                    a[c + b.t] -= b.DV;
                    a[c + b.t + 1] = 1
                }
            }
            a.t > 0 && (a[a.t - 1] += b.am(c, b[c], a, 2 * c, 0, 1));
            a.s = 0;
            a.clamp()
        }
        function F(a, b) {
            var c = this.abs(),
            e = a.abs(),
            f = c.t;
            b.t = f + e.t;
            while (--f >= 0) b[f] = 0;
            for (f = 0; f < e.t; ++f) b[f + c.t] = c.am(0, e[f], b, f, 0, c.t);
            b.s = 0;
            b.clamp();
            this.s != a.s && d.ZERO.subTo(b, b)
        }
        function E(a, b) {
            var c = 0,
            d = 0,
            e = Math.min(a.t, this.t);
            while (c < e) {
                d += this[c] - a[c];
                b[c++] = d & this.DM;
                d >>= this.DB
            }
            if (a.t < this.t) {
                d -= a.s;
                while (c < this.t) {
                    d += this[c];
                    b[c++] = d & this.DM;
                    d >>= this.DB
                }
                d += this.s
            } else {
                d += this.s;
                while (c < a.t) {
                    d -= a[c];
                    b[c++] = d & this.DM;
                    d >>= this.DB
                }
                d -= a.s
            }
            b.s = d < 0 ? -1 : 0;
            d < -1 ? b[c++] = this.DV + d: d > 0 && (b[c++] = d);
            b.t = c;
            b.clamp()
        }
        function D(a, b) {
            b.s = this.s;
            var c = Math.floor(a / this.DB);
            if (c >= this.t) b.t = 0;
            else {
                var d = a % this.DB,
                e = this.DB - d,
                f = (1 << d) - 1;
                b[0] = this[c] >> d;
                for (var g = c + 1; g < this.t; ++g) {
                    b[g - c - 1] |= (this[g] & f) << e;
                    b[g - c] = this[g] >> d
                }
                d > 0 && (b[this.t - c - 1] |= (this.s & f) << e);
                b.t = this.t - c;
                b.clamp()
            }
        }
        function C(a, b) {
            var c = a % this.DB,
            d = this.DB - c,
            e = (1 << d) - 1,
            f = Math.floor(a / this.DB),
            g = this.s << c & this.DM,
            h;
            for (h = this.t - 1; h >= 0; --h) {
                b[h + f + 1] = this[h] >> d | g;
                g = (this[h] & e) << c
            }
            for (h = f - 1; h >= 0; --h) b[h] = 0;
            b[f] = g;
            b.t = this.t + f + 1;
            b.s = this.s;
            b.clamp()
        }
        function B(a, b) {
            for (var c = a; c < this.t; ++c) b[c - a] = this[c];
            b.t = Math.max(this.t - a, 0);
            b.s = this.s
        }
        function A(a, b) {
            var c;
            for (c = this.t - 1; c >= 0; --c) b[c + a] = this[c];
            for (c = a - 1; c >= 0; --c) b[c] = 0;
            b.t = this.t + a;
            b.s = this.s
        }
        function z() {
            return this.t <= 0 ? 0 : this.DB * (this.t - 1) + y(this[this.t - 1] ^ this.s & this.DM)
        }
        function y(a) {
            var b = 1,
            c;
            if ((c = a >>> 16) != 0) {
                a = c;
                b += 16
            }
            if ((c = a >> 8) != 0) {
                a = c;
                b += 8
            }
            if ((c = a >> 4) != 0) {
                a = c;
                b += 4
            }
            if ((c = a >> 2) != 0) {
                a = c;
                b += 2
            }
            if ((c = a >> 1) != 0) {
                a = c;
                b += 1
            }
            return b
        }
        function x(a) {
            var b = this.s - a.s;
            if (b != 0) return b;
            var c = this.t;
            b = c - a.t;
            if (b != 0) return b;
            while (--c >= 0) if ((b = this[c] - a[c]) != 0) return b;
            return 0
        }
        function w() {
            return this.s < 0 ? this.negate() : this
        }
        function v() {
            var a = e();
            d.ZERO.subTo(this, a);
            return a
        }
        function u(a) {
            if (this.s < 0) return "-" + this.negate().toString(a);
            var b;
            if (a == 16) b = 4;
            else if (a == 8) b = 3;
            else if (a == 2) b = 1;
            else if (a == 32) b = 5;
            else if (a == 4) b = 2;
            else return this.toRadix(a);
            var c = (1 << b) - 1,
            d,
            e = !1,
            f = "",
            g = this.t,
            h = this.DB - g * this.DB % b;
            if (g-->0) {
                if (h < this.DB && (d = this[g] >> h) > 0) {
                    e = !0;
                    f = n(d)
                }
                while (g >= 0) {
                    if (h < b) {
                        d = (this[g] & (1 << h) - 1) << b - h;
                        d |= this[--g] >> (h += this.DB - b)
                    } else {
                        d = this[g] >> (h -= b) & c;
                        if (h <= 0) {
                            h += this.DB; --g
                        }
                    }
                    d > 0 && (e = !0);
                    e && (f += n(d))
                }
            }
            return e ? f: "0"
        }
        function t() {
            var a = this.s & this.DM;
            while (this.t > 0 && this[this.t - 1] == a)--this.t
        }
        function s(a, b) {
            var c;
            if (b == 16) c = 4;
            else if (b == 8) c = 3;
            else if (b == 256) c = 8;
            else if (b == 2) c = 1;
            else if (b == 32) c = 5;
            else if (b == 4) c = 2;
            else {
                this.fromRadix(a, b);
                return
            }
            this.t = 0;
            this.s = 0;
            var e = a.length,
            f = !1,
            g = 0;
            while (--e >= 0) {
                var h = c == 8 ? a[e] & 255 : o(a, e);
                if (h < 0) {
                    a.charAt(e) == "-" && (f = !0);
                    continue
                }
                f = !1;
                if (g == 0) this[this.t++] = h;
                else if (g + c > this.DB) {
                    this[this.t - 1] |= (h & (1 << this.DB - g) - 1) << g;
                    this[this.t++] = h >> this.DB - g
                } else this[this.t - 1] |= h << g;
                g += c;
                g >= this.DB && (g -= this.DB)
            }
            if (c == 8 && (a[0] & 128) != 0) {
                this.s = -1;
                g > 0 && (this[this.t - 1] |= (1 << this.DB - g) - 1 << g)
            }
            this.clamp();
            f && d.ZERO.subTo(this, this)
        }
        function r(a) {
            var b = e();
            b.fromInt(a);
            return b
        }
        function q(a) {
            this.t = 1;
            this.s = a < 0 ? -1 : 0;
            a > 0 ? this[0] = a: a < -1 ? this[0] = a + DV: this.t = 0
        }
        function p(a) {
            for (var b = this.t - 1; b >= 0; --b) a[b] = this[b];
            a.t = this.t;
            a.s = this.s
        }
        function o(a, b) {
            var c = k[a.charCodeAt(b)];
            return c == null ? -1 : c
        }
        function n(a) {
            return j.charAt(a)
        }
        function h(a, b, c, d, e, f) {
            var g = b & 16383,
            h = b >> 14;
            while (--f >= 0) {
                var i = this[a] & 16383,
                j = this[a++] >> 14,
                k = h * i + j * g;
                i = g * i + ((k & 16383) << 14) + c[d] + e;
                e = (i >> 28) + (k >> 14) + h * j;
                c[d++] = i & 268435455
            }
            return e
        }
        function g(a, b, c, d, e, f) {
            var g = b & 32767,
            h = b >> 15;
            while (--f >= 0) {
                var i = this[a] & 32767,
                j = this[a++] >> 15,
                k = h * i + j * g;
                i = g * i + ((k & 32767) << 15) + c[d] + (e & 1073741823);
                e = (i >>> 30) + (k >>> 15) + h * j + (e >>> 30);
                c[d++] = i & 1073741823
            }
            return e
        }
        function f(a, b, c, d, e, f) {
            while (--f >= 0) {
                var g = b * this[a++] + c[d] + e;
                e = Math.floor(g / 67108864);
                c[d++] = g & 67108863
            }
            return e
        }
        function e() {
            return new d(null)
        }
        function d(a, b, c) {
            a != null && ("number" == typeof a ? this.fromNumber(a, b, c) : b == null && "string" != typeof a ? this.fromString(a, 256) : this.fromString(a, b))
        }
        var a, b = 0xdeadbeefcafe,
        c = (b & 16777215) == 15715070;
        if (c && navigator.appName == "Microsoft Internet Explorer") {
            d.prototype.am = g;
            a = 30
        } else if (c && navigator.appName != "Netscape") {
            d.prototype.am = f;
            a = 26
        } else {
            d.prototype.am = h;
            a = 28
        }
        d.prototype.DB = a;
        d.prototype.DM = (1 << a) - 1;
        d.prototype.DV = 1 << a;
        var i = 52;
        d.prototype.FV = Math.pow(2, i);
        d.prototype.F1 = i - a;
        d.prototype.F2 = 2 * a - i;
        var j = "0123456789abcdefghijklmnopqrstuvwxyz",
        k = [],
        l,
        m;
        l = "0".charCodeAt(0);
        for (m = 0; m <= 9; ++m) k[l++] = m;
        l = "a".charCodeAt(0);
        for (m = 10; m < 36; ++m) k[l++] = m;
        l = "A".charCodeAt(0);
        for (m = 10; m < 36; ++m) k[l++] = m;
        J.prototype.convert = K;
        J.prototype.revert = L;
        J.prototype.reduce = M;
        J.prototype.mulTo = N;
        J.prototype.sqrTo = O;
        Q.prototype.convert = R;
        Q.prototype.revert = S;
        Q.prototype.reduce = T;
        Q.prototype.mulTo = V;
        Q.prototype.sqrTo = U;
        d.prototype.copyTo = p;
        d.prototype.fromInt = q;
        d.prototype.fromString = s;
        d.prototype.clamp = t;
        d.prototype.dlShiftTo = A;
        d.prototype.drShiftTo = B;
        d.prototype.lShiftTo = C;
        d.prototype.rShiftTo = D;
        d.prototype.subTo = E;
        d.prototype.multiplyTo = F;
        d.prototype.squareTo = G;
        d.prototype.divRemTo = H;
        d.prototype.invDigit = P;
        d.prototype.isEven = W;
        d.prototype.exp = X;
        d.prototype.toString = u;
        d.prototype.negate = v;
        d.prototype.abs = w;
        d.prototype.compareTo = x;
        d.prototype.bitLength = z;
        d.prototype.mod = I;
        d.prototype.modPowInt = Y;
        d.ZERO = r(0);
        d.ONE = r(1);
        Z.prototype.init = $;
        Z.prototype.next = _;
        var bb = 256,
        bc, bd, be;
        if (bd == null) {
            bd = [];
            be = 0;
            var bh;
            if (navigator.appName == "Netscape" && navigator.appVersion < "5" && window.crypto && typeof window.crypto.random == "function") {
                var bi = window.crypto.random(32);
                for (bh = 0; bh < bi.length; ++bh) bd[be++] = bi.charCodeAt(bh) & 255
            }
            while (be < bb) {
                bh = Math.floor(65536 * Math.random());
                bd[be++] = bh >>> 8;
                bd[be++] = bh & 255
            }
            be = 0;
            bg()
        }
        bl.prototype.nextBytes = bk;
        bq.prototype.doPublic = bs;
        bq.prototype.setPublic = br;
        bq.prototype.encrypt = bt;
        this.RSAKey = bq
    }).call(sinaSSOEncoder);
	
	function GetPW(servertime,nonce,sp){

		var f=new sinaSSOEncoder.RSAKey;
		f.setPublic("EB2A38568661887FA180BDDB5CABD5F21C7BFD59C090CB2D245A87AC253062882729293E5506350508E7F9AA3BB77F4333231490F915F6D63C55FE2F08A49B353F444AD3993CACC02DB784ABBB8E42A9B1BBFFFB38BE18D78E87A0E41B9B8F73A928EE0CCEE1F6739884B9777E4FE9E88A1BBE495927AC4A799B3181D6442443","10001");
		sp=f.encrypt([servertime,nonce].join("\t")+"\n"+sp);
		return sp;

	}
new.js (30.34 KB, 下载次数: 8)


1. 开通SVIP会员,免费下载本站所有源码,不限次数据,不限时间
2. 加官方QQ群,加官方微信群获取更多资源和帮助
3. 找站长苏飞做网站、商城、CRM、小程序、App、爬虫相关、项目外包等点这里
发表于 2015-2-3 23:56:41 | 显示全部楼层
强烈支持楼主ing……
发表于 2015-2-13 21:16:13 | 显示全部楼层
这个应该就是rsa加密吧

[JavaScript] 纯文本查看 复制代码
function BarrettMu(a){
    this.modulus=biCopy(a);
    this.k=biHighIndex(this.modulus)+1;
    var b=new BigInt();
    b.digits[2*this.k]=1;
    this.mu=biDivide(b,this.modulus);
    this.bkplus1=new BigInt();
    this.bkplus1.digits[this.k+1]=1;
    this.modulo=BarrettMu_modulo;
    this.multiplyMod=BarrettMu_multiplyMod;
    this.powMod=BarrettMu_powMod
};
function BarrettMu_modulo(h){
    var g=biDivideByRadixPower(h,this.k-1);
    var e=biMultiply(g,this.mu);
    var d=biDivideByRadixPower(e,this.k+1);
    var c=biModuloByRadixPower(h,this.k+1);
    var i=biMultiply(d,this.modulus);
    var b=biModuloByRadixPower(i,this.k+1);
    var a=biSubtract(c,b);
    if(a.isNeg){
        a=biAdd(a,this.bkplus1)
    };
    var f=biCompare(a,this.modulus)>=0;
    while(f){
        a=biSubtract(a,this.modulus);
        f=biCompare(a,this.modulus)>=0
    };
    return a
};
function BarrettMu_multiplyMod(a,c){
    var b=biMultiply(a,c);
    return this.modulo(b)
};
function BarrettMu_powMod(c,f){
    var b=new BigInt();
    b.digits[0]=1;
    var d=c;
    var e=f;
    while(true){
        if((e.digits[0]&1)!=0){
            b=this.multiplyMod(b,d)
        };
        e=biShiftRight(e,1);
        if(e.digits[0]==0&&biHighIndex(e)==0){
            break
        };
        d=this.multiplyMod(d,d)
    };
    return b
};
var biRadixBase=2;
var biRadixBits=16;
var bitsPerDigit=biRadixBits;
var biRadix=1<<16;
var biHalfRadix=biRadix>>>1;
var biRadixSquared=biRadix*biRadix;
var maxDigitVal=biRadix-1;
var maxInteger=9999999999999998;
var maxDigits;
var ZERO_ARRAY;
var bigZero,bigOne;
function setMaxDigits(b){
    maxDigits=b;
    ZERO_ARRAY=new Array(maxDigits);
    for(var a=0;
    a<ZERO_ARRAY.length;
    a++){
        ZERO_ARRAY[a]=0
    };
    bigZero=new BigInt();
    bigOne=new BigInt();
    bigOne.digits[0]=1
};
setMaxDigits(20);
var dpl10=15;
var lr10=biFromNumber(1000000000000000);
function BigInt(a){
    if(typeof a=="boolean"&&a==true){
        this.digits=null
    }
    else{
        this.digits=ZERO_ARRAY.slice(0)
    };
    this.isNeg=false
};
function biFromDecimal(e){
    var d=e.charAt(0)=="-";
    var c=d?1:0;
    var a;
    while(c<e.length&&e.charAt(c)=="0"){
        ++c
    };
    if(c==e.length){
        a=new BigInt()
    }
    else{
        var b=e.length-c;
        var f=b%dpl10;
        if(f==0){
            f=dpl10
        };
        a=biFromNumber(Number(e.substr(c,f)));
        c+=f;
        while(c<e.length){
            a=biAdd(biMultiply(a,lr10),biFromNumber(Number(e.substr(c,dpl10))));
            c+=dpl10
        };
        a.isNeg=d
    };
    return a
};
function biCopy(b){
    var a=new BigInt(true);
    a.digits=b.digits.slice(0);
    a.isNeg=b.isNeg;
    return a
};
function biFromNumber(c){
    var a=new BigInt();
    a.isNeg=c<0;
    c=Math.abs(c);
    var b=0;
    while(c>0){
        a.digits[b++]=c&maxDigitVal;
        c>>=biRadixBits
    };
    return a
};
function reverseStr(c){
    var a="";
    for(var b=c.length-1;
    b>-1;
    --b){
        a+=c.charAt(b)
    };
    return a
};
var hexatrigesimalToChar=new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z");
function biToString(d,f){
    var c=new BigInt();
    c.digits[0]=f;
    var e=biDivideModulo(d,c);
    var a=hexatrigesimalToChar[e[1].digits[0]];
    while(biCompare(e[0],bigZero)==1){
        e=biDivideModulo(e[0],c);
        digit=e[1].digits[0];
        a+=hexatrigesimalToChar[e[1].digits[0]]
    };
    return(d.isNeg?"-":"")+reverseStr(a)
};
function biToDecimal(d){
    var c=new BigInt();
    c.digits[0]=10;
    var e=biDivideModulo(d,c);
    var a=String(e[1].digits[0]);
    while(biCompare(e[0],bigZero)==1){
        e=biDivideModulo(e[0],c);
        a+=String(e[1].digits[0])
    };
    return(d.isNeg?"-":"")+reverseStr(a)
};
var hexToChar=new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");
function digitToHex(c){
    var b=15;
    var a="";
    for(i=0;
    i<4;
    ++i){
        a+=hexToChar[c&b];
        c>>>=4
    };
    return reverseStr(a)
};
function biToHex(b){
    var a="";
    var d=biHighIndex(b);
    for(var c=biHighIndex(b);
    c>-1;
    --c){
        a+=digitToHex(b.digits[c])
    };
    return a
};
function charToHex(k){
    var d=48;
    var b=d+9;
    var e=97;
    var h=e+25;
    var g=65;
    var f=65+25;
    var a;
    if(k>=d&&k<=b){
        a=k-d
    }
    else{
        if(k>=g&&k<=f){
            a=10+k-g
        }
        else{
            if(k>=e&&k<=h){
                a=10+k-e
            }
            else{
                a=0
            }
            
        }
        
    };
    return a
};
function hexToDigit(d){
    var b=0;
    var a=Math.min(d.length,4);
    for(var c=0;
    c<a;
    ++c){
        b<<=4;
        b|=charToHex(d.charCodeAt(c))
    };
    return b
};
function biFromHex(e){
    var b=new BigInt();
    var a=e.length;
    for(var d=a,c=0;
    d>0;
    d-=4,++c){
        b.digits[c]=hexToDigit(e.substr(Math.max(d-4,0),Math.min(d,4)))
    };
    return b
};
function biFromString(l,k){
    var a=l.charAt(0)=="-";
    var e=a?1:0;
    var m=new BigInt();
    var b=new BigInt();
    b.digits[0]=1;
    for(var d=l.length-1;
    d>=e;
    d--){
        var f=l.charCodeAt(d);
        var g=charToHex(f);
        var h=biMultiplyDigit(b,g);
        m=biAdd(m,h);
        b=biMultiplyDigit(b,k)
    };
    m.isNeg=a;
    return m
};
function biDump(a){
    return(a.isNeg?"-":"")+a.digits.join(" ")
};
function biAdd(b,g){
    var a;
    if(b.isNeg!=g.isNeg){
        g.isNeg=!g.isNeg;
        a=biSubtract(b,g);
        g.isNeg=!g.isNeg
    }
    else{
        a=new BigInt();
        var f=0;
        var e;
        for(var d=0;
        d<b.digits.length;
        ++d){
            e=b.digits[d]+g.digits[d]+f;
            a.digits[d]=e&65535;
            f=Number(e>=biRadix)
        };
        a.isNeg=b.isNeg
    };
    return a
};
function biSubtract(b,g){
    var a;
    if(b.isNeg!=g.isNeg){
        g.isNeg=!g.isNeg;
        a=biAdd(b,g);
        g.isNeg=!g.isNeg
    }
    else{
        a=new BigInt();
        var f,e;
        e=0;
        for(var d=0;
        d<b.digits.length;
        ++d){
            f=b.digits[d]-g.digits[d]+e;
            a.digits[d]=f&65535;
            if(a.digits[d]<0){
                a.digits[d]+=biRadix
            };
            e=0-Number(f<0)
        };
        if(e==-1){
            e=0;
            for(var d=0;
            d<b.digits.length;
            ++d){
                f=0-a.digits[d]+e;
                a.digits[d]=f&65535;
                if(a.digits[d]<0){
                    a.digits[d]+=biRadix
                };
                e=0-Number(f<0)
            };
            a.isNeg=!b.isNeg
        }
        else{
            a.isNeg=b.isNeg
        }
        
    };
    return a
};
function biHighIndex(b){
    var a=b.digits.length-1;
    while(a>0&&b.digits[a]==0){
        --a
    };
    return a
};
function biNumBits(c){
    var f=biHighIndex(c);
    var e=c.digits[f];
    var b=(f+1)*bitsPerDigit;
    var a;
    for(a=b;
    a>b-bitsPerDigit;
    --a){
        if((e&32768)!=0){
            break
        };
        e<<=1
    };
    return a
};
function biMultiply(h,g){
    var o=new BigInt();
    var f;
    var b=biHighIndex(h);
    var m=biHighIndex(g);
    var l,a,d;
    for(var e=0;
    e<=m;
    ++e){
        f=0;
        d=e;
        for(j=0;
        j<=b;
        ++j,++d){
            a=o.digits[d]+h.digits[j]*g.digits[e]+f;
            o.digits[d]=a&maxDigitVal;
            f=a>>>biRadixBits
        };
        o.digits[e+b+1]=f
    };
    o.isNeg=h.isNeg!=g.isNeg;
    return o
};
function biMultiplyDigit(a,g){
    var f,e,d;
    result=new BigInt();
    f=biHighIndex(a);
    e=0;
    for(var b=0;
    b<=f;
    ++b){
        d=result.digits[b]+a.digits[b]*g+e;
        result.digits[b]=d&maxDigitVal;
        e=d>>>biRadixBits
    };
    result.digits[1+f]=e;
    return result
};
function arrayCopy(e,h,c,g,f){
    var a=Math.min(h+f,e.length);
    for(var d=h,b=g;
    d<a;
    ++d,++b){
        c[b]=e[d]
    }
    
};
var highBitMasks=new Array(0,32768,49152,57344,61440,63488,64512,65024,65280,65408,65472,65504,65520,65528,65532,65534,65535);
function biShiftLeft(b,h){
    var d=Math.floor(h/bitsPerDigit);
    var a=new BigInt();
    arrayCopy(b.digits,0,a.digits,d,a.digits.length-d);
    var g=h%bitsPerDigit;
    var c=bitsPerDigit-g;
    for(var e=a.digits.length-1,f=e-1;
    e>0;
    --e,--f){
        a.digits[e]=((a.digits[e]<<g)&maxDigitVal)|((a.digits[f]&highBitMasks[g])>>>(c))
    };
    a.digits[0]=((a.digits[e]<<g)&maxDigitVal);
    a.isNeg=b.isNeg;
    return a
};
var lowBitMasks=new Array(0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535);
function biShiftRight(b,h){
    var c=Math.floor(h/bitsPerDigit);
    var a=new BigInt();
    arrayCopy(b.digits,c,a.digits,0,b.digits.length-c);
    var f=h%bitsPerDigit;
    var g=bitsPerDigit-f;
    for(var d=0,e=d+1;
    d<a.digits.length-1;
    ++d,++e){
        a.digits[d]=(a.digits[d]>>>f)|((a.digits[e]&lowBitMasks[f])<<g)
    };
    a.digits[a.digits.length-1]>>>=f;
    a.isNeg=b.isNeg;
    return a
};
function biMultiplyByRadixPower(b,c){
    var a=new BigInt();
    arrayCopy(b.digits,0,a.digits,c,a.digits.length-c);
    return a
};
function biDivideByRadixPower(b,c){
    var a=new BigInt();
    arrayCopy(b.digits,c,a.digits,0,a.digits.length-c);
    return a
};
function biModuloByRadixPower(b,c){
    var a=new BigInt();
    arrayCopy(b.digits,0,a.digits,0,c);
    return a
};
function biCompare(a,c){
    if(a.isNeg!=c.isNeg){
        return 1-2*Number(a.isNeg)
    };
    for(var b=a.digits.length-1;
    b>=0;
    --b){
        if(a.digits[b]!=c.digits[b]){
            if(a.isNeg){
                return 1-2*Number(a.digits[b]>c.digits[b])
            }
            else{
                return 1-2*Number(a.digits[b]<c.digits[b])
            }
            
        }
        
    };
    return 0
};
function biDivideModulo(g,f){
    var a=biNumBits(g);
    var e=biNumBits(f);
    var d=f.isNeg;
    var o,m;
    if(a<e){
        if(g.isNeg){
            o=biCopy(bigOne);
            o.isNeg=!f.isNeg;
            g.isNeg=false;
            f.isNeg=false;
            m=biSubtract(f,g);
            g.isNeg=true;
            f.isNeg=d
        }
        else{
            o=new BigInt();
            m=biCopy(g)
        };
        return new Array(o,m)
    };
    o=new BigInt();
    m=g;
    var k=Math.ceil(e/bitsPerDigit)-1;
    var h=0;
    while(f.digits[k]<biHalfRadix){
        f=biShiftLeft(f,1);
        ++h;
        ++e;
        k=Math.ceil(e/bitsPerDigit)-1
    };
    m=biShiftLeft(m,h);
    a+=h;
    var u=Math.ceil(a/bitsPerDigit)-1;
    var B=biMultiplyByRadixPower(f,u-k);
    while(biCompare(m,B)!=-1){
        ++o.digits[u-k];
        m=biSubtract(m,B)
    };
    for(var z=u;
    z>k;
    --z){
        var l=(z>=m.digits.length)?0:m.digits[z];
        var A=(z-1>=m.digits.length)?0:m.digits[z-1];
        var w=(z-2>=m.digits.length)?0:m.digits[z-2];
        var v=(k>=f.digits.length)?0:f.digits[k];
        var c=(k-1>=f.digits.length)?0:f.digits[k-1];
        if(l==v){
            o.digits[z-k-1]=maxDigitVal
        }
        else{
            o.digits[z-k-1]=Math.floor((l*biRadix+A)/v)
        };
        var s=o.digits[z-k-1]*((v*biRadix)+c);
        var p=(l*biRadixSquared)+((A*biRadix)+w);
        while(s>p){
            --o.digits[z-k-1];
            s=o.digits[z-k-1]*((v*biRadix)|c);
            p=(l*biRadix*biRadix)+((A*biRadix)+w)
        };
        B=biMultiplyByRadixPower(f,z-k-1);
        m=biSubtract(m,biMultiplyDigit(B,o.digits[z-k-1]));
        if(m.isNeg){
            m=biAdd(m,B);
            --o.digits[z-k-1]
        }
        
    };
    m=biShiftRight(m,h);
    o.isNeg=g.isNeg!=d;
    if(g.isNeg){
        if(d){
            o=biAdd(o,bigOne)
        }
        else{
            o=biSubtract(o,bigOne)
        };
        f=biShiftRight(f,h);
        m=biSubtract(f,m)
    };
    if(m.digits[0]==0&&biHighIndex(m)==0){
        m.isNeg=false
    };
    return new Array(o,m)
};
function biDivide(a,b){
    return biDivideModulo(a,b)[0]
};
function biModulo(a,b){
    return biDivideModulo(a,b)[1]
};
function biMultiplyMod(b,c,a){
    return biModulo(biMultiply(b,c),a)
};
function biPow(c,e){
    var b=bigOne;
    var d=c;
    while(true){
        if((e&1)!=0){
            b=biMultiply(b,d)
        };
        e>>=1;
        if(e==0){
            break
        };
        d=biMultiply(d,d)
    };
    return b
};
function biPowMod(d,g,c){
    var b=bigOne;
    var e=d;
    var f=g;
    while(true){
        if((f.digits[0]&1)!=0){
            b=biMultiplyMod(b,e,c)
        };
        f=biShiftRight(f,1);
        if(f.digits[0]==0&&biHighIndex(f)==0){
            break
        };
        e=biMultiplyMod(e,e,c)
    };
    return b
};
function RSAKeyPair(b,c,a){
    this.e=biFromHex(b);
    this.d=biFromHex(c);
    this.m=biFromHex(a);
    this.chunkSize=2*biHighIndex(this.m);
    this.radix=16;
    this.barrett=new BarrettMu(this.m)
};
function twoDigit(a){
    return(a<10?"0":"")+String(a)
};
function encryptedString(l,o){
    var h=new Array();
    var b=o.length;
    var f=0;
    while(f<b){
        h[f]=o.charCodeAt(f);
        f++
    }
    while(h.length%l.chunkSize!=0){
        h[f++]=0
    };
    var g=h.length;
    var p="";
    var e,d,c;
    for(f=0;
    f<g;
    f+=l.chunkSize){
        c=new BigInt();
        e=0;
        for(d=f;
        d<f+l.chunkSize;
        ++e){
            c.digits[e]=h[d++];
            c.digits[e]+=h[d++]<<8
        };
        var n=l.barrett.powMod(c,l.e);
        var m=l.radix==16?biToHex(n):biToString(n,l.radix);
        p+=m+" "
    };
    return p.substring(0,p.length-1)
};
function decryptedString(e,f){
    var h=f.split(" ");
    var a="";
    var d,c,g;
    for(d=0;
    d<h.length;
    ++d){
        var b;
        if(e.radix==16){
            b=biFromHex(h[d])
        }
        else{
            b=biFromString(h[d],e.radix)
        };
        g=e.barrett.powMod(b,e.d);
        for(c=0;
        c<=biHighIndex(g);
        ++c){
            a+=String.fromCharCode(g.digits[c]&255,g.digits[c]>>8)
        }
        
    };
    if(a.charCodeAt(a.length-1)==0){
        a=a.substring(0,a.length-1)
    };
    return a
};
function bodyRSA(rsa_publicExp,rsa_modulus){
    setMaxDigits(131);
    return new RSAKeyPair(rsa_publicExp,"",rsa_modulus)
}
encryptedString(bodyRSA('10001','EB2A38568661887FA180BDDB5CABD5F21C7BFD59C090CB2D245A87AC253062882729293E5506350508E7F9AA3BB77F4333231490F915F6D63C55FE2F08A49B353F444AD3993CACC02DB784ABBB8E42A9B1BBFFFB38BE18D78E87A0E41B9B8F73A928EE0CCEE1F6739884B9777E4FE9E88A1BBE495927AC4A799B3181D6442443'),encodeURIComponent('password'))

试试这个吧 之前用的。
您需要登录后才可以回帖 登录 | 马上注册

本版积分规则

QQ|手机版|小黑屋|手机版|联系我们|关于我们|广告合作|苏飞论坛 ( 豫ICP备18043678号-2)

GMT+8, 2024-12-19 22:39

© 2014-2021

快速回复 返回顶部 返回列表