地址 :http://game.pps.tv/events/cqss_sign

调用encryptedString('password')

RSA加密,通过function(a) 定义 window={};

再定义RSAUtils=window.RSAUtils || a.RSAUtils;

window={};
(function (a) {
    var z;
    if (typeof a.RSAUtils === "undefined") {
        z = a.RSAUtils = {};
    }
    var l = 2;
    var m = 16;
    var o = m;
    var k = 1 << 16;
    var h = k >>> 1;
    var n = k * k;
    var w = k - 1;
    var x = 9999999999999998;
    var v;
    var A;
    var g, f;
    var e = a.BigInt = function (B) {
        if (typeof B === "boolean" && B === true) {
            this.digits = null;
        } else {
            this.digits = A.slice(0);
        }
        this.isNeg = false;
    };
    z.setMaxDigits = function (C) {
        v = C;
        A = new Array(v);
        for (var B = 0; B < A.length; B++) {
            A[B] = 0;
        }
        g = new e();
        f = new e();
        f.digits[0] = 1;
    };
    z.setMaxDigits(20);
    var p = 15;
    z.biFromNumber = function (B) {
        var D = new e();
        D.isNeg = B < 0;
        B = Math.abs(B);
        var C = 0;
        while (B > 0) {
            D.digits[C++] = B & w;
            B = Math.floor(B / k);
        }
        return D;
    };
    var u = z.biFromNumber(1000000000000000);
    z.biFromDecimal = function (G) {
        var E = G.charAt(0) == "-";
        var D = E ? 1 : 0;
        var F;
        while (D < G.length && G.charAt(D) == "0") {
            ++D;
        }
        if (D == G.length) {
            F = new e();
        } else {
            var B = G.length - D;
            var C = B % p;
            if (C == 0) {
                C = p;
            }
            F = z.biFromNumber(Number(G.substr(D, C)));
            D += C;
            while (D < G.length) {
                F = z.biAdd(z.biMultiply(F, u), z.biFromNumber(Number(G.substr(D, p))));
                D += p;
            }
            F.isNeg = E;
        }
        return F;
    };
    z.biCopy = function (B) {
        var C = new e(true);
        C.digits = B.digits.slice(0);
        C.isNeg = B.isNeg;
        return C;
    };
    z.reverseStr = function (D) {
        var C = "";
        for (var B = D.length - 1; B > -1; --B) {
            C += D.charAt(B);
        }
        return C;
    };
    var q = ["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"];
    z.biToString = function (F, D) {
        var B = new e();
        B.digits[0] = D;
        var C = z.biDivideModulo(F, B);
        var E = q[C[1].digits[0]];
        while (z.biCompare(C[0], g) == 1) {
            C = z.biDivideModulo(C[0], B);
            digit = C[1].digits[0];
            E += q[C[1].digits[0]];
        }
        return (F.isNeg ? "-" : "") + z.reverseStr(E);
    };
    z.biToDecimal = function (E) {
        var B = new e();
        B.digits[0] = 10;
        var C = z.biDivideModulo(E, B);
        var D = String(C[1].digits[0]);
        while (z.biCompare(C[0], g) == 1) {
            C = z.biDivideModulo(C[0], B);
            D += String(C[1].digits[0]);
        }
        return (E.isNeg ? "-" : "") + z.reverseStr(D);
    };
    var r = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
    z.digitToHex = function (C) {
        var B = 15;
        var D = "";
        for (i = 0; i < 4; ++i) {
            D += r[C & B];
            C >>>= 4;
        }
        return z.reverseStr(D);
    };
    z.biToHex = function (E) {
        var D = "";
        var C = z.biHighIndex(E);
        for (var B = z.biHighIndex(E); B > -1; --B) {
            D += z.digitToHex(E.digits[B]);
        }
        return D;
    };
    z.charToHex = function (D) {
        var I = 48;
        var G = I + 9;
        var E = 97;
        var F = E + 25;
        var B = 65;
        var C = 65 + 25;
        var H;
        if (D >= I && D <= G) {
            H = D - I;
        } else {
            if (D >= B && D <= C) {
                H = 10 + D - B;
            } else {
                if (D >= E && D <= F) {
                    H = 10 + D - E;
                } else {
                    H = 0;
                }
            }
        }
        return H;
    };
    z.hexToDigit = function (D) {
        var C = 0;
        var E = Math.min(D.length, 4);
        for (var B = 0; B < E; ++B) {
            C <<= 4;
            C |= z.charToHex(D.charCodeAt(B));
        }
        return C;
    };
    z.biFromHex = function (E) {
        var D = new e();
        var F = E.length;
        for (var B = F, C = 0; B > 0; B -= 4, ++C) {
            D.digits[C] = z.hexToDigit(E.substr(Math.max(B - 4, 0), Math.min(B, 4)));
        }
        return D;
    };
    z.biFromString = function (K, I) {
        var F = K.charAt(0) == "-";
        var G = F ? 1 : 0;
        var J = new e();
        var H = new e();
        H.digits[0] = 1;
        for (var E = K.length - 1; E >= G; E--) {
            var C = K.charCodeAt(E);
            var D = z.charToHex(C);
            var B = z.biMultiplyDigit(H, D);
            J = z.biAdd(J, B);
            H = z.biMultiplyDigit(H, I);
        }
        J.isNeg = F;
        return J;
    };
    z.biDump = function (B) {
        return (B.isNeg ? "-" : "") + B.digits.join(" ");
    };
    z.biAdd = function (F, G) {
        var E;
        if (F.isNeg != G.isNeg) {
            G.isNeg = !G.isNeg;
            E = z.biSubtract(F, G);
            G.isNeg = !G.isNeg;
        } else {
            E = new e();
            var B = 0;
            var D;
            for (var C = 0; C < F.digits.length; ++C) {
                D = F.digits[C] + G.digits[C] + B;
                E.digits[C] = D % k;
                B = Number(D >= k);
            }
            E.isNeg = F.isNeg;
        }
        return E;
    };
    z.biSubtract = function (F, G) {
        var E;
        if (F.isNeg != G.isNeg) {
            G.isNeg = !G.isNeg;
            E = z.biAdd(F, G);
            G.isNeg = !G.isNeg;
        } else {
            E = new e();
            var D, B;
            B = 0;
            for (var C = 0; C < F.digits.length; ++C) {
                D = F.digits[C] - G.digits[C] + B;
                E.digits[C] = D % k;
                if (E.digits[C] < 0) {
                    E.digits[C] += k;
                }
                B = 0 - Number(D < 0);
            }
            if (B == -1) {
                B = 0;
                for (var C = 0; C < F.digits.length; ++C) {
                    D = 0 - E.digits[C] + B;
                    E.digits[C] = D % k;
                    if (E.digits[C] < 0) {
                        E.digits[C] += k;
                    }
                    B = 0 - Number(D < 0);
                }
                E.isNeg = !F.isNeg;
            } else {
                E.isNeg = F.isNeg;
            }
        }
        return E;
    };
    z.biHighIndex = function (C) {
        var B = C.digits.length - 1;
        while (B > 0 && C.digits[B] == 0) {
            --B;
        }
        return B;
    };
    z.biNumBits = function (F) {
        var D = z.biHighIndex(F);
        var B = F.digits[D];
        var C = (D + 1) * o;
        var E;
        for (E = C; E > C - o; --E) {
            if ((B & 32768) != 0) {
                break;
            }
            B <<= 1;
        }
        return E;
    };
    z.biMultiply = function (J, K) {
        var F = new e();
        var B;
        var E = z.biHighIndex(J);
        var G = z.biHighIndex(K);
        var H, I, D;
        for (var C = 0; C <= G; ++C) {
            B = 0;
            D = C;
            for (j = 0; j <= E; ++j, ++D) {
                I = F.digits[D] + J.digits[j] * K.digits[C] + B;
                F.digits[D] = I & w;
                B = I >>> m;
            }
            F.digits[C + E + 1] = B;
        }
        F.isNeg = J.isNeg != K.isNeg;
        return F;
    };
    z.biMultiplyDigit = function (F, G) {
        var D, B, E;
        result = new e();
        D = z.biHighIndex(F);
        B = 0;
        for (var C = 0; C <= D; ++C) {
            E = result.digits[C] + F.digits[C] * G + B;
            result.digits[C] = E & w;
            B = E >>> m;
        }
        result.digits[1 + D] = B;
        return result;
    };
    z.arrayCopy = function (H, I, B, C, G) {
        var F = Math.min(I + G, H.length);
        for (var D = I, E = C; D < F; ++D, ++E) {
            B[E] = H[D];
        }
    };
    var s = [0, 32768, 49152, 57344, 61440, 63488, 64512, 65024, 65280, 65408, 65472, 65504, 65520, 65528, 65532, 65534, 65535];
    z.biShiftLeft = function (I, F) {
        var C = Math.floor(F / o);
        var G = new e();
        z.arrayCopy(I.digits, 0, G.digits, C, G.digits.length - C);
        var B = F % o;
        var H = o - B;
        for (var D = G.digits.length - 1, E = D - 1; D > 0; --D, --E) {
            G.digits[D] = ((G.digits[D] << B) & w) | ((G.digits[E] & s[B]) >>> (H));
        }
        G.digits[0] = ((G.digits[D] << B) & w);
        G.isNeg = I.isNeg;
        return G;
    };
    var t = [0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535];
    z.biShiftRight = function (I, G) {
        var C = Math.floor(G / o);
        var H = new e();
        z.arrayCopy(I.digits, C, H.digits, 0, I.digits.length - C);
        var B = G % o;
        var F = o - B;
        for (var D = 0, E = D + 1; D < H.digits.length - 1; ++D, ++E) {
            H.digits[D] = (H.digits[D] >>> B) | ((H.digits[E] & t[B]) << F);
        }
        H.digits[H.digits.length - 1] >>>= B;
        H.isNeg = I.isNeg;
        return H;
    };
    z.biMultiplyByRadixPower = function (D, B) {
        var C = new e();
        z.arrayCopy(D.digits, 0, C.digits, B, C.digits.length - B);
        return C;
    };
    z.biDivideByRadixPower = function (D, B) {
        var C = new e();
        z.arrayCopy(D.digits, B, C.digits, 0, C.digits.length - B);
        return C;
    };
    z.biModuloByRadixPower = function (D, B) {
        var C = new e();
        z.arrayCopy(D.digits, 0, C.digits, 0, B);
        return C;
    };
    z.biCompare = function (C, D) {
        if (C.isNeg != D.isNeg) {
            return 1 - 2 * Number(C.isNeg);
        }
        for (var B = C.digits.length - 1; B >= 0; --B) {
            if (C.digits[B] != D.digits[B]) {
                if (C.isNeg) {
                    return 1 - 2 * Number(C.digits[B] > D.digits[B]);
                } else {
                    return 1 - 2 * Number(C.digits[B] < D.digits[B]);
                }
            }
        }
        return 0;
    };
    z.biDivideModulo = function (Q, R) {
        var H = z.biNumBits(Q);
        var P = z.biNumBits(R);
        var I = R.isNeg;
        var J, K;
        if (H < P) {
            if (Q.isNeg) {
                J = z.biCopy(f);
                J.isNeg = !R.isNeg;
                Q.isNeg = false;
                R.isNeg = false;
                K = biSubtract(R, Q);
                Q.isNeg = true;
                R.isNeg = I;
            } else {
                J = new e();
                K = z.biCopy(Q);
            }
            return [J, K];
        }
        J = new e();
        K = Q;
        var O = Math.ceil(P / o) - 1;
        var F = 0;
        while (R.digits[O] < h) {
            R = z.biShiftLeft(R, 1);
            ++F;
            ++P;
            O = Math.ceil(P / o) - 1;
        }
        K = z.biShiftLeft(K, F);
        H += F;
        var G = Math.ceil(H / o) - 1;
        var B = z.biMultiplyByRadixPower(R, G - O);
        while (z.biCompare(K, B) != -1) {
            ++J.digits[G - O];
            K = z.biSubtract(K, B);
        }
        for (var E = G; E > O; --E) {
            var L = (E >= K.digits.length) ? 0 : K.digits[E];
            var M = (E - 1 >= K.digits.length) ? 0 : K.digits[E - 1];
            var N = (E - 2 >= K.digits.length) ? 0 : K.digits[E - 2];
            var S = (O >= R.digits.length) ? 0 : R.digits[O];
            var T = (O - 1 >= R.digits.length) ? 0 : R.digits[O - 1];
            if (L == S) {
                J.digits[E - O - 1] = w;
            } else {
                J.digits[E - O - 1] = Math.floor((L * k + M) / S);
            }
            var C = J.digits[E - O - 1] * ((S * k) + T);
            var D = (L * n) + ((M * k) + N);
            while (C > D) {
                --J.digits[E - O - 1];
                C = J.digits[E - O - 1] * ((S * k) | T);
                D = (L * k * k) + ((M * k) + N);
            }
            B = z.biMultiplyByRadixPower(R, E - O - 1);
            K = z.biSubtract(K, z.biMultiplyDigit(B, J.digits[E - O - 1]));
            if (K.isNeg) {
                K = z.biAdd(K, B);
                --J.digits[E - O - 1];
            }
        }
        K = z.biShiftRight(K, F);
        J.isNeg = Q.isNeg != I;
        if (Q.isNeg) {
            if (I) {
                J = z.biAdd(J, f);
            } else {
                J = z.biSubtract(J, f);
            }
            R = z.biShiftRight(R, F);
            K = z.biSubtract(R, K);
        }
        if (K.digits[0] == 0 && z.biHighIndex(K) == 0) {
            K.isNeg = false;
        }
        return [J, K];
    };
    z.biDivide = function (B, C) {
        return z.biDivideModulo(B, C)[0];
    };
    z.biModulo = function (B, C) {
        return z.biDivideModulo(B, C)[1];
    };
    z.biMultiplyMod = function (C, D, B) {
        return z.biModulo(z.biMultiply(C, D), B);
    };
    z.biPow = function (D, E) {
        var C = f;
        var B = D;
        while (true) {
            if ((E & 1) != 0) {
                C = z.biMultiply(C, B);
            }
            E >>= 1;
            if (E == 0) {
                break;
            }
            B = z.biMultiply(B, B);
        }
        return C;
    };
    z.biPowMod = function (F, G, D) {
        var E = f;
        var B = F;
        var C = G;
        while (true) {
            if ((C.digits[0] & 1) != 0) {
                E = z.biMultiplyMod(E, B, D);
            }
            C = z.biShiftRight(C, 1);
            if (C.digits[0] == 0 && z.biHighIndex(C) == 0) {
                break;
            }
            B = z.biMultiplyMod(B, B, D);
        }
        return E;
    };
    a.BarrettMu = function (C) {
        this.modulus = z.biCopy(C);
        this.k = z.biHighIndex(this.modulus) + 1;
        var B = new e();
        B.digits[2 * this.k] = 1;
        this.mu = z.biDivide(B, this.modulus);
        this.bkplus1 = new e();
        this.bkplus1.digits[this.k + 1] = 1;
        this.modulo = b;
        this.multiplyMod = c;
        this.powMod = d;
    };
    function b(K) {
        var B = z;
        var C = B.biDivideByRadixPower(K, this.k - 1);
        var D = B.biMultiply(C, this.mu);
        var E = B.biDivideByRadixPower(D, this.k + 1);
        var G = B.biModuloByRadixPower(K, this.k + 1);
        var I = B.biMultiply(E, this.modulus);
        var H = B.biModuloByRadixPower(I, this.k + 1);
        var F = B.biSubtract(G, H);
        if (F.isNeg) {
            F = B.biAdd(F, this.bkplus1);
        }
        var J = B.biCompare(F, this.modulus) >= 0;
        while (J) {
            F = B.biSubtract(F, this.modulus);
            J = B.biCompare(F, this.modulus) >= 0;
        }
        return F;
    }
    function c(B, D) {
        var C = z.biMultiply(B, D);
        return this.modulo(C);
    }
    function d(E, F) {
        var D = new e();
        D.digits[0] = 1;
        var B = E;
        var C = F;
        while (true) {
            if ((C.digits[0] & 1) != 0) {
                D = this.multiplyMod(D, B);
            }
            C = z.biShiftRight(C, 1);
            if (C.digits[0] == 0 && z.biHighIndex(C) == 0) {
                break;
            }
            B = this.multiplyMod(B, B);
        }
        return D;
    }
    var y = function (D, C, E) {
        var B = z;
        this.e = B.biFromHex(D);
        this.d = B.biFromHex(C);
        this.m = B.biFromHex(E);
        this.chunkSize = 2 * B.biHighIndex(this.m);
        this.radix = 16;
        this.barrett = new a.BarrettMu(this.m);
    };
    z.getKeyPair = function (C, B, D) {
        return new y(C, B, D);
    };
    if (typeof a.twoDigit === "undefined") {
        a.twoDigit = function (B) {
            return (B < 10 ? "0" : "") + String(B);
        };
    }
    z.encryptedString = function (I, K) {
        var B = [];
        var L = K.length;
        var F = 0;
        while (F < L) {
            B[F] = K.charCodeAt(F);
            F++;
        }
        while (B.length % I.chunkSize != 0) {
            B[F++] = 0;
        }
        var C = B.length;
        var J = "";
        var G, H, D;
        for (F = 0; F < C; F += I.chunkSize) {
            D = new e();
            G = 0;
            for (H = F; H < F + I.chunkSize; ++G) {
                D.digits[G] = B[H++];
                D.digits[G] += B[H++] << 8;
            }
            var E = I.barrett.powMod(D, I.e);
            var M = I.radix == 16 ? z.biToHex(E) : z.biToString(E, I.radix);
            J += M + " ";
        }
        return J.substring(0, J.length - 1);
    };
    z.decryptedString = function (G, I) {
        var D = I.split(" ");
        var H = "";
        var E, F, C;
        for (E = 0; E < D.length; ++E) {
            var B;
            if (G.radix == 16) {
                B = z.biFromHex(D[E]);
            } else {
                B = z.biFromString(D[E], G.radix);
            }
            C = G.barrett.powMod(B, G.d);
            for (F = 0; F <= z.biHighIndex(C); ++F) {
                H += String.fromCharCode(C.digits[F] & 255, C.digits[F] >> 8);
            }
        }
        if (H.charCodeAt(H.length - 1) == 0) {
            H = H.substring(0, H.length - 1);
        }
        return H;
    };
    z.setMaxDigits(130);
})(window);

