大众点评登录js分析(复杂)

文章目录

          • 1. 网址
          • 2. 登录地址
          • 3. 全局搜索`encryptPassword`
          • 4. 定义入口函数
          • 5. 源码

1. 网址

https://account.dianping.com/login?redir=http%3A%2F%2Fwww.dianping.com%2Fguangzhou

2. 登录地址

大众点评登录js分析(复杂)_第1张图片

3. 全局搜索encryptPassword

大众点评登录js分析(复杂)_第2张图片
点击进入js文件

大众点评登录js分析(复杂)_第3张图片
此处便是加密逻辑代码

4. 定义入口函数
function getpwd(password, uuid) {
// 模拟加密参数格式
var str = '[' + password + ',' + uuid + ']'
var r = new s;
r.setPublicKey("MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCZItlBTz8KiqzInZ0r84ImFcHVKefMMskRfnnU4C5D+YndbXq1GdVviCnfFz8GDGpHgm1fRi03ThQqBs7njXf9qkKcRZeCXdHEwJ5s7jCuPQSrn+tBxtYOpN6Db7QufTbiKj5m35VMVzIa4QvcUzG1KJWawc79+JAJz4Re6n3tAwIDAQAB");
return r.encrypt(str);
}
5. 源码
navigator = {};
window = this;