RSAUtils=window.RSAUtils || a.RSAUtils;
function encryptedString(password)
{
 var key_modulus = "ab86b6371b5318aaa1d3c9e612a9f1264f372323c8c0f19875b5fc3b3fd3afcc1e5bec527aa94bfa85bffc157e4245aebda05389a5357b75115ac94f074aefcd";
            var key = RSAUtils.getKeyPair("10001", "", key_modulus);
 return  RSAUtils.encryptedString(key, encodeURIComponent(password)).replace(/\s/g, "-");
}

PPS传奇生死的更多相关文章

  1. [华商韬略] 拉里·埃里森(Larry Elison) 的传奇人生

    拉里·埃里森(Larry Elison) 的传奇人生   开战机.玩游艇.盖皇宫,挑战比尔·盖茨,干掉50多家硅谷豪强……全世界比拉里·埃里森更有钱的只有5个,像他这样的硅谷“坏孩子”却是唯一. 19 ...

  2. Anders Hejlsberg 技术理想架构开发传奇

    Anders Hejlsberg(安德斯-海森博格) 坐在自己的办公室,双眼直直的盯着前方.他要做一个决定,决定自己未来的命运和理想.这是1996年一个普通的下午,几个小时前,他刚与比尔-盖茨结束了 ...

  3. 类传奇手游简单Demo

    这是一年多前自己闲时以Unity2D制作的很粗糙简单的传奇类手游Demo(单机),已很久未作继续开发. 此小Demo初步完成或实现了如下功能(有诸多考虑欠妥甚至不完善之处): 1).图片资源打包方式. ...

  4. PPT开发 * .pps 文件类型

    PPT开发, * .pps ,文件类型 PPS 这个格式也是PowerPoint文件格式的一种. pps的意思是说PowerPoint Show,POWER POINT会直接生成预览形式为你放映幻灯片 ...

  5. ixgbe 82599 固定源与目标, UDP, 64字节小包, 1488w pps 单核CPU软中断sirq 100%

    ixgbe 82599 固定源与目标, UDP, 64字节小包, 1488w pps 单核CPU软中断sirq 100% 注: 测试使用, 正常应用不要开启 五元组不同, 开启ntupleethtoo ...

  6. 从RTSP协议SDP数据中获得二进制的SPS、PPS

    在RTSP协议的交互过程中,第二步客户端发送DESCRIBE请求之后,服务端会返回SDP内容,该SDP内容中有关于媒体和会话的描述,本篇文章主要给出如何从SDP字符串中得到H264视频信息中的sps. ...

  7. JMir——Java版热血传奇2之资源文件与地图

    我虽然是90后,但是也很喜欢热血传奇2(以下简称“传奇”)这款游戏. 进入程序员行业后自己也对传奇客户端实现有所研究,现在将我的一些研究结果展示出来,如果大家有兴趣的话不妨与我交流. 项目我托管到co ...

  8. 《热血传奇2》wix、wil文件解析Java实现

    在百度上搜索java+wil只有iteye上一篇有丁点儿内容,不过他说的是错的!或者说是不完整的,我个人认为我对于热血传奇客户端解析还是有一定研究的,请移步: <JMir——Java版热血传奇2 ...

  9. Telegram传奇:俄罗斯富豪、黑客高手、极权和阴谋…

    说了很久要写Telegram的故事,一直拖延没有写.在我拖延的这段时间里面,Telegarm继续快速增长,前几天,在旧金山的TechCrunch Disrupt活动上,创始人Durov说现在Teleg ...