var JSEncrypt = {}; (function(t) {
function e(t, e, i) {
    null != t && ("number" == typeof t ? this.fromNumber(t, e, i) : null == e && "string" != typeof t ? this.fromString(t, 256) : this.fromString(t, e))
}
function i() {
    return new e(null)
}
function r(t) {
    return V.charAt(t)
}
function n(t, e) {
    var i = N[t.charCodeAt(e)];
    return null == i ? -1 : i
}
function s(t) {
    var e = i();
    return e.fromInt(t),
    e
}
function o(t) {
    var e, i = 1;
    return 0 != (e = t >>> 16) && (t = e, i += 16),
    0 != (e = t >> 8) && (t = e, i += 8),
    0 != (e = t >> 4) && (t = e, i += 4),
    0 != (e = t >> 2) && (t = e, i += 2),
    0 != (e = t >> 1) && (t = e, i += 1),
    i
}
function a(t) {
    this.m = t
}
function u(t) {
    this.m = t,
    this.mp = t.invDigit(),
    this.mpl = 32767 & this.mp,
    this.mph = this.mp >> 15,
    this.um = (1 << t.DB - 15) - 1,
    this.mt2 = 2 * t.t
}
function c(t, e) {
    return t & e
}
function l(t, e) {
    return t | e
}
function f(t, e) {
    return t ^ e
}
function p(t, e) {
    return t & ~e
}
function d(t) {
    if (0 == t) return - 1;
    var e = 0;
    return 0 == (65535 & t) && (t >>= 16, e += 16),
    0 == (255 & t) && (t >>= 8, e += 8),
    0 == (15 & t) && (t >>= 4, e += 4),
    0 == (3 & t) && (t >>= 2, e += 2),
    0 == (1 & t) && ++e,
    e
}
function g(t) {
    for (var e = 0; 0 != t;) t &= t - 1,
    ++e;
    return e
}
function m() {}
function y(t) {
    return t
}
function b(t) {
    this.r2 = i(),
    this.q3 = i(),
    e.ONE.dlShiftTo(2 * t.t, this.r2),
    this.mu = this.r2.divide(t),
    this.m = t
}
function T() {
    this.i = 0,
    this.j = 0,
    this.S = new Array
}
function w() {
    if (null == M) {
        for (M = new T; L < q;) {
            var t = Math.floor(65536 * Math.random());
            P[L++] = 255 & t
        }
        for (M.init(P), L = 0; L < P.length; ++L) P[L] = 0;
        L = 0
    }
    return M.next()
}
function S() {}
function E(t, i) {
    return new e(t, i)
}
function x() {
    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 D(t) {
    var e, i, r = "";
    for (e = 0; e + 3 <= t.length; e += 3) i = parseInt(t.substring(e, e + 3), 16),
    r += _.charAt(i >> 6) + _.charAt(63 & i);
    for (e + 1 == t.length ? (i = parseInt(t.substring(e, e + 1), 16), r += _.charAt(i << 2)) : e + 2 == t.length && (i = parseInt(t.substring(e, e + 2), 16), r += _.charAt(i >> 2) + _.charAt((3 & i) << 4)); (3 & r.length) > 0;) r += F;
    return r
}
function O(t) {
    var e, i, n = "",
    s = 0;
    for (e = 0; e < t.length && t.charAt(e) != F; ++e) v = _.indexOf(t.charAt(e)),
    v < 0 || (0 == s ? (n += r(v >> 2), i = 3 & v, s = 1) : 1 == s ? (n += r(i << 2 | v >> 4), i = 15 & v, s = 2) : 2 == s ? (n += r(i), n += r(v >> 2), i = 3 & v, s = 3) : (n += r(i << 2 | v >> 4), n += r(15 & v), s = 0));
    return 1 == s && (n += r(i << 2)),
    n
}
var B;
"Microsoft Internet Explorer" == navigator.appName ? (e.prototype.am = function(t, e, i, r, n, s) {
    for (var o = 32767 & e,
    a = e >> 15; --s >= 0;) {
        var h = 32767 & this[t],
        u = this[t++] >> 15,
        c = a * h + u * o;
        h = o * h + ((32767 & c) << 15) + i[r] + (1073741823 & n),
        n = (h >>> 30) + (c >>> 15) + a * u + (n >>> 30),
        i[r++] = 1073741823 & h
    }
    return n
},
B = 30) : "Netscape" != navigator.appName ? (e.prototype.am = function(t, e, i, r, n, s) {
    for (; --s >= 0;) {
        var o = e * this[t++] + i[r] + n;
        n = Math.floor(o / 67108864),
        i[r++] = 67108863 & o
    }
    return n
},
B = 26) : (e.prototype.am = function(t, e, i, r, n, s) {
    for (var o = 16383 & e,
    a = e >> 14; --s >= 0;) {
        var h = 16383 & this[t],
        u = this[t++] >> 14,
        c = a * h + u * o;
        h = o * h + ((16383 & c) << 14) + i[r] + n,
        n = (h >> 28) + (c >> 14) + a * u,
        i[r++] = 268435455 & h
    }
    return n
},
B = 28),
e.prototype.DB = B,
e.prototype.DM = (1 << B) - 1,
e.prototype.DV = 1 << B,
e.prototype.FV = Math.pow(2, 52),
e.prototype.F1 = 52 - B,
e.prototype.F2 = 2 * B - 52;
var A, R, V = "0123456789abcdefghijklmnopqrstuvwxyz",
N = new Array;
for (A = "0".charCodeAt(0), R = 0; R <= 9; ++R) N[A++] = R;
for (A = "a".charCodeAt(0), R = 10; R < 36; ++R) N[A++] = R;
for (A = "A".charCodeAt(0), R = 10; R < 36; ++R) N[A++] = R;
a.prototype.convert = function(t) {
    return t.s < 0 || t.compareTo(this.m) >= 0 ? t.mod(this.m) : t
},
a.prototype.revert = function(t) {
    return t
},
a.prototype.reduce = function(t) {
    t.divRemTo(this.m, null, t)
},
a.prototype.mulTo = function(t, e, i) {
    t.multiplyTo(e, i),
    this.reduce(i)
},
a.prototype.sqrTo = function(t, e) {
    t.squareTo(e),
    this.reduce(e)
},
u.prototype.convert = function(t) {
    var r = i();
    return t.abs().dlShiftTo(this.m.t, r),
    r.divRemTo(this.m, null, r),
    t.s < 0 && r.compareTo(e.ZERO) > 0 && this.m.subTo(r, r),
    r
},
u.prototype.revert = function(t) {
    var e = i();
    return t.copyTo(e),
    this.reduce(e),
    e
},
u.prototype.reduce = function(t) {
    for (; t.t <= this.mt2;) t[t.t++] = 0;
    for (var e = 0; e < this.m.t; ++e) {
        var i = 32767 & t[e],
        r = i * this.mpl + ((i * this.mph + (t[e] >> 15) * this.mpl & this.um) << 15) & t.DM;
        for (i = e + this.m.t, t[i] += this.m.am(0, r, t, e, 0, this.m.t); t[i] >= t.DV;) t[i] -= t.DV,
        t[++i]++
    }
    t.clamp(),
    t.drShiftTo(this.m.t, t),
    t.compareTo(this.m) >= 0 && t.subTo(this.m, t)
},
u.prototype.mulTo = function(t, e, i) {
    t.multiplyTo(e, i),
    this.reduce(i)
},
u.prototype.sqrTo = function(t, e) {
    t.squareTo(e),
    this.reduce(e)
},
e.prototype.copyTo = function(t) {
    for (var e = this.t - 1; e >= 0; --e) t[e] = this[e];
    t.t = this.t,
    t.s = this.s
},
e.prototype.fromInt = function(t) {
    this.t = 1,
    this.s = t < 0 ? -1 : 0,
    t > 0 ? this[0] = t: t < -1 ? this[0] = t + this.DV: this.t = 0
},
e.prototype.fromString = function(t, i) {
    var r;
    if (16 == i) r = 4;
    else if (8 == i) r = 3;
    else if (256 == i) r = 8;
    else if (2 == i) r = 1;
    else if (32 == i) r = 5;
    else {
        if (4 != i) return void this.fromRadix(t, i);
        r = 2
    }
    this.t = 0,
    this.s = 0;
    for (var s = t.length,
    o = !1,
    a = 0; --s >= 0;) {
        var h = 8 == r ? 255 & t[s] : n(t, s);
        h < 0 ? "-" == t.charAt(s) && (o = !0) : (o = !1, 0 == a ? this[this.t++] = h: a + r > this.DB ? (this[this.t - 1] |= (h & (1 << this.DB - a) - 1) << a, this[this.t++] = h >> this.DB - a) : this[this.t - 1] |= h << a, (a += r) >= this.DB && (a -= this.DB))
    }
    8 == r && 0 != (128 & t[0]) && (this.s = -1, a > 0 && (this[this.t - 1] |= (1 << this.DB - a) - 1 << a)),
    this.clamp(),
    o && e.ZERO.subTo(this, this)
},
e.prototype.clamp = function() {
    for (var t = this.s & this.DM; this.t > 0 && this[this.t - 1] == t;)--this.t
},
e.prototype.dlShiftTo = function(t, e) {
    var i;
    for (i = this.t - 1; i >= 0; --i) e[i + t] = this[i];
    for (i = t - 1; i >= 0; --i) e[i] = 0;
    e.t = this.t + t,
    e.s = this.s
},
e.prototype.drShiftTo = function(t, e) {
    for (var i = t; i < this.t; ++i) e[i - t] = this[i];
    e.t = Math.max(this.t - t, 0),
    e.s = this.s
},
e.prototype.lShiftTo = function(t, e) {
    var i, r = t % this.DB,
    n = this.DB - r,
    s = (1 << n) - 1,
    o = Math.floor(t / this.DB),
    a = this.s << r & this.DM;
    for (i = this.t - 1; i >= 0; --i) e[i + o + 1] = this[i] >> n | a,
    a = (this[i] & s) << r;
    for (i = o - 1; i >= 0; --i) e[i] = 0;
    e[o] = a,
    e.t = this.t + o + 1,
    e.s = this.s,
    e.clamp()
},
e.prototype.rShiftTo = function(t, e) {
    e.s = this.s;
    var i = Math.floor(t / this.DB);
    if (i >= this.t) e.t = 0;
    else {
        var r = t % this.DB,
        n = this.DB - r,
        s = (1 << r) - 1;
        e[0] = this[i] >> r;
        for (var o = i + 1; o < this.t; ++o) e[o - i - 1] |= (this[o] & s) << n,
        e[o - i] = this[o] >> r;
        r > 0 && (e[this.t - i - 1] |= (this.s & s) << n),
        e.t = this.t - i,
        e.clamp()
    }
},
e.prototype.subTo = function(t, e) {
    for (var i = 0,
    r = 0,
    n = Math.min(t.t, this.t); i < n;) r += this[i] - t[i],
    e[i++] = r & this.DM,
    r >>= this.DB;
    if (t.t < this.t) {
        for (r -= t.s; i < this.t;) r += this[i],
        e[i++] = r & this.DM,
        r >>= this.DB;
        r += this.s
    } else {
        for (r += this.s; i < t.t;) r -= t[i],
        e[i++] = r & this.DM,
        r >>= this.DB;
        r -= t.s
    }
    e.s = r < 0 ? -1 : 0,
    r < -1 ? e[i++] = this.DV + r: r > 0 && (e[i++] = r),
    e.t = i,
    e.clamp()
},
e.prototype.multiplyTo = function(t, i) {
    var r = this.abs(),
    n = t.abs(),
    s = r.t;
    for (i.t = s + n.t; --s >= 0;) i[s] = 0;
    for (s = 0; s < n.t; ++s) i[s + r.t] = r.am(0, n[s], i, s, 0, r.t);
    i.s = 0,
    i.clamp(),
    this.s != t.s && e.ZERO.subTo(i, i)
},
e.prototype.squareTo = function(t) {
    for (var e = this.abs(), i = t.t = 2 * e.t; --i >= 0;) t[i] = 0;
    for (i = 0; i < e.t - 1; ++i) {
        var r = e.am(i, e[i], t, 2 * i, 0, 1); (t[i + e.t] += e.am(i + 1, 2 * e[i], t, 2 * i + 1, r, e.t - i - 1)) >= e.DV && (t[i + e.t] -= e.DV, t[i + e.t + 1] = 1)
    }
    t.t > 0 && (t[t.t - 1] += e.am(i, e[i], t, 2 * i, 0, 1)),
    t.s = 0,
    t.clamp()
},
e.prototype.divRemTo = function(t, r, n) {
    var s = t.abs();
    if (! (s.t <= 0)) {
        var a = this.abs();
        if (a.t < s.t) return null != r && r.fromInt(0),
        void(null != n && this.copyTo(n));
        null == n && (n = i());
        var h = i(),
        u = this.s,
        c = t.s,
        l = this.DB - o(s[s.t - 1]);
        l > 0 ? (s.lShiftTo(l, h), a.lShiftTo(l, n)) : (s.copyTo(h), a.copyTo(n));
        var f = h.t,
        p = h[f - 1];
        if (0 != p) {
            var d = p * (1 << this.F1) + (f > 1 ? h[f - 2] >> this.F2: 0),
            g = this.FV / d,
            m = (1 << this.F1) / d,
            v = 1 << this.F2,
            y = n.t,
            b = y - f,
            T = null == r ? i() : r;
            for (h.dlShiftTo(b, T), n.compareTo(T) >= 0 && (n[n.t++] = 1, n.subTo(T, n)), e.ONE.dlShiftTo(f, T), T.subTo(h, h); h.t < f;) h[h.t++] = 0;
            for (; --b >= 0;) {
                var w = n[--y] == p ? this.DM: Math.floor(n[y] * g + (n[y - 1] + v) * m);
                if ((n[y] += h.am(0, w, n, b, 0, f)) < w) for (h.dlShiftTo(b, T), n.subTo(T, n); n[y] < --w;) n.subTo(T, n)
            }
            null != r && (n.drShiftTo(f, r), u != c && e.ZERO.subTo(r, r)),
            n.t = f,
            n.clamp(),
            l > 0 && n.rShiftTo(l, n),
            u < 0 && e.ZERO.subTo(n, n)
        }
    }
},
e.prototype.invDigit = function() {
    if (this.t < 1) return 0;
    var t = this[0];
    if (0 == (1 & t)) return 0;
    var e = 3 & t;
    return (e = (e = (e = (e = e * (2 - (15 & t) * e) & 15) * (2 - (255 & t) * e) & 255) * (2 - ((65535 & t) * e & 65535)) & 65535) * (2 - t * e % this.DV) % this.DV) > 0 ? this.DV - e: -e
},
e.prototype.isEven = function() {
    return 0 == (this.t > 0 ? 1 & this[0] : this.s)
},
e.prototype.exp = function(t, r) {
    if (t > 4294967295 || t < 1) return e.ONE;
    var n = i(),
    s = i(),
    a = r.convert(this),
    h = o(t) - 1;
    for (a.copyTo(n); --h >= 0;) if (r.sqrTo(n, s), (t & 1 << h) > 0) r.mulTo(s, a, n);
    else {
        var u = n;
        n = s,
        s = u
    }
    return r.revert(n)
},
e.prototype.toString = function(t) {
    if (this.s < 0) return "-" + this.negate().toString(t);
    var e;
    if (16 == t) e = 4;
    else if (8 == t) e = 3;
    else if (2 == t) e = 1;
    else if (32 == t) e = 5;
    else {
        if (4 != t) return this.toRadix(t);
        e = 2
    }
    var i, n = (1 << e) - 1,
    s = !1,
    o = "",
    a = this.t,
    h = this.DB - a * this.DB % e;
    if (a-->0) for (h < this.DB && (i = this[a] >> h) > 0 && (s = !0, o = r(i)); a >= 0;) h < e ? (i = (this[a] & (1 << h) - 1) << e - h, i |= this[--a] >> (h += this.DB - e)) : (i = this[a] >> (h -= e) & n, h <= 0 && (h += this.DB, --a)),
    i > 0 && (s = !0),
    s && (o += r(i));
    return s ? o: "0"
},
e.prototype.negate = function() {
    var t = i();
    return e.ZERO.subTo(this, t),
    t
},
e.prototype.abs = function() {
    return this.s < 0 ? this.negate() : this
},
e.prototype.compareTo = function(t) {
    var e = this.s - t.s;
    if (0 != e) return e;
    var i = this.t;
    if (0 != (e = i - t.t)) return this.s < 0 ? -e: e;
    for (; --i >= 0;) if (0 != (e = this[i] - t[i])) return e;
    return 0
},
e.prototype.bitLength = function() {
    return this.t <= 0 ? 0 : this.DB * (this.t - 1) + o(this[this.t - 1] ^ this.s & this.DM)
},
e.prototype.mod = function(t) {
    var r = i();
    return this.abs().divRemTo(t, null, r),
    this.s < 0 && r.compareTo(e.ZERO) > 0 && t.subTo(r, r),
    r
},
e.prototype.modPowInt = function(t, e) {
    var i;
    return i = t < 256 || e.isEven() ? new a(e) : new u(e),
    this.exp(t, i)
},
e.ZERO = s(0),
e.ONE = s(1),
m.prototype.convert = y,
m.prototype.revert = y,
m.prototype.mulTo = function(t, e, i) {
    t.multiplyTo(e, i)
},
m.prototype.sqrTo = function(t, e) {
    t.squareTo(e)
},
b.prototype.convert = function(t) {
    if (t.s < 0 || t.t > 2 * this.m.t) return t.mod(this.m);
    if (t.compareTo(this.m) < 0) return t;
    var e = i();
    return t.copyTo(e),
    this.reduce(e),
    e
},
b.prototype.revert = function(t) {
    return t
},
b.prototype.reduce = function(t) {
    for (t.drShiftTo(this.m.t - 1, this.r2), t.t > this.m.t + 1 && (t.t = this.m.t + 1, t.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); t.compareTo(this.r2) < 0;) t.dAddOffset(1, this.m.t + 1);
    for (t.subTo(this.r2, t); t.compareTo(this.m) >= 0;) t.subTo(this.m, t)
},
b.prototype.mulTo = function(t, e, i) {
    t.multiplyTo(e, i),
    this.reduce(i)
},
b.prototype.sqrTo = function(t, e) {
    t.squareTo(e),
    this.reduce(e)
};
var C = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997],
I = (1 << 26) / C[C.length - 1];
e.prototype.chunkSize = function(t) {
    return Math.floor(Math.LN2 * this.DB / Math.log(t))
},
e.prototype.toRadix = function(t) {
    if (null == t && (t = 10), 0 == this.signum() || t < 2 || t > 36) return "0";
    var e = this.chunkSize(t),
    r = Math.pow(t, e),
    n = s(r),
    o = i(),
    a = i(),
    h = "";
    for (this.divRemTo(n, o, a); o.signum() > 0;) h = (r + a.intValue()).toString(t).substr(1) + h,
    o.divRemTo(n, o, a);
    return a.intValue().toString(t) + h
},
e.prototype.fromRadix = function(t, i) {
    this.fromInt(0),
    null == i && (i = 10);
    for (var r = this.chunkSize(i), s = Math.pow(i, r), o = !1, a = 0, h = 0, u = 0; u < t.length; ++u) {
        var c = n(t, u);
        c < 0 ? "-" == t.charAt(u) && 0 == this.signum() && (o = !0) : (h = i * h + c, ++a >= r && (this.dMultiply(s), this.dAddOffset(h, 0), a = 0, h = 0))
    }
    a > 0 && (this.dMultiply(Math.pow(i, a)), this.dAddOffset(h, 0)),
    o && e.ZERO.subTo(this, this)
},
e.prototype.fromNumber = function(t, i, r) {
    if ("number" == typeof i) if (t < 2) this.fromInt(1);
    else for (this.fromNumber(t, r), this.testBit(t - 1) || this.bitwiseTo(e.ONE.shiftLeft(t - 1), l, this), this.isEven() && this.dAddOffset(1, 0); ! this.isProbablePrime(i);) this.dAddOffset(2, 0),
    this.bitLength() > t && this.subTo(e.ONE.shiftLeft(t - 1), this);
    else {
        var n = new Array,
        s = 7 & t;
        n.length = 1 + (t >> 3),
        i.nextBytes(n),
        s > 0 ? n[0] &= (1 << s) - 1 : n[0] = 0,
        this.fromString(n, 256)
    }
},
e.prototype.bitwiseTo = function(t, e, i) {
    var r, n, s = Math.min(t.t, this.t);
    for (r = 0; r < s; ++r) i[r] = e(this[r], t[r]);
    if (t.t < this.t) {
        for (n = t.s & this.DM, r = s; r < this.t; ++r) i[r] = e(this[r], n);
        i.t = this.t
    } else {
        for (n = this.s & this.DM, r = s; r < t.t; ++r) i[r] = e(n, t[r]);
        i.t = t.t
    }
    i.s = e(this.s, t.s),
    i.clamp()
},
e.prototype.changeBit = function(t, i) {
    var r = e.ONE.shiftLeft(t);
    return this.bitwiseTo(r, i, r),
    r
},
e.prototype.addTo = function(t, e) {
    for (var i = 0,
    r = 0,
    n = Math.min(t.t, this.t); i < n;) r += this[i] + t[i],
    e[i++] = r & this.DM,
    r >>= this.DB;
    if (t.t < this.t) {
        for (r += t.s; i < this.t;) r += this[i],
        e[i++] = r & this.DM,
        r >>= this.DB;
        r += this.s
    } else {
        for (r += this.s; i < t.t;) r += t[i],
        e[i++] = r & this.DM,
        r >>= this.DB;
        r += t.s
    }
    e.s = r < 0 ? -1 : 0,
    r > 0 ? e[i++] = r: r < -1 && (e[i++] = this.DV + r),
    e.t = i,
    e.clamp()
},
e.prototype.dMultiply = function(t) {
    this[this.t] = this.am(0, t - 1, this, 0, 0, this.t),
    ++this.t,
    this.clamp()
},
e.prototype.dAddOffset = function(t, e) {
    if (0 != t) {
        for (; this.t <= e;) this[this.t++] = 0;
        for (this[e] += t; this[e] >= this.DV;) this[e] -= this.DV,
        ++e >= this.t && (this[this.t++] = 0),
        ++this[e]
    }
},
e.prototype.multiplyLowerTo = function(t, e, i) {
    var r, n = Math.min(this.t + t.t, e);
    for (i.s = 0, i.t = n; n > 0;) i[--n] = 0;
    for (r = i.t - this.t; n < r; ++n) i[n + this.t] = this.am(0, t[n], i, n, 0, this.t);
    for (r = Math.min(t.t, e); n < r; ++n) this.am(0, t[n], i, n, 0, e - n);
    i.clamp()
},
e.prototype.multiplyUpperTo = function(t, e, i) {--e;
    var r = i.t = this.t + t.t - e;
    for (i.s = 0; --r >= 0;) i[r] = 0;
    for (r = Math.max(e - this.t, 0); r < t.t; ++r) i[this.t + r - e] = this.am(e - r, t[r], i, 0, 0, this.t + r - e);
    i.clamp(),
    i.drShiftTo(1, i)
},
e.prototype.modInt = function(t) {
    if (t <= 0) return 0;
    var e = this.DV % t,
    i = this.s < 0 ? t - 1 : 0;
    if (this.t > 0) if (0 == e) i = this[0] % t;
    else for (var r = this.t - 1; r >= 0; --r) i = (e * i + this[r]) % t;
    return i
},
e.prototype.millerRabin = function(t) {
    var r = this.subtract(e.ONE),
    n = r.getLowestSetBit();
    if (n <= 0) return ! 1;
    var s = r.shiftRight(n); (t = t + 1 >> 1) > C.length && (t = C.length);
    for (var o = i(), a = 0; a < t; ++a) {
        o.fromInt(C[Math.floor(Math.random() * C.length)]);
        var h = o.modPow(s, this);
        if (0 != h.compareTo(e.ONE) && 0 != h.compareTo(r)) {
            for (var u = 1; u++<n && 0 != h.compareTo(r);) if (0 == (h = h.modPowInt(2, this)).compareTo(e.ONE)) return ! 1;
            if (0 != h.compareTo(r)) return ! 1
        }
    }
    return ! 0
},
e.prototype.clone = function() {
    var t = i();
    return this.copyTo(t),
    t
},
e.prototype.intValue = function() {
    if (this.s < 0) {
        if (1 == this.t) return this[0] - this.DV;
        if (0 == this.t) return - 1
    } else {
        if (1 == this.t) return this[0];
        if (0 == this.t) return 0
    }
    return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0]
},
e.prototype.byteValue = function() {
    return 0 == this.t ? this.s: this[0] << 24 >> 24
},
e.prototype.shortValue = function() {
    return 0 == this.t ? this.s: this[0] << 16 >> 16
},
e.prototype.signum = function() {
    return this.s < 0 ? -1 : this.t <= 0 || 1 == this.t && this[0] <= 0 ? 0 : 1
},
e.prototype.toByteArray = function() {
    var t = this.t,
    e = new Array;
    e[0] = this.s;
    var i, r = this.DB - t * this.DB % 8,
    n = 0;
    if (t-->0) for (r < this.DB && (i = this[t] >> r) != (this.s & this.DM) >> r && (e[n++] = i | this.s << this.DB - r); t >= 0;) r < 8 ? (i = (this[t] & (1 << r) - 1) << 8 - r, i |= this[--t] >> (r += this.DB - 8)) : (i = this[t] >> (r -= 8) & 255, r <= 0 && (r += this.DB, --t)),
    0 != (128 & i) && (i |= -256),
    0 == n && (128 & this.s) != (128 & i) && ++n,
    (n > 0 || i != this.s) && (e[n++] = i);
    return e
},
e.prototype.equals = function(t) {
    return 0 == this.compareTo(t)
},
e.prototype.min = function(t) {
    return this.compareTo(t) < 0 ? this: t
},
e.prototype.max = function(t) {
    return this.compareTo(t) > 0 ? this: t
},
e.prototype.and = function(t) {
    var e = i();
    return this.bitwiseTo(t, c, e),
    e
},
e.prototype.or = function(t) {
    var e = i();
    return this.bitwiseTo(t, l, e),
    e
},
e.prototype.xor = function(t) {
    var e = i();
    return this.bitwiseTo(t, f, e),
    e
},
e.prototype.andNot = function(t) {
    var e = i();
    return this.bitwiseTo(t, p, e),
    e
},
e.prototype.not = function() {
    for (var t = i(), e = 0; e < this.t; ++e) t[e] = this.DM & ~this[e];
    return t.t = this.t,
    t.s = ~this.s,
    t
},
e.prototype.shiftLeft = function(t) {
    var e = i();
    return t < 0 ? this.rShiftTo( - t, e) : this.lShiftTo(t, e),
    e
},
e.prototype.shiftRight = function(t) {
    var e = i();
    return t < 0 ? this.lShiftTo( - t, e) : this.rShiftTo(t, e),
    e
},
e.prototype.getLowestSetBit = function() {
    for (var t = 0; t < this.t; ++t) if (0 != this[t]) return t * this.DB + d(this[t]);
    return this.s < 0 ? this.t * this.DB: -1
},
e.prototype.bitCount = function() {
    for (var t = 0,
    e = this.s & this.DM,
    i = 0; i < this.t; ++i) t += g(this[i] ^ e);
    return t
},
e.prototype.testBit = function(t) {
    var e = Math.floor(t / this.DB);
    return e >= this.t ? 0 != this.s: 0 != (this[e] & 1 << t % this.DB)
},
e.prototype.setBit = function(t) {
    return this.changeBit(t, l)
},
e.prototype.clearBit = function(t) {
    return this.changeBit(t, p)
},
e.prototype.flipBit = function(t) {
    return this.changeBit(t, f)
},
e.prototype.add = function(t) {
    var e = i();
    return this.addTo(t, e),
    e
},
e.prototype.subtract = function(t) {
    var e = i();
    return this.subTo(t, e),
    e
},
e.prototype.multiply = function(t) {
    var e = i();
    return this.multiplyTo(t, e),
    e
},
e.prototype.divide = function(t) {
    var e = i();
    return this.divRemTo(t, e, null),
    e
},
e.prototype.remainder = function(t) {
    var e = i();
    return this.divRemTo(t, null, e),
    e
},
e.prototype.divideAndRemainder = function(t) {
    var e = i(),
    r = i();
    return this.divRemTo(t, e, r),
    new Array(e, r)
},
e.prototype.modPow = function(t, e) {
    var r, n, h = t.bitLength(),
    c = s(1);
    if (h <= 0) return c;
    r = h < 18 ? 1 : h < 48 ? 3 : h < 144 ? 4 : h < 768 ? 5 : 6,
    n = h < 8 ? new a(e) : e.isEven() ? new b(e) : new u(e);
    var l = new Array,
    f = 3,
    p = r - 1,
    d = (1 << r) - 1;
    if (l[1] = n.convert(this), r > 1) {
        var g = i();
        for (n.sqrTo(l[1], g); f <= d;) l[f] = i(),
        n.mulTo(g, l[f - 2], l[f]),
        f += 2
    }
    var m, v, y = t.t - 1,
    T = !0,
    w = i();
    for (h = o(t[y]) - 1; y >= 0;) {
        for (h >= p ? m = t[y] >> h - p & d: (m = (t[y] & (1 << h + 1) - 1) << p - h, y > 0 && (m |= t[y - 1] >> this.DB + h - p)), f = r; 0 == (1 & m);) m >>= 1,
        --f;
        if ((h -= f) < 0 && (h += this.DB, --y), T) l[m].copyTo(c),
        T = !1;
        else {
            for (; f > 1;) n.sqrTo(c, w),
            n.sqrTo(w, c),
            f -= 2;
            f > 0 ? n.sqrTo(c, w) : (v = c, c = w, w = v),
            n.mulTo(w, l[m], c)
        }
        for (; y >= 0 && 0 == (t[y] & 1 << h);) n.sqrTo(c, w),
        v = c,
        c = w,
        w = v,
        --h < 0 && (h = this.DB - 1, --y)
    }
    return n.revert(c)
},
e.prototype.modInverse = function(t) {
    var i = t.isEven();
    if (this.isEven() && i || 0 == t.signum()) return e.ZERO;
    for (var r = t.clone(), n = this.clone(), o = s(1), a = s(0), h = s(0), u = s(1); 0 != r.signum();) {
        for (; r.isEven();) r.rShiftTo(1, r),
        i ? (o.isEven() && a.isEven() || (o.addTo(this, o), a.subTo(t, a)), o.rShiftTo(1, o)) : a.isEven() || a.subTo(t, a),
        a.rShiftTo(1, a);
        for (; n.isEven();) n.rShiftTo(1, n),
        i ? (h.isEven() && u.isEven() || (h.addTo(this, h), u.subTo(t, u)), h.rShiftTo(1, h)) : u.isEven() || u.subTo(t, u),
        u.rShiftTo(1, u);
        r.compareTo(n) >= 0 ? (r.subTo(n, r), i && o.subTo(h, o), a.subTo(u, a)) : (n.subTo(r, n), i && h.subTo(o, h), u.subTo(a, u))
    }
    return 0 != n.compareTo(e.ONE) ? e.ZERO: u.compareTo(t) >= 0 ? u.subtract(t) : u.signum() < 0 ? (u.addTo(t, u), u.signum() < 0 ? u.add(t) : u) : u
},
e.prototype.pow = function(t) {
    return this.exp(t, new m)
},
e.prototype.gcd = function(t) {
    var e = this.s < 0 ? this.negate() : this.clone(),
    i = t.s < 0 ? t.negate() : t.clone();
    if (e.compareTo(i) < 0) {
        var r = e;
        e = i,
        i = r
    }
    var n = e.getLowestSetBit(),
    s = i.getLowestSetBit();
    if (s < 0) return e;
    for (n < s && (s = n), s > 0 && (e.rShiftTo(s, e), i.rShiftTo(s, i)); e.signum() > 0;)(n = e.getLowestSetBit()) > 0 && e.rShiftTo(n, e),
    (n = i.getLowestSetBit()) > 0 && i.rShiftTo(n, i),
    e.compareTo(i) >= 0 ? (e.subTo(i, e), e.rShiftTo(1, e)) : (i.subTo(e, i), i.rShiftTo(1, i));
    return s > 0 && i.lShiftTo(s, i),
    i
},
e.prototype.isProbablePrime = function(t) {
    var e, i = this.abs();
    if (1 == i.t && i[0] <= C[C.length - 1]) {
        for (e = 0; e < C.length; ++e) if (i[0] == C[e]) return ! 0;
        return ! 1
    }
    if (i.isEven()) return ! 1;
    for (e = 1; e < C.length;) {
        for (var r = C[e], n = e + 1; n < C.length && r < I;) r *= C[n++];
        for (r = i.modInt(r); e < n;) if (r % C[e++] == 0) return ! 1
    }
    return i.millerRabin(t)
},
e.prototype.square = function() {
    var t = i();
    return this.squareTo(t),
    t
},
T.prototype.init = function(t) {
    var e, i, r;
    for (e = 0; e < 256; ++e) this.S[e] = e;
    for (i = 0, e = 0; e < 256; ++e) i = i + this.S[e] + t[e % t.length] & 255,
    r = this.S[e],
    this.S[e] = this.S[i],
    this.S[i] = r;
    this.i = 0,
    this.j = 0
},
T.prototype.next = function() {
    var t;
    return this.i = this.i + 1 & 255,
    this.j = this.j + this.S[this.i] & 255,
    t = this.S[this.i],
    this.S[this.i] = this.S[this.j],
    this.S[this.j] = t,
    this.S[t + this.S[this.i] & 255]
};
var M, P, L, q = 256;
if (null == P) {
    var k;
    if (P = new Array, L = 0, window.crypto && window.crypto.getRandomValues) {
        var H = new Uint32Array(256);
        for (window.crypto.getRandomValues(H), k = 0; k < H.length; ++k) P[L++] = 255 & H[k]
    }
    var j = function t(e) {
        if (this.count = this.count || 0, this.count >= 256 || L >= q) window.removeEventListener ? window.removeEventListener("mousemove", t, !1) : window.detachEvent && window.detachEvent("onmousemove", t);
        else try {
            var i = e.x + e.y;
            P[L++] = 255 & i,
            this.count += 1
        } catch(t) {}
    };
    window.addEventListener ? window.addEventListener("mousemove", j, !1) : window.attachEvent && window.attachEvent("onmousemove", j)
}
S.prototype.nextBytes = function(t) {
    var e;
    for (e = 0; e < t.length; ++e) t[e] = w()
},
x.prototype.doPublic = function(t) {
    return t.modPowInt(this.e, this.n)
},
x.prototype.setPublic = function(t, e) {
    null != t && null != e && t.length > 0 && e.length > 0 && (this.n = E(t, 16), this.e = parseInt(e, 16))
},
x.prototype.encrypt = function(t) {
    var i = function(t, i) {
        if (i < t.length + 11) return null;
        for (var r = new Array,
        n = t.length - 1; n >= 0 && i > 0;) {
            var s = t.charCodeAt(n--);
            s < 128 ? r[--i] = s: s > 127 && s < 2048 ? (r[--i] = 63 & s | 128, r[--i] = s >> 6 | 192) : (r[--i] = 63 & s | 128, r[--i] = s >> 6 & 63 | 128, r[--i] = s >> 12 | 224)
        }
        r[--i] = 0;
        for (var o = new S,
        a = new Array; i > 2;) {
            for (a[0] = 0; 0 == a[0];) o.nextBytes(a);
            r[--i] = a[0]
        }
        return r[--i] = 2,
        r[--i] = 0,
        new e(r)
    } (t, this.n.bitLength() + 7 >> 3);
    if (null == i) return null;
    var r = this.doPublic(i);
    if (null == r) return null;
    var n = r.toString(16);
    return 0 == (1 & n.length) ? n: "0" + n
},
x.prototype.doPrivate = function(t) {
    if (null == this.p || null == this.q) return t.modPow(this.d, this.n);
    for (var e = t.mod(this.p).modPow(this.dmp1, this.p), i = t.mod(this.q).modPow(this.dmq1, this.q); e.compareTo(i) < 0;) e = e.add(this.p);
    return e.subtract(i).multiply(this.coeff).mod(this.p).multiply(this.q).add(i)
},
x.prototype.setPrivate = function(t, e, i) {
    null != t && null != e && t.length > 0 && e.length > 0 && (this.n = E(t, 16), this.e = parseInt(e, 16), this.d = E(i, 16))
},
x.prototype.setPrivateEx = function(t, e, i, r, n, s, o, a) {
    null != t && null != e && t.length > 0 && e.length > 0 && (this.n = E(t, 16), this.e = parseInt(e, 16), this.d = E(i, 16), this.p = E(r, 16), this.q = E(n, 16), this.dmp1 = E(s, 16), this.dmq1 = E(o, 16), this.coeff = E(a, 16))
},
x.prototype.generate = function(t, i) {
    var r = new S,
    n = t >> 1;
    this.e = parseInt(i, 16);
    for (var s = new e(i, 16);;) {
        for (; this.p = new e(t - n, 1, r), 0 != this.p.subtract(e.ONE).gcd(s).compareTo(e.ONE) || !this.p.isProbablePrime(10););
        for (; this.q = new e(n, 1, r), 0 != this.q.subtract(e.ONE).gcd(s).compareTo(e.ONE) || !this.q.isProbablePrime(10););
        if (this.p.compareTo(this.q) <= 0) {
            var o = this.p;
            this.p = this.q,
            this.q = o
        }
        var a = this.p.subtract(e.ONE),
        h = this.q.subtract(e.ONE),
        u = a.multiply(h);
        if (0 == u.gcd(s).compareTo(e.ONE)) {
            this.n = this.p.multiply(this.q),
            this.d = s.modInverse(u),
            this.dmp1 = this.d.mod(a),
            this.dmq1 = this.d.mod(h),
            this.coeff = this.q.modInverse(this.p);
            break
        }
    }
},
x.prototype.decrypt = function(t) {
    var e = E(t, 16),
    i = this.doPrivate(e);
    return null == i ? null: function(t, e) {
        for (var i = t.toByteArray(), r = 0; r < i.length && 0 == i[r];)++r;
        if (i.length - r != e - 1 || 2 != i[r]) return null;
        for (++r; 0 != i[r];) if (++r >= i.length) return null;
        for (var n = ""; ++r < i.length;) {
            var s = 255 & i[r];
            s < 128 ? n += String.fromCharCode(s) : s > 191 && s < 224 ? (n += String.fromCharCode((31 & s) << 6 | 63 & i[r + 1]), ++r) : (n += String.fromCharCode((15 & s) << 12 | (63 & i[r + 1]) << 6 | 63 & i[r + 2]), r += 2)
        }
        return n
    } (i, this.n.bitLength() + 7 >> 3)
},
x.prototype.generateAsync = function(t, r, n) {
    var s = new S,
    o = t >> 1;
    this.e = parseInt(r, 16);
    var a = new e(r, 16),
    h = this;
    setTimeout(function r() {
        var u = function() {
            if (h.p.compareTo(h.q) <= 0) {
                var t = h.p;
                h.p = h.q,
                h.q = t
            }
            var i = h.p.subtract(e.ONE),
            s = h.q.subtract(e.ONE),
            o = i.multiply(s);
            0 == o.gcd(a).compareTo(e.ONE) ? (h.n = h.p.multiply(h.q), h.d = a.modInverse(o), h.dmp1 = h.d.mod(i), h.dmq1 = h.d.mod(s), h.coeff = h.q.modInverse(h.p), setTimeout(function() {
                n()
            },
            0)) : setTimeout(r, 0)
        },
        c = function t() {
            h.q = i(),
            h.q.fromNumberAsync(o, 1, s,
            function() {
                h.q.subtract(e.ONE).gcda(a,
                function(i) {
                    0 == i.compareTo(e.ONE) && h.q.isProbablePrime(10) ? setTimeout(u, 0) : setTimeout(t, 0)
                })
            })
        };
        setTimeout(function r() {
            h.p = i(),
            h.p.fromNumberAsync(t - o, 1, s,
            function() {
                h.p.subtract(e.ONE).gcda(a,
                function(t) {
                    0 == t.compareTo(e.ONE) && h.p.isProbablePrime(10) ? setTimeout(c, 0) : setTimeout(r, 0)
                })
            })
        },
        0)
    },
    0)
},
e.prototype.gcda = function(t, e) {
    var i = this.s < 0 ? this.negate() : this.clone(),
    r = t.s < 0 ? t.negate() : t.clone();
    if (i.compareTo(r) < 0) {
        var n = i;
        i = r,
        r = n
    }
    var s = i.getLowestSetBit(),
    o = r.getLowestSetBit();
    o < 0 ? e(i) : (s < o && (o = s), o > 0 && (i.rShiftTo(o, i), r.rShiftTo(o, r)), setTimeout(function t() { (s = i.getLowestSetBit()) > 0 && i.rShiftTo(s, i),
        (s = r.getLowestSetBit()) > 0 && r.rShiftTo(s, r),
        i.compareTo(r) >= 0 ? (i.subTo(r, i), i.rShiftTo(1, i)) : (r.subTo(i, r), r.rShiftTo(1, r)),
        i.signum() > 0 ? setTimeout(t, 0) : (o > 0 && r.lShiftTo(o, r), setTimeout(function() {
            e(r)
        },
        0))
    },
    10))
},
e.prototype.fromNumberAsync = function(t, i, r, n) {
    if ("number" == typeof i) if (t < 2) this.fromInt(1);
    else {
        this.fromNumber(t, r),
        this.testBit(t - 1) || this.bitwiseTo(e.ONE.shiftLeft(t - 1), l, this),
        this.isEven() && this.dAddOffset(1, 0);
        var s = this;
        setTimeout(function r() {
            s.dAddOffset(2, 0),
            s.bitLength() > t && s.subTo(e.ONE.shiftLeft(t - 1), s),
            s.isProbablePrime(i) ? setTimeout(function() {
                n()
            },
            0) : setTimeout(r, 0)
        },
        0)
    } else {
        var o = new Array,
        a = 7 & t;
        o.length = 1 + (t >> 3),
        i.nextBytes(o),
        a > 0 ? o[0] &= (1 << a) - 1 : o[0] = 0,
        this.fromString(o, 256)
    }
};
var _ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
F = "=",
K = K || {};
K.env = K.env || {};
var U = K,
z = Object.prototype,
Z = ["toString", "valueOf"];
K.env.parseUA = function(t) {
    var e, i = function(t) {
        var e = 0;
        return parseFloat(t.replace(/\./g,
        function() {
            return 1 == e++?"": "."
        }))
    },
    r = navigator,
    n = {
        ie: 0,
        opera: 0,
        gecko: 0,
        webkit: 0,
        chrome: 0,
        mobile: null,
        air: 0,
        ipad: 0,
        iphone: 0,
        ipod: 0,
        ios: null,
        android: 0,
        webos: 0,
        caja: r && r.cajaVersion,
        secure: !1,
        os: null
    },
    s = t || navigator && navigator.userAgent,
    o = window && window.location,
    a = o && o.href;
    return n.secure = a && 0 === a.toLowerCase().indexOf("https"),
    s && (/windows|win32/i.test(s) ? n.os = "windows": /macintosh/i.test(s) ? n.os = "macintosh": /rhino/i.test(s) && (n.os = "rhino"), /KHTML/.test(s) && (n.webkit = 1), (e = s.match(/AppleWebKit\/([^\s]*)/)) && e[1] && (n.webkit = i(e[1]), / Mobile\//.test(s) ? (n.mobile = "Apple", (e = s.match(/OS ([^\s]*)/)) && e[1] && (e = i(e[1].replace("_", "."))), n.ios = e, n.ipad = n.ipod = n.iphone = 0, (e = s.match(/iPad|iPod|iPhone/)) && e[0] && (n[e[0].toLowerCase()] = n.ios)) : ((e = s.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/)) && (n.mobile = e[0]), /webOS/.test(s) && (n.mobile = "WebOS", (e = s.match(/webOS\/([^\s]*);/)) && e[1] && (n.webos = i(e[1]))), / Android/.test(s) && (n.mobile = "Android", (e = s.match(/Android ([^\s]*);/)) && e[1] && (n.android = i(e[1])))), (e = s.match(/Chrome\/([^\s]*)/)) && e[1] ? n.chrome = i(e[1]) : (e = s.match(/AdobeAIR\/([^\s]*)/)) && (n.air = e[0])), n.webkit || ((e = s.match(/Opera[\s\/]([^\s]*)/)) && e[1] ? (n.opera = i(e[1]), (e = s.match(/Version\/([^\s]*)/)) && e[1] && (n.opera = i(e[1])), (e = s.match(/Opera Mini[^;]*/)) && (n.mobile = e[0])) : (e = s.match(/MSIE\s([^;]*)/)) && e[1] ? n.ie = i(e[1]) : (e = s.match(/Gecko\/([^\s]*)/)) && (n.gecko = 1, (e = s.match(/rv:([^\s\)]*)/)) && e[1] && (n.gecko = i(e[1]))))),
    n
},
K.env.ua = K.env.parseUA(),
K.isFunction = function(t) {
    return "function" == typeof t || "[object Function]" === z.toString.apply(t)
},
K._IEEnumFix = K.env.ua.ie ?
function(t, e) {
    var i, r, n;
    for (i = 0; i < Z.length; i += 1) n = e[r = Z[i]],
    U.isFunction(n) && n != z[r] && (t[r] = n)
}: function() {},
K.extend = function(t, e, i) {
    if (!e || !t) throw new Error("extend failed, please check that all dependencies are included.");
    var r, n = function() {};
    if (n.prototype = e.prototype, t.prototype = new n, t.prototype.constructor = t, t.superclass = e.prototype, e.prototype.constructor == z.constructor && (e.prototype.constructor = e), i) {
        for (r in i) U.hasOwnProperty(i, r) && (t.prototype[r] = i[r]);
        U._IEEnumFix(t.prototype, i)
    }
};
var G = G || {};
void 0 !== G && G || (G = {}),
void 0 !== G.asn1 && G.asn1 || (G.asn1 = {}),
G.asn1.ASN1Util = new
function() {
    this.integerToByteHex = function(t) {
        var e = t.toString(16);
        return e.length % 2 == 1 && (e = "0" + e),
        e
    },
    this.bigIntToMinTwosComplementsHex = function(t) {
        var i = t.toString(16);
        if ("-" != i.substr(0, 1)) i.length % 2 == 1 ? i = "0" + i: i.match(/^[0-7]/) || (i = "00" + i);
        else {
            var r = i.substr(1),
            n = r.length;
            n % 2 == 1 ? n += 1 : i.match(/^[0-7]/) || (n += 2);
            for (var s = "",
            o = 0; o < n; o++) s += "f";
            i = new e(s, 16).xor(t).add(e.ONE).toString(16).replace(/^-/, "")
        }
        return i
    },
    this.getPEMStringFromHex = function(t, e) {
        var i = CryptoJS.enc.Hex.parse(t),
        r = CryptoJS.enc.Base64.stringify(i),
        n = r.replace(/(.{64})/g, "$1\r\n");
        return n = n.replace(/\r\n$/, ""),
        "-----BEGIN " + e + "-----\r\n" + n + "\r\n-----END " + e + "-----\r\n"
    }
},
G.asn1.ASN1Object = function() {
    this.getLengthHexFromValue = function() {
        if (void 0 === this.hV || null == this.hV) throw "this.hV is null or undefined.";
        if (this.hV.length % 2 == 1) throw "value hex must be even length: n=" + "".length + ",v=" + this.hV;
        var t = this.hV.length / 2,
        e = t.toString(16);
        if (e.length % 2 == 1 && (e = "0" + e), t < 128) return e;
        var i = e.length / 2;
        if (i > 15) throw "ASN.1 length too long to represent by 8x: n = " + t.toString(16);
        return (128 + i).toString(16) + e
    },
    this.getEncodedHex = function() {
        return (null == this.hTLV || this.isModified) && (this.hV = this.getFreshValueHex(), this.hL = this.getLengthHexFromValue(), this.hTLV = this.hT + this.hL + this.hV, this.isModified = !1),
        this.hTLV
    },
    this.getValueHex = function() {
        return this.getEncodedHex(),
        this.hV
    },
    this.getFreshValueHex = function() {
        return ""
    }
},
G.asn1.DERAbstractString = function(t) {
    G.asn1.DERAbstractString.superclass.constructor.call(this),
    this.getString = function() {
        return this.s
    },
    this.setString = function(t) {
        this.hTLV = null,
        this.isModified = !0,
        this.s = t,
        this.hV = stohex(this.s)
    },
    this.setStringHex = function(t) {
        this.hTLV = null,
        this.isModified = !0,
        this.s = null,
        this.hV = t
    },
    this.getFreshValueHex = function() {
        return this.hV
    },
    void 0 !== t && (void 0 !== t.str ? this.setString(t.str) : void 0 !== t.hex && this.setStringHex(t.hex))
},
K.extend(G.asn1.DERAbstractString, G.asn1.ASN1Object),
G.asn1.DERAbstractTime = function(t) {
    G.asn1.DERAbstractTime.superclass.constructor.call(this),
    this.localDateToUTC = function(t) {
        return utc = t.getTime() + 6e4 * t.getTimezoneOffset(),
        new Date(utc)
    },
    this.formatDate = function(t, e) {
        var i = this.zeroPadding,
        r = this.localDateToUTC(t),
        n = String(r.getFullYear());
        return "utc" == e && (n = n.substr(2, 2)),
        n + i(String(r.getMonth() + 1), 2) + i(String(r.getDate()), 2) + i(String(r.getHours()), 2) + i(String(r.getMinutes()), 2) + i(String(r.getSeconds()), 2) + "Z"
    },
    this.zeroPadding = function(t, e) {
        return t.length >= e ? t: new Array(e - t.length + 1).join("0") + t
    },
    this.getString = function() {
        return this.s
    },
    this.setString = function(t) {
        this.hTLV = null,
        this.isModified = !0,
        this.s = t,
        this.hV = stohex(this.s)
    },
    this.setByDateValue = function(t, e, i, r, n, s) {
        var o = new Date(Date.UTC(t, e - 1, i, r, n, s, 0));
        this.setByDate(o)
    },
    this.getFreshValueHex = function() {
        return this.hV
    }
},
K.extend(G.asn1.DERAbstractTime, G.asn1.ASN1Object),
G.asn1.DERAbstractStructured = function(t) {
    G.asn1.DERAbstractString.superclass.constructor.call(this),
    this.setByASN1ObjectArray = function(t) {
        this.hTLV = null,
        this.isModified = !0,
        this.asn1Array = t
    },
    this.appendASN1Object = function(t) {
        this.hTLV = null,
        this.isModified = !0,
        this.asn1Array.push(t)
    },
    this.asn1Array = new Array,
    void 0 !== t && void 0 !== t.array && (this.asn1Array = t.array)
},
K.extend(G.asn1.DERAbstractStructured, G.asn1.ASN1Object),
G.asn1.DERBoolean = function() {
    G.asn1.DERBoolean.superclass.constructor.call(this),
    this.hT = "01",
    this.hTLV = "0101ff"
},
K.extend(G.asn1.DERBoolean, G.asn1.ASN1Object),
G.asn1.DERInteger = function(t) {
    G.asn1.DERInteger.superclass.constructor.call(this),
    this.hT = "02",
    this.setByBigInteger = function(t) {
        this.hTLV = null,
        this.isModified = !0,
        this.hV = G.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)
    },
    this.setByInteger = function(t) {
        var i = new e(String(t), 10);
        this.setByBigInteger(i)
    },
    this.setValueHex = function(t) {
        this.hV = t
    },
    this.getFreshValueHex = function() {
        return this.hV
    },
    void 0 !== t && (void 0 !== t.bigint ? this.setByBigInteger(t.bigint) : void 0 !== t.int ? this.setByInteger(t.int) : void 0 !== t.hex && this.setValueHex(t.hex))
},
K.extend(G.asn1.DERInteger, G.asn1.ASN1Object),
G.asn1.DERBitString = function(t) {
    G.asn1.DERBitString.superclass.constructor.call(this),
    this.hT = "03",
    this.setHexValueIncludingUnusedBits = function(t) {
        this.hTLV = null,
        this.isModified = !0,
        this.hV = t
    },
    this.setUnusedBitsAndHexValue = function(t, e) {
        if (t < 0 || 7 < t) throw "unused bits shall be from 0 to 7: u = " + t;
        var i = "0" + t;
        this.hTLV = null,
        this.isModified = !0,
        this.hV = i + e
    },
    this.setByBinaryString = function(t) {
        var e = 8 - (t = t.replace(/0+$/, "")).length % 8;
        8 == e && (e = 0);
        for (var i = 0; i <= e; i++) t += "0";
        for (var r = "",
        i = 0; i < t.length - 1; i += 8) {
            var n = t.substr(i, 8),
            s = parseInt(n, 2).toString(16);
            1 == s.length && (s = "0" + s),
            r += s
        }
        this.hTLV = null,
        this.isModified = !0,
        this.hV = "0" + e + r
    },
    this.setByBooleanArray = function(t) {
        for (var e = "",
        i = 0; i < t.length; i++) 1 == t[i] ? e += "1": e += "0";
        this.setByBinaryString(e)
    },
    this.newFalseArray = function(t) {
        for (var e = new Array(t), i = 0; i < t; i++) e[i] = !1;
        return e
    },
    this.getFreshValueHex = function() {
        return this.hV
    },
    void 0 !== t && (void 0 !== t.hex ? this.setHexValueIncludingUnusedBits(t.hex) : void 0 !== t.bin ? this.setByBinaryString(t.bin) : void 0 !== t.array && this.setByBooleanArray(t.array))
},
K.extend(G.asn1.DERBitString, G.asn1.ASN1Object),
G.asn1.DEROctetString = function(t) {
    G.asn1.DEROctetString.superclass.constructor.call(this, t),
    this.hT = "04"
},
K.extend(G.asn1.DEROctetString, G.asn1.DERAbstractString),
G.asn1.DERNull = function() {
    G.asn1.DERNull.superclass.constructor.call(this),
    this.hT = "05",
    this.hTLV = "0500"
},
K.extend(G.asn1.DERNull, G.asn1.ASN1Object),
G.asn1.DERObjectIdentifier = function(t) {
    var i = function(t) {
        var e = t.toString(16);
        return 1 == e.length && (e = "0" + e),
        e
    },
    r = function(t) {
        var r = "",
        n = new e(t, 10),
        s = n.toString(2),
        o = 7 - s.length % 7;
        7 == o && (o = 0);
        for (var a = "",
        h = 0; h < o; h++) a += "0";
        s = a + s;
        for (var h = 0; h < s.length - 1; h += 7) {
            var u = s.substr(h, 7);
            h != s.length - 7 && (u = "1" + u),
            r += i(parseInt(u, 2))
        }
        return r
    };
    G.asn1.DERObjectIdentifier.superclass.constructor.call(this),
    this.hT = "06",
    this.setValueHex = function(t) {
        this.hTLV = null,
        this.isModified = !0,
        this.s = null,
        this.hV = t
    },
    this.setValueOidString = function(t) {
        if (!t.match(/^[0-9.]+$/)) throw "malformed oid string: " + t;
        var e = "",
        n = t.split("."),
        s = 40 * parseInt(n[0]) + parseInt(n[1]);
        e += i(s),
        n.splice(0, 2);
        for (var o = 0; o < n.length; o++) e += r(n[o]);
        this.hTLV = null,
        this.isModified = !0,
        this.s = null,
        this.hV = e
    },
    this.setValueName = function(t) {
        if (void 0 === G.asn1.x509.OID.name2oidList[t]) throw "DERObjectIdentifier oidName undefined: " + t;
        var e = G.asn1.x509.OID.name2oidList[t];
        this.setValueOidString(e)
    },
    this.getFreshValueHex = function() {
        return this.hV
    },
    void 0 !== t && (void 0 !== t.oid ? this.setValueOidString(t.oid) : void 0 !== t.hex ? this.setValueHex(t.hex) : void 0 !== t.name && this.setValueName(t.name))
},
K.extend(G.asn1.DERObjectIdentifier, G.asn1.ASN1Object),
G.asn1.DERUTF8String = function(t) {
    G.asn1.DERUTF8String.superclass.constructor.call(this, t),
    this.hT = "0c"
},
K.extend(G.asn1.DERUTF8String, G.asn1.DERAbstractString),
G.asn1.DERNumericString = function(t) {
    G.asn1.DERNumericString.superclass.constructor.call(this, t),
    this.hT = "12"
},
K.extend(G.asn1.DERNumericString, G.asn1.DERAbstractString),
G.asn1.DERPrintableString = function(t) {
    G.asn1.DERPrintableString.superclass.constructor.call(this, t),
    this.hT = "13"
},
K.extend(G.asn1.DERPrintableString, G.asn1.DERAbstractString),
G.asn1.DERTeletexString = function(t) {
    G.asn1.DERTeletexString.superclass.constructor.call(this, t),
    this.hT = "14"
},
K.extend(G.asn1.DERTeletexString, G.asn1.DERAbstractString),
G.asn1.DERIA5String = function(t) {
    G.asn1.DERIA5String.superclass.constructor.call(this, t),
    this.hT = "16"
},
K.extend(G.asn1.DERIA5String, G.asn1.DERAbstractString),
G.asn1.DERUTCTime = function(t) {
    G.asn1.DERUTCTime.superclass.constructor.call(this, t),
    this.hT = "17",
    this.setByDate = function(t) {
        this.hTLV = null,
        this.isModified = !0,
        this.date = t,
        this.s = this.formatDate(this.date, "utc"),
        this.hV = stohex(this.s)
    },
    void 0 !== t && (void 0 !== t.str ? this.setString(t.str) : void 0 !== t.hex ? this.setStringHex(t.hex) : void 0 !== t.date && this.setByDate(t.date))
},
K.extend(G.asn1.DERUTCTime, G.asn1.DERAbstractTime),
G.asn1.DERGeneralizedTime = function(t) {
    G.asn1.DERGeneralizedTime.superclass.constructor.call(this, t),
    this.hT = "18",
    this.setByDate = function(t) {
        this.hTLV = null,
        this.isModified = !0,
        this.date = t,
        this.s = this.formatDate(this.date, "gen"),
        this.hV = stohex(this.s)
    },
    void 0 !== t && (void 0 !== t.str ? this.setString(t.str) : void 0 !== t.hex ? this.setStringHex(t.hex) : void 0 !== t.date && this.setByDate(t.date))
},
K.extend(G.asn1.DERGeneralizedTime, G.asn1.DERAbstractTime),
G.asn1.DERSequence = function(t) {
    G.asn1.DERSequence.superclass.constructor.call(this, t),
    this.hT = "30",
    this.getFreshValueHex = function() {
        for (var t = "",
        e = 0; e < this.asn1Array.length; e++) {
            t += this.asn1Array[e].getEncodedHex()
        }
        return this.hV = t,
        this.hV
    }
},
K.extend(G.asn1.DERSequence, G.asn1.DERAbstractStructured),
G.asn1.DERSet = function(t) {
    G.asn1.DERSet.superclass.constructor.call(this, t),
    this.hT = "31",
    this.getFreshValueHex = function() {
        for (var t = new Array,
        e = 0; e < this.asn1Array.length; e++) {
            var i = this.asn1Array[e];
            t.push(i.getEncodedHex())
        }
        return t.sort(),
        this.hV = t.join(""),
        this.hV
    }
},
K.extend(G.asn1.DERSet, G.asn1.DERAbstractStructured),
G.asn1.DERTaggedObject = function(t) {
    G.asn1.DERTaggedObject.superclass.constructor.call(this),
    this.hT = "a0",
    this.hV = "",
    this.isExplicit = !0,
    this.asn1Object = null,
    this.setASN1Object = function(t, e, i) {
        this.hT = e,
        this.isExplicit = t,
        this.asn1Object = i,
        this.isExplicit ? (this.hV = this.asn1Object.getEncodedHex(), this.hTLV = null, this.isModified = !0) : (this.hV = null, this.hTLV = i.getEncodedHex(), this.hTLV = this.hTLV.replace(/^../, e), this.isModified = !1)
    },
    this.getFreshValueHex = function() {
        return this.hV
    },
    void 0 !== t && (void 0 !== t.tag && (this.hT = t.tag), void 0 !== t.explicit && (this.isExplicit = t.explicit), void 0 !== t.obj && (this.asn1Object = t.obj, this.setASN1Object(this.isExplicit, this.hT, this.asn1Object)))
},
K.extend(G.asn1.DERTaggedObject, G.asn1.ASN1Object),
function(t) {
    var e, i = {
        decode: function(t) {
            var i;
            if (void 0 === e) {
                var r = "0123456789ABCDEF",
                n = " \f\n\r\t?\u2028\u2029";
                for (e = [], i = 0; i < 16; ++i) e[r.charAt(i)] = i;
                for (r = r.toLowerCase(), i = 10; i < 16; ++i) e[r.charAt(i)] = i;
                for (i = 0; i < n.length; ++i) e[n.charAt(i)] = -1
            }
            var s = [],
            o = 0,
            a = 0;
            for (i = 0; i < t.length; ++i) {
                var h = t.charAt(i);
                if ("=" == h) break;
                if ( - 1 != (h = e[h])) {
                    if (void 0 === h) throw "Illegal character at offset " + i;
                    o |= h,
                    ++a >= 2 ? (s[s.length] = o, o = 0, a = 0) : o <<= 4
                }
            }
            if (a) throw "Hex encoding incomplete: 4 bits missing";
            return s
        }
    };
    window.Hex = i
} (),
function(t) {
    var e, i = {
        decode: function(t) {
            var i;
            if (void 0 === e) {
                var r = "= \f\n\r\t?\u2028\u2029";
                for (e = [], i = 0; i < 64; ++i) e["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(i)] = i;
                for (i = 0; i < r.length; ++i) e[r.charAt(i)] = -1
            }
            var n = [],
            s = 0,
            o = 0;
            for (i = 0; i < t.length; ++i) {
                var a = t.charAt(i);
                if ("=" == a) break;
                if ( - 1 != (a = e[a])) {
                    if (void 0 === a) throw "Illegal character at offset " + i;
                    s |= a,
                    ++o >= 4 ? (n[n.length] = s >> 16, n[n.length] = s >> 8 & 255, n[n.length] = 255 & s, s = 0, o = 0) : s <<= 6
                }
            }
            switch (o) {
            case 1:
                throw "Base64 encoding incomplete: at least 2 bits missing";
            case 2:
                n[n.length] = s >> 10;
                break;
            case 3:
                n[n.length] = s >> 16,
                n[n.length] = s >> 8 & 255
            }
            return n
        },
        re: /-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,
        unarmor: function(t) {
            var e = i.re.exec(t);
            if (e) if (e[1]) t = e[1];
            else {
                if (!e[2]) throw "RegExp out of sync";
                t = e[2]
            }
            return i.decode(t)
        }
    };
    window.Base64 = i
} (),
function(t) {
    function e(t, i) {
        t instanceof e ? (this.enc = t.enc, this.pos = t.pos) : (this.enc = t, this.pos = i)
    }
    function i(t, e, i, r, n) {
        this.stream = t,
        this.header = e,
        this.length = i,
        this.tag = r,
        this.sub = n
    }
    var r = {
        tag: function(t, e) {
            var i = document.createElement(t);
            return i.className = e,
            i
        },
        text: function(t) {
            return document.createTextNode(t)
        }
    };
    e.prototype.get = function(t) {
        if (void 0 === t && (t = this.pos++), t >= this.enc.length) throw "Requesting byte offset " + t + " on a stream of length " + this.enc.length;
        return this.enc[t]
    },
    e.prototype.hexDigits = "0123456789ABCDEF",
    e.prototype.hexByte = function(t) {
        return this.hexDigits.charAt(t >> 4 & 15) + this.hexDigits.charAt(15 & t)
    },
    e.prototype.hexDump = function(t, e, i) {
        for (var r = "",
        n = t; n < e; ++n) if (r += this.hexByte(this.get(n)), !0 !== i) switch (15 & n) {
        case 7:
            r += "  ";
            break;
        case 15:
            r += "\n";
            break;
        default:
            r += " "
        }
        return r
    },
    e.prototype.parseStringISO = function(t, e) {
        for (var i = "",
        r = t; r < e; ++r) i += String.fromCharCode(this.get(r));
        return i
    },
    e.prototype.parseStringUTF = function(t, e) {
        for (var i = "",
        r = t; r < e;) {
            var n = this.get(r++);
            i += n < 128 ? String.fromCharCode(n) : n > 191 && n < 224 ? String.fromCharCode((31 & n) << 6 | 63 & this.get(r++)) : String.fromCharCode((15 & n) << 12 | (63 & this.get(r++)) << 6 | 63 & this.get(r++))
        }
        return i
    },
    e.prototype.parseStringBMP = function(t, e) {
        for (var i = "",
        r = t; r < e; r += 2) {
            var n = this.get(r),
            s = this.get(r + 1);
            i += String.fromCharCode((n << 8) + s)
        }
        return i
    },
    e.prototype.reTime = /^((?:1[89]|2\d)?\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,
    e.prototype.parseTime = function(t, e) {
        var i = this.parseStringISO(t, e),
        r = this.reTime.exec(i);
        return r ? (i = r[1] + "-" + r[2] + "-" + r[3] + " " + r[4], r[5] && (i += ":" + r[5], r[6] && (i += ":" + r[6], r[7] && (i += "." + r[7]))), r[8] && (i += " UTC", "Z" != r[8] && (i += r[8], r[9] && (i += ":" + r[9]))), i) : "Unrecognized time: " + i
    },
    e.prototype.parseInteger = function(t, e) {
        var i = e - t;
        if (i > 4) {
            i <<= 3;
            var r = this.get(t);
            if (0 === r) i -= 8;
            else for (; r < 128;) r <<= 1,
            --i;
            return "(" + i + " bit)"
        }
        for (var n = 0,
        s = t; s < e; ++s) n = n << 8 | this.get(s);
        return n
    },
    e.prototype.parseBitString = function(t, e) {
        var i = this.get(t),
        r = (e - t - 1 << 3) - i,
        n = "(" + r + " bit)";
        if (r <= 20) {
            var s = i;
            n += " ";
            for (var o = e - 1; o > t; --o) {
                for (var a = this.get(o), h = s; h < 8; ++h) n += a >> h & 1 ? "1": "0";
                s = 0
            }
        }
        return n
    },
    e.prototype.parseOctetString = function(t, e) {
        var i = e - t,
        r = "(" + i + " byte) ";
        i > 100 && (e = t + 100);
        for (var n = t; n < e; ++n) r += this.hexByte(this.get(n));
        return i > 100 && (r += "…"),
        r
    },
    e.prototype.parseOID = function(t, e) {
        for (var i = "",
        r = 0,
        n = 0,
        s = t; s < e; ++s) {
            var o = this.get(s);
            if (r = r << 7 | 127 & o, n += 7, !(128 & o)) {
                if ("" === i) {
                    var a = r < 80 ? r < 40 ? 0 : 1 : 2;
                    i = a + "." + (r - 40 * a)
                } else i += "." + (n >= 31 ? "bigint": r);
                r = n = 0
            }
        }
        return i
    },
    i.prototype.typeName = function() {
        if (void 0 === this.tag) return "unknown";
        var t = this.tag >> 6,
        e = (this.tag, 31 & this.tag);
        switch (t) {
        case 0:
            switch (e) {
            case 0:
                return "EOC";
            case 1:
                return "BOOLEAN";
            case 2:
                return "INTEGER";
            case 3:
                return "BIT_STRING";
            case 4:
                return "OCTET_STRING";
            case 5:
                return "NULL";
            case 6:
                return "OBJECT_IDENTIFIER";
            case 7:
                return "ObjectDescriptor";
            case 8:
                return "EXTERNAL";
            case 9:
                return "REAL";
            case 10:
                return "ENUMERATED";
            case 11:
                return "EMBEDDED_PDV";
            case 12:
                return "UTF8String";
            case 16:
                return "SEQUENCE";
            case 17:
                return "SET";
            case 18:
                return "NumericString";
            case 19:
                return "PrintableString";
            case 20:
                return "TeletexString";
            case 21:
                return "VideotexString";
            case 22:
                return "IA5String";
            case 23:
                return "UTCTime";
            case 24:
                return "GeneralizedTime";
            case 25:
                return "GraphicString";
            case 26:
                return "VisibleString";
            case 27:
                return "GeneralString";
            case 28:
                return "UniversalString";
            case 30:
                return "BMPString";
            default:
                return "Universal_" + e.toString(16)
            }
        case 1:
            return "Application_" + e.toString(16);
        case 2:
            return "[" + e + "]";
        case 3:
            return "Private_" + e.toString(16)
        }
    },
    i.prototype.reSeemsASCII = /^[ -~]+$/,
    i.prototype.content = function() {
        if (void 0 === this.tag) return null;
        var t = this.tag >> 6,
        e = 31 & this.tag,
        i = this.posContent(),
        r = Math.abs(this.length);
        if (0 !== t) {
            if (null !== this.sub) return "(" + this.sub.length + " elem)";
            var n = this.stream.parseStringISO(i, i + Math.min(r, 100));
            return this.reSeemsASCII.test(n) ? n.substring(0, 200) + (n.length > 200 ? "…": "") : this.stream.parseOctetString(i, i + r)
        }
        switch (e) {
        case 1:
            return 0 === this.stream.get(i) ? "false": "true";
        case 2:
            return this.stream.parseInteger(i, i + r);
        case 3:
            return this.sub ? "(" + this.sub.length + " elem)": this.stream.parseBitString(i, i + r);
        case 4:
            return this.sub ? "(" + this.sub.length + " elem)": this.stream.parseOctetString(i, i + r);
        case 6:
            return this.stream.parseOID(i, i + r);
        case 16:
        case 17:
            return "(" + this.sub.length + " elem)";
        case 12:
            return this.stream.parseStringUTF(i, i + r);
        case 18:
        case 19:
        case 20:
        case 21:
        case 22:
        case 26:
            return this.stream.parseStringISO(i, i + r);
        case 30:
            return this.stream.parseStringBMP(i, i + r);
        case 23:
        case 24:
            return this.stream.parseTime(i, i + r)
        }
        return null
    },
    i.prototype.toString = function() {
        return this.typeName() + "@" + this.stream.pos + "[header:" + this.header + ",length:" + this.length + ",sub:" + (null === this.sub ? "null": this.sub.length) + "]"
    },
    i.prototype.print = function(t) {
        if (void 0 === t && (t = ""), document.writeln(t + this), null !== this.sub) {
            t += "  ";
            for (var e = 0,
            i = this.sub.length; e < i; ++e) this.sub[e].print(t)
        }
    },
    i.prototype.toPrettyString = function(t) {
        void 0 === t && (t = "");
        var e = t + this.typeName() + " @" + this.stream.pos;
        if (this.length >= 0 && (e += "+"), e += this.length, 32 & this.tag ? e += " (constructed)": 3 != this.tag && 4 != this.tag || null === this.sub || (e += " (encapsulates)"), e += "\n", null !== this.sub) {
            t += "  ";
            for (var i = 0,
            r = this.sub.length; i < r; ++i) e += this.sub[i].toPrettyString(t)
        }
        return e
    },
    i.prototype.toDOM = function() {
        var t = r.tag("div", "node");
        t.asn1 = this;
        var e = r.tag("div", "head"),
        i = this.typeName().replace(/_/g, " ");
        e.innerHTML = i;
        var n = this.content();
        if (null !== n) {
            n = String(n).replace(/, "<");
            var s = r.tag("span", "preview");
            s.appendChild(r.text(n)),
            e.appendChild(s)
        }
        t.appendChild(e),
        this.node = t,
        this.head = e;
        var o = r.tag("div", "value");

        o.innerHTML = i,
        t.appendChild(o);
        var u = r.tag("div", "sub");
        if (null !== this.sub) for (var c = 0,
        l = this.sub.length; c < l; ++c) u.appendChild(this.sub[c].toDOM());
        return t.appendChild(u),
        e.onclick = function() {
            t.className = "node collapsed" == t.className ? "node": "node collapsed"
        },
        t
    },
    i.prototype.posStart = function() {
        return this.stream.pos
    },
    i.prototype.posContent = function() {
        return this.stream.pos + this.header
    },
    i.prototype.posEnd = function() {
        return this.stream.pos + this.header + Math.abs(this.length)
    },
    i.prototype.fakeHover = function(t) {
        this.node.className += " hover",
        t && (this.head.className += " hover")
    },
    i.prototype.fakeOut = function(t) {
        var e = / ?hover/;
        this.node.className = this.node.className.replace(e, ""),
        t && (this.head.className = this.head.className.replace(e, ""))
    },
    i.prototype.toHexDOM_sub = function(t, e, i, n, s) {
        if (! (n >= s)) {
            var o = r.tag("span", e);
            o.appendChild(r.text(i.hexDump(n, s))),
            t.appendChild(o)
        }
    },
    i.prototype.toHexDOM = function(t) {
        var e = r.tag("span", "hex");
        if (void 0 === t && (t = e), this.head.hexNode = e, this.head.onmouseover = function() {
            this.hexNode.className = "hexCurrent"
        },
        this.head.onmouseout = function() {
            this.hexNode.className = "hex"
        },
        e.asn1 = this, e.onmouseover = function() {
            var e = !t.selected;
            e && (t.selected = this.asn1, this.className = "hexCurrent"),
            this.asn1.fakeHover(e)
        },
        e.onmouseout = function() {
            var e = t.selected == this.asn1;
            this.asn1.fakeOut(e),
            e && (t.selected = null, this.className = "hex")
        },
        this.toHexDOM_sub(e, "tag", this.stream, this.posStart(), this.posStart() + 1), this.toHexDOM_sub(e, this.length >= 0 ? "dlen": "ulen", this.stream, this.posStart() + 1, this.posContent()), null === this.sub) e.appendChild(r.text(this.stream.hexDump(this.posContent(), this.posEnd())));
        else if (this.sub.length > 0) {
            var i = this.sub[0],
            n = this.sub[this.sub.length - 1];
            this.toHexDOM_sub(e, "intro", this.stream, this.posContent(), i.posStart());
            for (var s = 0,
            o = this.sub.length; s < o; ++s) e.appendChild(this.sub[s].toHexDOM(t));
            this.toHexDOM_sub(e, "outro", this.stream, n.posEnd(), this.posEnd())
        }
        return e
    },
    i.prototype.toHexString = function(t) {
        return this.stream.hexDump(this.posStart(), this.posEnd(), !0)
    },
    i.decodeLength = function(t) {
        var e = t.get(),
        i = 127 & e;
        if (i == e) return i;
        if (i > 3) throw "Length over 24 bits not supported at position " + (t.pos - 1);
        if (0 === i) return - 1;
        e = 0;
        for (var r = 0; r < i; ++r) e = e << 8 | t.get();
        return e
    },
    i.hasContent = function(t, r, n) {
        if (32 & t) return ! 0;
        if (t < 3 || t > 4) return ! 1;
        var s = new e(n);
        if (3 == t && s.get(), s.get() >> 6 & 1) return ! 1;
        try {
            var o = i.decodeLength(s);
            return s.pos - n.pos + o == r
        } catch(t) {
            return ! 1
        }
    },
    i.decode = function(t) {
        t instanceof e || (t = new e(t, 0));
        var r = new e(t),
        n = t.get(),
        s = i.decodeLength(t),
        o = t.pos - r.pos,
        a = null;
        if (i.hasContent(n, s, t)) {
            var h = t.pos;
            if (3 == n && t.get(), a = [], s >= 0) {
                for (var u = h + s; t.pos < u;) a[a.length] = i.decode(t);
                if (t.pos != u) throw "Content size is not correct for container starting at offset " + h
            } else try {
                for (;;) {
                    var c = i.decode(t);
                    if (0 === c.tag) break;
                    a[a.length] = c
                }
                s = h - t.pos
            } catch(t) {
                throw "Exception while decoding undefined length content: " + t
            }
        } else t.pos += s;
        return new i(r, o, s, n, a)
    },
    i.test = function() {
        for (var t = [{
            value: [39],
            expected: 39
        },
        {
            value: [129, 201],
            expected: 201
        },
        {
            value: [131, 254, 220, 186],
            expected: 16702650
        }], r = 0, n = t.length; r < n; ++r) {
            var s = new e(t[r].value, 0),
            o = i.decodeLength(s);
            o != t[r].expected && document.write("In test[" + r + "] expected " + t[r].expected + " got " + o + "\n")
        }
    },
    window.ASN1 = i
} (),
ASN1.prototype.getHexStringValue = function() {
    var t = this.toHexString(),
    e = 2 * this.header,
    i = 2 * this.length;
    return t.substr(e, i)
},
x.prototype.parseKey = function(t) {
    try {
        var e = 0,
        i = 0,
        r = /^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(t) ? Hex.decode(t) : Base64.unarmor(t),
        n = ASN1.decode(r);
        if (3 === n.sub.length && (n = n.sub[2].sub[0]), 9 === n.sub.length) {
            e = n.sub[1].getHexStringValue(),
            this.n = E(e, 16),
            i = n.sub[2].getHexStringValue(),
            this.e = parseInt(i, 16);
            var s = n.sub[3].getHexStringValue();
            this.d = E(s, 16);
            var o = n.sub[4].getHexStringValue();
            this.p = E(o, 16);
            var a = n.sub[5].getHexStringValue();
            this.q = E(a, 16);
            var h = n.sub[6].getHexStringValue();
            this.dmp1 = E(h, 16);
            var u = n.sub[7].getHexStringValue();
            this.dmq1 = E(u, 16);
            var c = n.sub[8].getHexStringValue();
            this.coeff = E(c, 16)
        } else {
            if (2 !== n.sub.length) return ! 1;
            var l = n.sub[1],
            f = l.sub[0];
            e = f.sub[0].getHexStringValue(),
            this.n = E(e, 16),
            i = f.sub[1].getHexStringValue(),
            this.e = parseInt(i, 16)
        }
        return ! 0
    } catch(t) {
        return ! 1
    }
},
x.prototype.getPrivateBaseKey = function() {
    var t = {
        array: [new G.asn1.DERInteger({
            int: 0
        }), new G.asn1.DERInteger({
            bigint: this.n
        }), new G.asn1.DERInteger({
            int: this.e
        }), new G.asn1.DERInteger({
            bigint: this.d
        }), new G.asn1.DERInteger({
            bigint: this.p
        }), new G.asn1.DERInteger({
            bigint: this.q
        }), new G.asn1.DERInteger({
            bigint: this.dmp1
        }), new G.asn1.DERInteger({
            bigint: this.dmq1
        }), new G.asn1.DERInteger({
            bigint: this.coeff
        })]
    };
    return new G.asn1.DERSequence(t).getEncodedHex()
},
x.prototype.getPrivateBaseKeyB64 = function() {
    return D(this.getPrivateBaseKey())
},
x.prototype.getPublicBaseKey = function() {
    var t = {
        array: [new G.asn1.DERObjectIdentifier({
            oid: "1.2.840.113549.1.1.1"
        }), new G.asn1.DERNull]
    },
    e = new G.asn1.DERSequence(t);
    return t = {
        array: [new G.asn1.DERInteger({
            bigint: this.n
        }), new G.asn1.DERInteger({
            int: this.e
        })]
    },
    t = {
        hex: "00" + new G.asn1.DERSequence(t).getEncodedHex()
    },
    t = {
        array: [e, new G.asn1.DERBitString(t)]
    },
    new G.asn1.DERSequence(t).getEncodedHex()
},
x.prototype.getPublicBaseKeyB64 = function() {
    return D(this.getPublicBaseKey())
},
x.prototype.wordwrap = function(t, e) {
    if (e = e || 64, !t) return t;
    var i = "(.{1," + e + "})( +|$\n?)|(.{1," + e + "})";
    return t.match(RegExp(i, "g")).join("\n")
},
x.prototype.getPrivateKey = function() {
    var t = "-----BEGIN RSA PRIVATE KEY-----\n";
    return t += this.wordwrap(this.getPrivateBaseKeyB64()) + "\n",
    t += "-----END RSA PRIVATE KEY-----"
},
x.prototype.getPublicKey = function() {
    var t = "-----BEGIN PUBLIC KEY-----\n";
    return t += this.wordwrap(this.getPublicBaseKeyB64()) + "\n",
    t += "-----END PUBLIC KEY-----"
},
x.prototype.hasPublicKeyProperty = function(t) {
    return (t = t || {}).hasOwnProperty("n") && t.hasOwnProperty("e")
},
x.prototype.hasPrivateKeyProperty = function(t) {
    return (t = t || {}).hasOwnProperty("n") && t.hasOwnProperty("e") && t.hasOwnProperty("d") && t.hasOwnProperty("p") && t.hasOwnProperty("q") && t.hasOwnProperty("dmp1") && t.hasOwnProperty("dmq1") && t.hasOwnProperty("coeff")
},
x.prototype.parsePropertiesFrom = function(t) {
    this.n = t.n,
    this.e = t.e,
    t.hasOwnProperty("d") && (this.d = t.d, this.p = t.p, this.q = t.q, this.dmp1 = t.dmp1, this.dmq1 = t.dmq1, this.coeff = t.coeff)
};
var J = function(t) {
    x.call(this),
    t && ("string" == typeof t ? this.parseKey(t) : (this.hasPrivateKeyProperty(t) || this.hasPublicKeyProperty(t)) && this.parsePropertiesFrom(t))
}; (J.prototype = new x).constructor = J;
var $ = function(t) {
    t = t || {},
    this.default_key_size = parseInt(t.default_key_size) || 1024,
    this.default_public_exponent = t.default_public_exponent || "010001",
    this.log = t.log || !1,
    this.key = null
};
$.prototype.setKey = function(t) {
    this.log && this.key,
    this.key = new J(t)
},
$.prototype.setPrivateKey = function(t) {
    this.setKey(t)
},
$.prototype.setPublicKey = function(t) {
    this.setKey(t)
},
$.prototype.decrypt = function(t) {
    try {
        return this.getKey().decrypt(O(t))
    } catch(t) {
        return ! 1
    }
},
$.prototype.encrypt = function(t) {
    try {
        return D(this.getKey().encrypt(t))
    } catch(t) {
        return ! 1
    }
},
$.prototype.getKey = function(t) {
    if (!this.key) {
        if (this.key = new J, t && "[object Function]" === {}.toString.call(t)) return void this.key.generateAsync(this.default_key_size, this.default_public_exponent, t);
        this.key.generate(this.default_key_size, this.default_public_exponent)
    }
    return this.key
},
$.prototype.getPrivateKey = function() {
    return this.getKey().getPrivateKey()
},
$.prototype.getPrivateKeyB64 = function() {
    return this.getKey().getPrivateBaseKeyB64()
},
$.prototype.getPublicKey = function() {
    return this.getKey().getPublicKey()
},
$.prototype.getPublicKeyB64 = function() {
    return this.getKey().getPublicBaseKeyB64()
},
$.version = "2.3.1",
JSEncrypt = $
})(JSEncrypt);
function getpwd(password, uuid) {
var str = '[' + password + ',' + uuid + ']'
var r = new JSEncrypt;
r.setPublicKey("MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCZItlBTz8KiqzInZ0r84ImFcHVKefMMskRfnnU4C5D+YndbXq1GdVviCnfFz8GDGpHgm1fRi03ThQqBs7njXf9qkKcRZeCXdHEwJ5s7jCuPQSrn+tBxtYOpN6Db7QufTbiKj5m35VMVzIa4QvcUzG1KJWawc79+JAJz4Re6n3tAwIDAQAB");
return r.encrypt(str);
}

你可能感兴趣的:(Encryption,and,decryption)