随机推荐

  1. C#-#define条件编译

    本文导读: C#的预处理器指令从来不会转化为可执行代码的命令,但是会影响编译过程的各个方面,常用的预处理器指令有#define.#undef.#if,#elif,#else和#endif等等,下面介绍 ...

  2. bzoj1503--treap

    这道题和一般的题目不同,A和S操作要修改所有节点.所以定义基准d,每个节点的工资是它的值+d,这样就能完成所有操作. I k:将值为k-d的节点插入treap A k:将d加上k S k:将d减去k, ...

  3. hdu-2444-二分图判定+最大分配

    The Accomodation of Students Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K ( ...

  4. entityframework学习笔记--006-表拆分与实体拆分

    1.1 拆分实体到多张表 假设你有如下表,如图6-1.Product表用于存储商品的字符类信息,ProductWebInfo用于存储商品的图片,两张表通过SKU关联.现在你想把两张表的信息整合到一个实 ...

  5. IIS服务器和xampp中的appche服务器端口冲突解决办法

    今天在启动xampp中的appche的时候,发现以前能起来的现在起不来了.想到可能是最近配置的系统自带的IIS服务器把appche的端口给占用了. (appche和iis的默认端口号都是:80:) 问 ...

  6. ES6笔记(一):ES6所改良的javascript“缺陷”

    块级作用域 ES5没有块级作用域,只有全局作用域和函数作用域,由于这一点,变量的作用域甚广,所以一进入函数就要马上将它创建出来.这就造成了所谓的变量提升. ES5的"变量提升"这一 ...

  7. Linux-ssh配置

  8. 学习笔记 MYSQL报错注入(count()、rand()、group by)

    首先看下常见的攻击载荷,如下: select count(*),(floor(rand(0)*2))x from table group by x; 然后对于攻击载荷进行解释, floor(rand( ...

  9. PyCharm断点调试django

    我在用PyCharm开发django程序的时候,对于打印日志调试程序的方式感觉还是有点麻烦和不直观,所以研究了一下断点调试的方法如下: 1.打开你的工程,在菜单栏里找到Run-->Edit Co ...

  10. iOS平台UDID方案比较

    苹果在iOS6中禁用了[UIDevice uniqueIdentifier],在iOS7中又把mac地址的获取给堵上了.没办法,毕竟人家是老大,说不让你用,你也没办法.在这边总结一下现有的一部分UDI ...