• 【JavaScript 逆向】webpack 之某妹游戏登录逆向


    前言

            现在一些网站对 JavaScript 代码采取了一定的保护措施,比如变量名混淆、执行逻辑混淆、反调试、核心逻辑加密等,有的还对数据接口进行了加密,本次的案例为 RSA 加密。

            RSA 是非对称加密,区分公钥和私钥,RSA 算法是目前理论和实际应用中最为成熟的和完善的公钥密码体制,其用来解决对称密码的密钥分发问题,还可以用来进行数字签名来保证信息的否定与抵赖,利用数字签名较容易发现攻击者对信息的非法篡改以保证信息的完整性。

    声明

            本文章中所有内容仅供学习交流,相关链接做了脱敏处理,若有侵权,请联系我立即删除!

    Webpack

            webpack 是 JavaScript 应用程序的模块打包器,可以把开发中的所有资源(图片、js文件、css文件等)都看成模块,通过 loader(加载器)和 plugins(插件)对资源进行处理,打包成符合生产环境部署的前端资源,所有的资源都是通过 JavaScript 渲染出来的,目前 Vue,React 等前端项目,基本上都是基于 webpack 进行工程化开发的。

            一般通过 webpack 打包的 JavaScript 文件都为一整个自执行函数,以下为一类自执行函数,函数前面加上一元操作符,后面加上括号,一般自执行函数最后都是括号:

    1. !function () {
    2. console.log("Yy_Rose")
    3. }();

    webpack 类型的基本结构

    第一种类型:

    1. // 模块为 Object 形式, 元素为函数对象
    2. !function('参数'){'加载器'}({'模块'});

    本文案例即为此种类型,function e( ) 函数体即为加载器,并包含 call( ) 方法:

    1. !function(t) {
    2. // 加载器
    3. function e(s) {
    4. if (i[s])
    5. return i[s].exports;
    6. var n = i[s] = {
    7. exports: {},
    8. id: s,
    9. loaded: !1
    10. };
    11. return t[s].call(n.exports, n, n.exports, e),
    12. n.loaded = !0,
    13. n.exports
    14. }
    15. ...
    16. ...
    17. }({
    18. // 模块
    19. 0: function(){},
    20. 1: function(){},
    21. 2: function(){},
    22. ...
    23. ...
    24. 56: function(){},
    25. });

    第二种类型: 

    1. // 模块以数组形式存储, 数组中的每个元素都是函数
    2. !function('参数'){'加载器'}(['模块']);

    将上述代码样例进行改写,即为第二种类型:

    1. !function(t) {
    2. // 加载器
    3. function e(s) {
    4. ...
    5. ...
    6. }
    7. ...
    8. ...
    9. }([
    10. // 模块
    11. function(){console.log('Yy_Rose')},
    12. ...
    13. ...
    14. function(){console.log('Yy_Rose')},
    15. ]);

    案例目标

    网址:

    aHR0cHM6Ly93d3cuZ205OS5jb20v

    登录接口:

    aHR0cHM6Ly9wYXNzcG9ydC5nbTk5LmNvbS9sb2dpbi9sb2dpbjM=

    以上均做了脱敏处理,Base64 编码及解码方式:

    1. import base64
    2. # 编码
    3. # result = base64.b64encode('待编码字符串'.encode('utf-8'))
    4. # 解码
    5. result = base64.b64decode('待解码字符串'.encode('utf-8'))
    6. print(result)

    常规 JavaScript 逆向思路

    一般情况下,JavaScript 逆向分为三步:

    1. 寻找入口:逆向在大部分情况下就是找一些加密参数到底是怎么来的,关键逻辑可能写在某个关键的方法或者隐藏在某个关键的变量里,一个网站可能加载了很多 JavaScript 文件,如何从这么多的 JavaScript 文件的代码行中找到关键的位置,很重要;
    2. 调试分析:找到入口后,我们定位到某个参数可能是在某个方法中执行的了,那么里面的逻辑是怎么样的,调用了多少加密算法,经过了多少赋值变换,需要把整体思路整理清楚,以便于断点或反混淆工具等进行调试分析;
    3. 模拟执行:经过调试分析后,差不多弄清了逻辑,就需要对加密过程进行逻辑复现,以拿到最后我们想要的数据

    接下来开始正式进行案例分析:

    寻找入口

            打开开发者人员工具进行抓包,随便输入一串账户名和密码,输入验证码后点击登录,会有如图所示的报错弹窗,在抓包到的 login3 链接的响应预览中能看到一样的报错信息,此处即为登录接口位置:

            观察其请求头中的数据信息,为 GET 请求,在 Query String Parameters 中返回了一些 JSON 格式的响应数据,通过对比分析可知各关键参数的含义:

    • uname:明文用户名

    • password:加密密码

    • ckcode:明文验证码

    • _:当前时间戳

    调试分析

    寻找加密位置

              根据上文所述,密码 password 经过加密,现对其逆向分析,这里直接全局搜索 password 关键字,可以看到有如下几个结果:

    通过分析可知加密位置在 home.min.js 文件中,点击进入该 JS 文件,会发现被压缩了,为了便于查看点击左下角的 { } 进行格式化操作,接着 CTRL + F 局部搜索 password,会发现有 83 个结果,这么多不便于查找分析,由于 password 是 JSON 格式的数据,所以可以直接搜索 password: ,搜索结果减少到了 14 个,大大降低了查找的工作量:

    打断点调试分析,password 加密后的值在该文件的第 178 行生成,该值由参数 o 传递: 

    进一步跟进参数 o 定义的位置,发现其在第 168 行定义:

    var o = a.encode(t.password, s)

    可以在第 168 行打下断点进行调试,也可以直接在控制台打印出各部分含义,如下图可知:

    • a.encode(t.password, s):输入的密码加密后的结果
    • t.password:输入的明文密码
    • s:当前时间戳

    所以参数 o 即为明文密码加当前时间戳后加密的结果,接下来进一步跟进到其 encode 加密位置,鼠标整体选中 a.encode,跟进到 home.min.js?v=IKPeng:formatted:592 中,即该文件的第 592 行:

    以下即为关键的加密位置:

    关键加密代码分析

    如上图所示,第 588、589 行能看到两个明显的加密特征:

    • JSEncrypt:JavaScript 中加密模块之一,为 RSA 加密算法提供支持
    • setPublicKey:设置公钥

    所以可以推断,返回的响应参数中 password 的值经过了 RSA 加密,以下进一步加密部分进行分析:

    1. n.prototype.encode = function(t, e) {
    2. var i = e ? e + "|" + t : t;
    3. return encodeURIComponent(this.jsencrypt.encrypt(i))
    4. }
    • t:输入的明文密码
    • e:当前的时间戳
    • i:将 e 和 t 通过 | 拼接后的结果
    • this.jsencrypt.encrypt(i):将 i 进行 RSA 加密
    • encodeURIComponent( ):对 URL 中的某个参数进行编码 

    模拟执行

    这里通过两种方式,对加密位置模拟执行以的到加密后的 password 参数的值:

    1. Node.js 引入 JSEncrypt 加密模块进行加密

    1. // 通过 require 引入 jsencrypt 加密模块
    2. var JSEncrypt = require('jsencrypt')
    3. function getPassword(t, e) {
    4. var jsEncrypt = new JSEncrypt();
    5. // 设置公钥
    6. jsEncrypt.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDq04c6My441Gj0UFKgrqUhAUg+kQZeUeWSPlAU9fr4HBPDldAeqzx1UR92KJHuQh/zs1HOamE2dgX9z/2oXcJaqoRIA/FXysx+z2YlJkSk8XQLcQ8EBOkp//MZrixam7lCYpNOjadQBb2Ot0U/Ky+jF2p+Ie8gSZ7/u+Wnr5grywIDAQAB');
    7. var i = e ? e + "|" + t : t;
    8. return encodeURIComponent(jsEncrypt.encrypt(i));
    9. }
    10. // 明文密码
    11. var password = "123456";
    12. // 当前时间戳
    13. var timestamp = (new Date).getTime();
    14. console.log(getPassword(password, timestamp));

    2. 改写 webpack,导出方法调用

    本文一开始讲述了 webpack 模块化方法的基本样式,该 JS 文件的开头能找到加载器位置:

    上文中我们找到了 password 参数的加密位置,如下图所示,该加密位置在第 3 个模块中,同时从第 591 行我们可以看到,变量 r 引用了第 4 个模块中的内容:

    这里直接将模块 3 和模块 4 的内容整体扣出,再将加载器 e 作为全局变量导出调用即可:

    1. var window = global;
    2. var navigator = {};
    3. !function(t) {
    4. function e(s) {
    5. if (i[s])
    6. return i[s].exports;
    7. var n = i[s] = {
    8. exports: {},
    9. id: s,
    10. loaded: !1
    11. };
    12. return t[s].call(n.exports, n, n.exports, e),
    13. n.loaded = !0,
    14. n.exports
    15. }
    16. var i = {};
    17. // 导出加载器
    18. window.code = e;
    19. }({
    20. 3: function(t, e, i) {
    21. var s;
    22. s = function(t, e, s) {
    23. function n() {
    24. "undefined" != typeof r && (this.jsencrypt = new r.JSEncrypt,
    25. this.jsencrypt.setPublicKey("-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDq04c6My441Gj0UFKgrqUhAUg+kQZeUeWSPlAU9fr4HBPDldAeqzx1UR92KJHuQh/zs1HOamE2dgX9z/2oXcJaqoRIA/FXysx+z2YlJkSk8XQLcQ8EBOkp//MZrixam7lCYpNOjadQBb2Ot0U/Ky+jF2p+Ie8gSZ7/u+Wnr5grywIDAQAB-----END PUBLIC KEY-----"))
    26. }
    27. var r = i(4);
    28. n.prototype.encode = function(t, e) {
    29. var i = e ? e + "|" + t : t;
    30. return encodeURIComponent(this.jsencrypt.encrypt(i))
    31. }
    32. ,
    33. s.exports = n
    34. }
    35. .call(e, i, e, t),
    36. !(void 0 !== s && (t.exports = s))
    37. },
    38. 4: function(t, e, i) {
    39. var s, n, r, s;
    40. s = function(t, e, i) {
    41. /*! JSEncrypt v2.3.1 | //npmcdn.com/jsencrypt@2.3.1/LICENSE.txt */
    42. !function(t, o) {
    43. r = [e],
    44. n = o,
    45. s = "function" == typeof n ? n.apply(e, r) : n,
    46. !(void 0 !== s && (i.exports = s))
    47. }(this, function(t) {
    48. function e(t, e, i) {
    49. null != t && ("number" == typeof t ? this.fromNumber(t, e, i) : null == e && "string" != typeof t ? this.fromString(t, 256) : this.fromString(t, e))
    50. }
    51. function i() {
    52. return new e(null)
    53. }
    54. function s(t, e, i, s, n, r) {
    55. for (; --r >= 0; ) {
    56. var o = e * this[t++] + i[s] + n;
    57. n = Math.floor(o / 67108864),
    58. i[s++] = 67108863 & o
    59. }
    60. return n
    61. }
    62. function n(t, e, i, s, n, r) {
    63. for (var o = 32767 & e, a = e >> 15; --r >= 0; ) {
    64. var c = 32767 & this[t]
    65. , l = this[t++] >> 15
    66. , u = a * c + l * o;
    67. c = o * c + ((32767 & u) << 15) + i[s] + (1073741823 & n),
    68. n = (c >>> 30) + (u >>> 15) + a * l + (n >>> 30),
    69. i[s++] = 1073741823 & c
    70. }
    71. return n
    72. }
    73. function r(t, e, i, s, n, r) {
    74. for (var o = 16383 & e, a = e >> 14; --r >= 0; ) {
    75. var c = 16383 & this[t]
    76. , l = this[t++] >> 14
    77. , u = a * c + l * o;
    78. c = o * c + ((16383 & u) << 14) + i[s] + n,
    79. n = (c >> 28) + (u >> 14) + a * l,
    80. i[s++] = 268435455 & c
    81. }
    82. return n
    83. }
    84. function o(t) {
    85. return Te.charAt(t)
    86. }
    87. function a(t, e) {
    88. var i = Ie[t.charCodeAt(e)];
    89. return null == i ? -1 : i
    90. }
    91. function c(t) {
    92. for (var e = this.t - 1; e >= 0; --e)
    93. t[e] = this[e];
    94. t.t = this.t,
    95. t.s = this.s
    96. }
    97. function l(t) {
    98. this.t = 1,
    99. this.s = 0 > t ? -1 : 0,
    100. t > 0 ? this[0] = t : -1 > t ? this[0] = t + this.DV : this.t = 0
    101. }
    102. function u(t) {
    103. var e = i();
    104. return e.fromInt(t),
    105. e
    106. }
    107. function p(t, i) {
    108. var s;
    109. if (16 == i)
    110. s = 4;
    111. else if (8 == i)
    112. s = 3;
    113. else if (256 == i)
    114. s = 8;
    115. else if (2 == i)
    116. s = 1;
    117. else if (32 == i)
    118. s = 5;
    119. else {
    120. if (4 != i)
    121. return void this.fromRadix(t, i);
    122. s = 2
    123. }
    124. this.t = 0,
    125. this.s = 0;
    126. for (var n = t.length, r = !1, o = 0; --n >= 0; ) {
    127. var c = 8 == s ? 255 & t[n] : a(t, n);
    128. 0 > c ? "-" == t.charAt(n) && (r = !0) : (r = !1,
    129. 0 == o ? this[this.t++] = c : o + s > this.DB ? (this[this.t - 1] |= (c & (1 << this.DB - o) - 1) << o,
    130. this[this.t++] = c >> this.DB - o) : this[this.t - 1] |= c << o,
    131. o += s,
    132. o >= this.DB && (o -= this.DB))
    133. }
    134. 8 == s && 0 != (128 & t[0]) && (this.s = -1,
    135. o > 0 && (this[this.t - 1] |= (1 << this.DB - o) - 1 << o)),
    136. this.clamp(),
    137. r && e.ZERO.subTo(this, this)
    138. }
    139. function d() {
    140. for (var t = this.s & this.DM; this.t > 0 && this[this.t - 1] == t; )
    141. --this.t
    142. }
    143. function h(t) {
    144. if (this.s < 0)
    145. return "-" + this.negate().toString(t);
    146. var e;
    147. if (16 == t)
    148. e = 4;
    149. else if (8 == t)
    150. e = 3;
    151. else if (2 == t)
    152. e = 1;
    153. else if (32 == t)
    154. e = 5;
    155. else {
    156. if (4 != t)
    157. return this.toRadix(t);
    158. e = 2
    159. }
    160. var i, s = (1 << e) - 1, n = !1, r = "", a = this.t, c = this.DB - a * this.DB % e;
    161. if (a-- > 0)
    162. for (c < this.DB && (i = this[a] >> c) > 0 && (n = !0,
    163. r = o(i)); a >= 0; )
    164. e > c ? (i = (this[a] & (1 << c) - 1) << e - c,
    165. i |= this[--a] >> (c += this.DB - e)) : (i = this[a] >> (c -= e) & s,
    166. 0 >= c && (c += this.DB,
    167. --a)),
    168. i > 0 && (n = !0),
    169. n && (r += o(i));
    170. return n ? r : "0"
    171. }
    172. function f() {
    173. var t = i();
    174. return e.ZERO.subTo(this, t),
    175. t
    176. }
    177. function g() {
    178. return this.s < 0 ? this.negate() : this
    179. }
    180. function m(t) {
    181. var e = this.s - t.s;
    182. if (0 != e)
    183. return e;
    184. var i = this.t;
    185. if (e = i - t.t,
    186. 0 != e)
    187. return this.s < 0 ? -e : e;
    188. for (; --i >= 0; )
    189. if (0 != (e = this[i] - t[i]))
    190. return e;
    191. return 0
    192. }
    193. function _(t) {
    194. var e, i = 1;
    195. return 0 != (e = t >>> 16) && (t = e,
    196. i += 16),
    197. 0 != (e = t >> 8) && (t = e,
    198. i += 8),
    199. 0 != (e = t >> 4) && (t = e,
    200. i += 4),
    201. 0 != (e = t >> 2) && (t = e,
    202. i += 2),
    203. 0 != (e = t >> 1) && (t = e,
    204. i += 1),
    205. i
    206. }
    207. function b() {
    208. return this.t <= 0 ? 0 : this.DB * (this.t - 1) + _(this[this.t - 1] ^ this.s & this.DM)
    209. }
    210. function y(t, e) {
    211. var i;
    212. for (i = this.t - 1; i >= 0; --i)
    213. e[i + t] = this[i];
    214. for (i = t - 1; i >= 0; --i)
    215. e[i] = 0;
    216. e.t = this.t + t,
    217. e.s = this.s
    218. }
    219. function w(t, e) {
    220. for (var i = t; i < this.t; ++i)
    221. e[i - t] = this[i];
    222. e.t = Math.max(this.t - t, 0),
    223. e.s = this.s
    224. }
    225. function k(t, e) {
    226. var i, s = t % this.DB, n = this.DB - s, r = (1 << n) - 1, o = Math.floor(t / this.DB), a = this.s << s & this.DM;
    227. for (i = this.t - 1; i >= 0; --i)
    228. e[i + o + 1] = this[i] >> n | a,
    229. a = (this[i] & r) << s;
    230. for (i = o - 1; i >= 0; --i)
    231. e[i] = 0;
    232. e[o] = a,
    233. e.t = this.t + o + 1,
    234. e.s = this.s,
    235. e.clamp()
    236. }
    237. function x(t, e) {
    238. e.s = this.s;
    239. var i = Math.floor(t / this.DB);
    240. if (i >= this.t)
    241. return void (e.t = 0);
    242. var s = t % this.DB
    243. , n = this.DB - s
    244. , r = (1 << s) - 1;
    245. e[0] = this[i] >> s;
    246. for (var o = i + 1; o < this.t; ++o)
    247. e[o - i - 1] |= (this[o] & r) << n,
    248. e[o - i] = this[o] >> s;
    249. s > 0 && (e[this.t - i - 1] |= (this.s & r) << n),
    250. e.t = this.t - i,
    251. e.clamp()
    252. }
    253. function D(t, e) {
    254. for (var i = 0, s = 0, n = Math.min(t.t, this.t); n > i; )
    255. s += this[i] - t[i],
    256. e[i++] = s & this.DM,
    257. s >>= this.DB;
    258. if (t.t < this.t) {
    259. for (s -= t.s; i < this.t; )
    260. s += this[i],
    261. e[i++] = s & this.DM,
    262. s >>= this.DB;
    263. s += this.s
    264. } else {
    265. for (s += this.s; i < t.t; )
    266. s -= t[i],
    267. e[i++] = s & this.DM,
    268. s >>= this.DB;
    269. s -= t.s
    270. }
    271. e.s = 0 > s ? -1 : 0,
    272. -1 > s ? e[i++] = this.DV + s : s > 0 && (e[i++] = s),
    273. e.t = i,
    274. e.clamp()
    275. }
    276. function S(t, i) {
    277. var s = this.abs()
    278. , n = t.abs()
    279. , r = s.t;
    280. for (i.t = r + n.t; --r >= 0; )
    281. i[r] = 0;
    282. for (r = 0; r < n.t; ++r)
    283. i[r + s.t] = s.am(0, n[r], i, r, 0, s.t);
    284. i.s = 0,
    285. i.clamp(),
    286. this.s != t.s && e.ZERO.subTo(i, i)
    287. }
    288. function C(t) {
    289. for (var e = this.abs(), i = t.t = 2 * e.t; --i >= 0; )
    290. t[i] = 0;
    291. for (i = 0; i < e.t - 1; ++i) {
    292. var s = e.am(i, e[i], t, 2 * i, 0, 1);
    293. (t[i + e.t] += e.am(i + 1, 2 * e[i], t, 2 * i + 1, s, e.t - i - 1)) >= e.DV && (t[i + e.t] -= e.DV,
    294. t[i + e.t + 1] = 1)
    295. }
    296. t.t > 0 && (t[t.t - 1] += e.am(i, e[i], t, 2 * i, 0, 1)),
    297. t.s = 0,
    298. t.clamp()
    299. }
    300. function T(t, s, n) {
    301. var r = t.abs();
    302. if (!(r.t <= 0)) {
    303. var o = this.abs();
    304. if (o.t < r.t)
    305. return null != s && s.fromInt(0),
    306. void (null != n && this.copyTo(n));
    307. null == n && (n = i());
    308. var a = i()
    309. , c = this.s
    310. , l = t.s
    311. , u = this.DB - _(r[r.t - 1]);
    312. u > 0 ? (r.lShiftTo(u, a),
    313. o.lShiftTo(u, n)) : (r.copyTo(a),
    314. o.copyTo(n));
    315. var p = a.t
    316. , d = a[p - 1];
    317. if (0 != d) {
    318. var h = d * (1 << this.F1) + (p > 1 ? a[p - 2] >> this.F2 : 0)
    319. , f = this.FV / h
    320. , g = (1 << this.F1) / h
    321. , m = 1 << this.F2
    322. , v = n.t
    323. , b = v - p
    324. , y = null == s ? i() : s;
    325. for (a.dlShiftTo(b, y),
    326. n.compareTo(y) >= 0 && (n[n.t++] = 1,
    327. n.subTo(y, n)),
    328. e.ONE.dlShiftTo(p, y),
    329. y.subTo(a, a); a.t < p; )
    330. a[a.t++] = 0;
    331. for (; --b >= 0; ) {
    332. var w = n[--v] == d ? this.DM : Math.floor(n[v] * f + (n[v - 1] + m) * g);
    333. if ((n[v] += a.am(0, w, n, b, 0, p)) < w)
    334. for (a.dlShiftTo(b, y),
    335. n.subTo(y, n); n[v] < --w; )
    336. n.subTo(y, n)
    337. }
    338. null != s && (n.drShiftTo(p, s),
    339. c != l && e.ZERO.subTo(s, s)),
    340. n.t = p,
    341. n.clamp(),
    342. u > 0 && n.rShiftTo(u, n),
    343. 0 > c && e.ZERO.subTo(n, n)
    344. }
    345. }
    346. }
    347. function I(t) {
    348. var s = i();
    349. return this.abs().divRemTo(t, null, s),
    350. this.s < 0 && s.compareTo(e.ZERO) > 0 && t.subTo(s, s),
    351. s
    352. }
    353. function $(t) {
    354. this.m = t
    355. }
    356. function P(t) {
    357. return t.s < 0 || t.compareTo(this.m) >= 0 ? t.mod(this.m) : t
    358. }
    359. function R(t) {
    360. return t
    361. }
    362. function A(t) {
    363. t.divRemTo(this.m, null, t)
    364. }
    365. function E(t, e, i) {
    366. t.multiplyTo(e, i),
    367. this.reduce(i)
    368. }
    369. function M(t, e) {
    370. t.squareTo(e),
    371. this.reduce(e)
    372. }
    373. function N() {
    374. if (this.t < 1)
    375. return 0;
    376. var t = this[0];
    377. if (0 == (1 & t))
    378. return 0;
    379. var e = 3 & t;
    380. return e = e * (2 - (15 & t) * e) & 15,
    381. e = e * (2 - (255 & t) * e) & 255,
    382. e = e * (2 - ((65535 & t) * e & 65535)) & 65535,
    383. e = e * (2 - t * e % this.DV) % this.DV,
    384. e > 0 ? this.DV - e : -e
    385. }
    386. function O(t) {
    387. this.m = t,
    388. this.mp = t.invDigit(),
    389. this.mpl = 32767 & this.mp,
    390. this.mph = this.mp >> 15,
    391. this.um = (1 << t.DB - 15) - 1,
    392. this.mt2 = 2 * t.t
    393. }
    394. function B(t) {
    395. var s = i();
    396. return t.abs().dlShiftTo(this.m.t, s),
    397. s.divRemTo(this.m, null, s),
    398. t.s < 0 && s.compareTo(e.ZERO) > 0 && this.m.subTo(s, s),
    399. s
    400. }
    401. function j(t) {
    402. var e = i();
    403. return t.copyTo(e),
    404. this.reduce(e),
    405. e
    406. }
    407. function L(t) {
    408. for (; t.t <= this.mt2; )
    409. t[t.t++] = 0;
    410. for (var e = 0; e < this.m.t; ++e) {
    411. var i = 32767 & t[e]
    412. , s = i * this.mpl + ((i * this.mph + (t[e] >> 15) * this.mpl & this.um) << 15) & t.DM;
    413. for (i = e + this.m.t,
    414. t[i] += this.m.am(0, s, t, e, 0, this.m.t); t[i] >= t.DV; )
    415. t[i] -= t.DV,
    416. t[++i]++
    417. }
    418. t.clamp(),
    419. t.drShiftTo(this.m.t, t),
    420. t.compareTo(this.m) >= 0 && t.subTo(this.m, t)
    421. }
    422. function F(t, e) {
    423. t.squareTo(e),
    424. this.reduce(e)
    425. }
    426. function K(t, e, i) {
    427. t.multiplyTo(e, i),
    428. this.reduce(i)
    429. }
    430. function U() {
    431. return 0 == (this.t > 0 ? 1 & this[0] : this.s)
    432. }
    433. function V(t, s) {
    434. if (t > 4294967295 || 1 > t)
    435. return e.ONE;
    436. var n = i()
    437. , r = i()
    438. , o = s.convert(this)
    439. , a = _(t) - 1;
    440. for (o.copyTo(n); --a >= 0; )
    441. if (s.sqrTo(n, r),
    442. (t & 1 << a) > 0)
    443. s.mulTo(r, o, n);
    444. else {
    445. var c = n;
    446. n = r,
    447. r = c
    448. }
    449. return s.revert(n)
    450. }
    451. function z(t, e) {
    452. var i;
    453. return i = 256 > t || e.isEven() ? new $(e) : new O(e),
    454. this.exp(t, i)
    455. }
    456. function H() {
    457. var t = i();
    458. return this.copyTo(t),
    459. t
    460. }
    461. function q() {
    462. if (this.s < 0) {
    463. if (1 == this.t)
    464. return this[0] - this.DV;
    465. if (0 == this.t)
    466. return -1
    467. } else {
    468. if (1 == this.t)
    469. return this[0];
    470. if (0 == this.t)
    471. return 0
    472. }
    473. return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0]
    474. }
    475. function J() {
    476. return 0 == this.t ? this.s : this[0] << 24 >> 24
    477. }
    478. function G() {
    479. return 0 == this.t ? this.s : this[0] << 16 >> 16
    480. }
    481. function Y(t) {
    482. return Math.floor(Math.LN2 * this.DB / Math.log(t))
    483. }
    484. function W() {
    485. return this.s < 0 ? -1 : this.t <= 0 || 1 == this.t && this[0] <= 0 ? 0 : 1
    486. }
    487. function Z(t) {
    488. if (null == t && (t = 10),
    489. 0 == this.signum() || 2 > t || t > 36)
    490. return "0";
    491. var e = this.chunkSize(t)
    492. , s = Math.pow(t, e)
    493. , n = u(s)
    494. , r = i()
    495. , o = i()
    496. , a = "";
    497. for (this.divRemTo(n, r, o); r.signum() > 0; )
    498. a = (s + o.intValue()).toString(t).substr(1) + a,
    499. r.divRemTo(n, r, o);
    500. return o.intValue().toString(t) + a
    501. }
    502. function Q(t, i) {
    503. this.fromInt(0),
    504. null == i && (i = 10);
    505. for (var s = this.chunkSize(i), n = Math.pow(i, s), r = !1, o = 0, c = 0, l = 0; l < t.length; ++l) {
    506. var u = a(t, l);
    507. 0 > u ? "-" == t.charAt(l) && 0 == this.signum() && (r = !0) : (c = i * c + u,
    508. ++o >= s && (this.dMultiply(n),
    509. this.dAddOffset(c, 0),
    510. o = 0,
    511. c = 0))
    512. }
    513. o > 0 && (this.dMultiply(Math.pow(i, o)),
    514. this.dAddOffset(c, 0)),
    515. r && e.ZERO.subTo(this, this)
    516. }
    517. function X(t, i, s) {
    518. if ("number" == typeof i)
    519. if (2 > t)
    520. this.fromInt(1);
    521. else
    522. for (this.fromNumber(t, s),
    523. this.testBit(t - 1) || this.bitwiseTo(e.ONE.shiftLeft(t - 1), at, this),
    524. this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(i); )
    525. this.dAddOffset(2, 0),
    526. this.bitLength() > t && this.subTo(e.ONE.shiftLeft(t - 1), this);
    527. else {
    528. var n = new Array
    529. , r = 7 & t;
    530. n.length = (t >> 3) + 1,
    531. i.nextBytes(n),
    532. r > 0 ? n[0] &= (1 << r) - 1 : n[0] = 0,
    533. this.fromString(n, 256)
    534. }
    535. }
    536. function tt() {
    537. var t = this.t
    538. , e = new Array;
    539. e[0] = this.s;
    540. var i, s = this.DB - t * this.DB % 8, n = 0;
    541. if (t-- > 0)
    542. for (s < this.DB && (i = this[t] >> s) != (this.s & this.DM) >> s && (e[n++] = i | this.s << this.DB - s); t >= 0; )
    543. 8 > s ? (i = (this[t] & (1 << s) - 1) << 8 - s,
    544. i |= this[--t] >> (s += this.DB - 8)) : (i = this[t] >> (s -= 8) & 255,
    545. 0 >= s && (s += this.DB,
    546. --t)),
    547. 0 != (128 & i) && (i |= -256),
    548. 0 == n && (128 & this.s) != (128 & i) && ++n,
    549. (n > 0 || i != this.s) && (e[n++] = i);
    550. return e
    551. }
    552. function et(t) {
    553. return 0 == this.compareTo(t)
    554. }
    555. function it(t) {
    556. return this.compareTo(t) < 0 ? this : t
    557. }
    558. function st(t) {
    559. return this.compareTo(t) > 0 ? this : t
    560. }
    561. function nt(t, e, i) {
    562. var s, n, r = Math.min(t.t, this.t);
    563. for (s = 0; r > s; ++s)
    564. i[s] = e(this[s], t[s]);
    565. if (t.t < this.t) {
    566. for (n = t.s & this.DM,
    567. s = r; s < this.t; ++s)
    568. i[s] = e(this[s], n);
    569. i.t = this.t
    570. } else {
    571. for (n = this.s & this.DM,
    572. s = r; s < t.t; ++s)
    573. i[s] = e(n, t[s]);
    574. i.t = t.t
    575. }
    576. i.s = e(this.s, t.s),
    577. i.clamp()
    578. }
    579. function rt(t, e) {
    580. return t & e
    581. }
    582. function ot(t) {
    583. var e = i();
    584. return this.bitwiseTo(t, rt, e),
    585. e
    586. }
    587. function at(t, e) {
    588. return t | e
    589. }
    590. function ct(t) {
    591. var e = i();
    592. return this.bitwiseTo(t, at, e),
    593. e
    594. }
    595. function lt(t, e) {
    596. return t ^ e
    597. }
    598. function ut(t) {
    599. var e = i();
    600. return this.bitwiseTo(t, lt, e),
    601. e
    602. }
    603. function pt(t, e) {
    604. return t & ~e
    605. }
    606. function dt(t) {
    607. var e = i();
    608. return this.bitwiseTo(t, pt, e),
    609. e
    610. }
    611. function ht() {
    612. for (var t = i(), e = 0; e < this.t; ++e)
    613. t[e] = this.DM & ~this[e];
    614. return t.t = this.t,
    615. t.s = ~this.s,
    616. t
    617. }
    618. function ft(t) {
    619. var e = i();
    620. return 0 > t ? this.rShiftTo(-t, e) : this.lShiftTo(t, e),
    621. e
    622. }
    623. function gt(t) {
    624. var e = i();
    625. return 0 > t ? this.lShiftTo(-t, e) : this.rShiftTo(t, e),
    626. e
    627. }
    628. function mt(t) {
    629. if (0 == t)
    630. return -1;
    631. var e = 0;
    632. return 0 == (65535 & t) && (t >>= 16,
    633. e += 16),
    634. 0 == (255 & t) && (t >>= 8,
    635. e += 8),
    636. 0 == (15 & t) && (t >>= 4,
    637. e += 4),
    638. 0 == (3 & t) && (t >>= 2,
    639. e += 2),
    640. 0 == (1 & t) && ++e,
    641. e
    642. }
    643. function vt() {
    644. for (var t = 0; t < this.t; ++t)
    645. if (0 != this[t])
    646. return t * this.DB + mt(this[t]);
    647. return this.s < 0 ? this.t * this.DB : -1
    648. }
    649. function _t(t) {
    650. for (var e = 0; 0 != t; )
    651. t &= t - 1,
    652. ++e;
    653. return e
    654. }
    655. function bt() {
    656. for (var t = 0, e = this.s & this.DM, i = 0; i < this.t; ++i)
    657. t += _t(this[i] ^ e);
    658. return t
    659. }
    660. function yt(t) {
    661. var e = Math.floor(t / this.DB);
    662. return e >= this.t ? 0 != this.s : 0 != (this[e] & 1 << t % this.DB)
    663. }
    664. function wt(t, i) {
    665. var s = e.ONE.shiftLeft(t);
    666. return this.bitwiseTo(s, i, s),
    667. s
    668. }
    669. function kt(t) {
    670. return this.changeBit(t, at)
    671. }
    672. function xt(t) {
    673. return this.changeBit(t, pt)
    674. }
    675. function Dt(t) {
    676. return this.changeBit(t, lt)
    677. }
    678. function St(t, e) {
    679. for (var i = 0, s = 0, n = Math.min(t.t, this.t); n > i; )
    680. s += this[i] + t[i],
    681. e[i++] = s & this.DM,
    682. s >>= this.DB;
    683. if (t.t < this.t) {
    684. for (s += t.s; i < this.t; )
    685. s += this[i],
    686. e[i++] = s & this.DM,
    687. s >>= this.DB;
    688. s += this.s
    689. } else {
    690. for (s += this.s; i < t.t; )
    691. s += t[i],
    692. e[i++] = s & this.DM,
    693. s >>= this.DB;
    694. s += t.s
    695. }
    696. e.s = 0 > s ? -1 : 0,
    697. s > 0 ? e[i++] = s : -1 > s && (e[i++] = this.DV + s),
    698. e.t = i,
    699. e.clamp()
    700. }
    701. function Ct(t) {
    702. var e = i();
    703. return this.addTo(t, e),
    704. e
    705. }
    706. function Tt(t) {
    707. var e = i();
    708. return this.subTo(t, e),
    709. e
    710. }
    711. function It(t) {
    712. var e = i();
    713. return this.multiplyTo(t, e),
    714. e
    715. }
    716. function $t() {
    717. var t = i();
    718. return this.squareTo(t),
    719. t
    720. }
    721. function Pt(t) {
    722. var e = i();
    723. return this.divRemTo(t, e, null),
    724. e
    725. }
    726. function Rt(t) {
    727. var e = i();
    728. return this.divRemTo(t, null, e),
    729. e
    730. }
    731. function At(t) {
    732. var e = i()
    733. , s = i();
    734. return this.divRemTo(t, e, s),
    735. new Array(e,s)
    736. }
    737. function Et(t) {
    738. this[this.t] = this.am(0, t - 1, this, 0, 0, this.t),
    739. ++this.t,
    740. this.clamp()
    741. }
    742. function Mt(t, e) {
    743. if (0 != t) {
    744. for (; this.t <= e; )
    745. this[this.t++] = 0;
    746. for (this[e] += t; this[e] >= this.DV; )
    747. this[e] -= this.DV,
    748. ++e >= this.t && (this[this.t++] = 0),
    749. ++this[e]
    750. }
    751. }
    752. function Nt() {}
    753. function Ot(t) {
    754. return t
    755. }
    756. function Bt(t, e, i) {
    757. t.multiplyTo(e, i)
    758. }
    759. function jt(t, e) {
    760. t.squareTo(e)
    761. }
    762. function Lt(t) {
    763. return this.exp(t, new Nt)
    764. }
    765. function Ft(t, e, i) {
    766. var s = Math.min(this.t + t.t, e);
    767. for (i.s = 0,
    768. i.t = s; s > 0; )
    769. i[--s] = 0;
    770. var n;
    771. for (n = i.t - this.t; n > s; ++s)
    772. i[s + this.t] = this.am(0, t[s], i, s, 0, this.t);
    773. for (n = Math.min(t.t, e); n > s; ++s)
    774. this.am(0, t[s], i, s, 0, e - s);
    775. i.clamp()
    776. }
    777. function Kt(t, e, i) {
    778. --e;
    779. var s = i.t = this.t + t.t - e;
    780. for (i.s = 0; --s >= 0; )
    781. i[s] = 0;
    782. for (s = Math.max(e - this.t, 0); s < t.t; ++s)
    783. i[this.t + s - e] = this.am(e - s, t[s], i, 0, 0, this.t + s - e);
    784. i.clamp(),
    785. i.drShiftTo(1, i)
    786. }
    787. function Ut(t) {
    788. this.r2 = i(),
    789. this.q3 = i(),
    790. e.ONE.dlShiftTo(2 * t.t, this.r2),
    791. this.mu = this.r2.divide(t),
    792. this.m = t
    793. }
    794. function Vt(t) {
    795. if (t.s < 0 || t.t > 2 * this.m.t)
    796. return t.mod(this.m);
    797. if (t.compareTo(this.m) < 0)
    798. return t;
    799. var e = i();
    800. return t.copyTo(e),
    801. this.reduce(e),
    802. e
    803. }
    804. function zt(t) {
    805. return t
    806. }
    807. function Ht(t) {
    808. for (t.drShiftTo(this.m.t - 1, this.r2),
    809. t.t > this.m.t + 1 && (t.t = this.m.t + 1,
    810. t.clamp()),
    811. this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3),
    812. this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); t.compareTo(this.r2) < 0; )
    813. t.dAddOffset(1, this.m.t + 1);
    814. for (t.subTo(this.r2, t); t.compareTo(this.m) >= 0; )
    815. t.subTo(this.m, t)
    816. }
    817. function qt(t, e) {
    818. t.squareTo(e),
    819. this.reduce(e)
    820. }
    821. function Jt(t, e, i) {
    822. t.multiplyTo(e, i),
    823. this.reduce(i)
    824. }
    825. function Gt(t, e) {
    826. var s, n, r = t.bitLength(), o = u(1);
    827. if (0 >= r)
    828. return o;
    829. s = 18 > r ? 1 : 48 > r ? 3 : 144 > r ? 4 : 768 > r ? 5 : 6,
    830. n = 8 > r ? new $(e) : e.isEven() ? new Ut(e) : new O(e);
    831. var a = new Array
    832. , c = 3
    833. , l = s - 1
    834. , p = (1 << s) - 1;
    835. if (a[1] = n.convert(this),
    836. s > 1) {
    837. var d = i();
    838. for (n.sqrTo(a[1], d); p >= c; )
    839. a[c] = i(),
    840. n.mulTo(d, a[c - 2], a[c]),
    841. c += 2
    842. }
    843. var h, f, g = t.t - 1, m = !0, v = i();
    844. for (r = _(t[g]) - 1; g >= 0; ) {
    845. for (r >= l ? h = t[g] >> r - l & p : (h = (t[g] & (1 << r + 1) - 1) << l - r,
    846. g > 0 && (h |= t[g - 1] >> this.DB + r - l)),
    847. c = s; 0 == (1 & h); )
    848. h >>= 1,
    849. --c;
    850. if ((r -= c) < 0 && (r += this.DB,
    851. --g),
    852. m)
    853. a[h].copyTo(o),
    854. m = !1;
    855. else {
    856. for (; c > 1; )
    857. n.sqrTo(o, v),
    858. n.sqrTo(v, o),
    859. c -= 2;
    860. c > 0 ? n.sqrTo(o, v) : (f = o,
    861. o = v,
    862. v = f),
    863. n.mulTo(v, a[h], o)
    864. }
    865. for (; g >= 0 && 0 == (t[g] & 1 << r); )
    866. n.sqrTo(o, v),
    867. f = o,
    868. o = v,
    869. v = f,
    870. --r < 0 && (r = this.DB - 1,
    871. --g)
    872. }
    873. return n.revert(o)
    874. }
    875. function Yt(t) {
    876. var e = this.s < 0 ? this.negate() : this.clone()
    877. , i = t.s < 0 ? t.negate() : t.clone();
    878. if (e.compareTo(i) < 0) {
    879. var s = e;
    880. e = i,
    881. i = s
    882. }
    883. var n = e.getLowestSetBit()
    884. , r = i.getLowestSetBit();
    885. if (0 > r)
    886. return e;
    887. for (r > n && (r = n),
    888. r > 0 && (e.rShiftTo(r, e),
    889. i.rShiftTo(r, i)); e.signum() > 0; )
    890. (n = e.getLowestSetBit()) > 0 && e.rShiftTo(n, e),
    891. (n = i.getLowestSetBit()) > 0 && i.rShiftTo(n, i),
    892. e.compareTo(i) >= 0 ? (e.subTo(i, e),
    893. e.rShiftTo(1, e)) : (i.subTo(e, i),
    894. i.rShiftTo(1, i));
    895. return r > 0 && i.lShiftTo(r, i),
    896. i
    897. }
    898. function Wt(t) {
    899. if (0 >= t)
    900. return 0;
    901. var e = this.DV % t
    902. , i = this.s < 0 ? t - 1 : 0;
    903. if (this.t > 0)
    904. if (0 == e)
    905. i = this[0] % t;
    906. else
    907. for (var s = this.t - 1; s >= 0; --s)
    908. i = (e * i + this[s]) % t;
    909. return i
    910. }
    911. function Zt(t) {
    912. var i = t.isEven();
    913. if (this.isEven() && i || 0 == t.signum())
    914. return e.ZERO;
    915. for (var s = t.clone(), n = this.clone(), r = u(1), o = u(0), a = u(0), c = u(1); 0 != s.signum(); ) {
    916. for (; s.isEven(); )
    917. s.rShiftTo(1, s),
    918. i ? (r.isEven() && o.isEven() || (r.addTo(this, r),
    919. o.subTo(t, o)),
    920. r.rShiftTo(1, r)) : o.isEven() || o.subTo(t, o),
    921. o.rShiftTo(1, o);
    922. for (; n.isEven(); )
    923. n.rShiftTo(1, n),
    924. i ? (a.isEven() && c.isEven() || (a.addTo(this, a),
    925. c.subTo(t, c)),
    926. a.rShiftTo(1, a)) : c.isEven() || c.subTo(t, c),
    927. c.rShiftTo(1, c);
    928. s.compareTo(n) >= 0 ? (s.subTo(n, s),
    929. i && r.subTo(a, r),
    930. o.subTo(c, o)) : (n.subTo(s, n),
    931. i && a.subTo(r, a),
    932. c.subTo(o, c))
    933. }
    934. return 0 != n.compareTo(e.ONE) ? e.ZERO : c.compareTo(t) >= 0 ? c.subtract(t) : c.signum() < 0 ? (c.addTo(t, c),
    935. c.signum() < 0 ? c.add(t) : c) : c
    936. }
    937. function Qt(t) {
    938. var e, i = this.abs();
    939. if (1 == i.t && i[0] <= $e[$e.length - 1]) {
    940. for (e = 0; e < $e.length; ++e)
    941. if (i[0] == $e[e])
    942. return !0;
    943. return !1
    944. }
    945. if (i.isEven())
    946. return !1;
    947. for (e = 1; e < $e.length; ) {
    948. for (var s = $e[e], n = e + 1; n < $e.length && Pe > s; )
    949. s *= $e[n++];
    950. for (s = i.modInt(s); n > e; )
    951. if (s % $e[e++] == 0)
    952. return !1
    953. }
    954. return i.millerRabin(t)
    955. }
    956. function Xt(t) {
    957. var s = this.subtract(e.ONE)
    958. , n = s.getLowestSetBit();
    959. if (0 >= n)
    960. return !1;
    961. var r = s.shiftRight(n);
    962. t = t + 1 >> 1,
    963. t > $e.length && (t = $e.length);
    964. for (var o = i(), a = 0; t > a; ++a) {
    965. o.fromInt($e[Math.floor(Math.random() * $e.length)]);
    966. var c = o.modPow(r, this);
    967. if (0 != c.compareTo(e.ONE) && 0 != c.compareTo(s)) {
    968. for (var l = 1; l++ < n && 0 != c.compareTo(s); )
    969. if (c = c.modPowInt(2, this),
    970. 0 == c.compareTo(e.ONE))
    971. return !1;
    972. if (0 != c.compareTo(s))
    973. return !1
    974. }
    975. }
    976. return !0
    977. }
    978. function te() {
    979. this.i = 0,
    980. this.j = 0,
    981. this.S = new Array
    982. }
    983. function ee(t) {
    984. var e, i, s;
    985. for (e = 0; 256 > e; ++e)
    986. this.S[e] = e;
    987. for (i = 0,
    988. e = 0; 256 > e; ++e)
    989. i = i + this.S[e] + t[e % t.length] & 255,
    990. s = this.S[e],
    991. this.S[e] = this.S[i],
    992. this.S[i] = s;
    993. this.i = 0,
    994. this.j = 0
    995. }
    996. function ie() {
    997. var t;
    998. return this.i = this.i + 1 & 255,
    999. this.j = this.j + this.S[this.i] & 255,
    1000. t = this.S[this.i],
    1001. this.S[this.i] = this.S[this.j],
    1002. this.S[this.j] = t,
    1003. this.S[t + this.S[this.i] & 255]
    1004. }
    1005. function se() {
    1006. return new te
    1007. }
    1008. function ne() {
    1009. if (null == Re) {
    1010. for (Re = se(); Me > Ee; ) {
    1011. var t = Math.floor(65536 * Math.random());
    1012. Ae[Ee++] = 255 & t
    1013. }
    1014. for (Re.init(Ae),
    1015. Ee = 0; Ee < Ae.length; ++Ee)
    1016. Ae[Ee] = 0;
    1017. Ee = 0
    1018. }
    1019. return Re.next()
    1020. }
    1021. function re(t) {
    1022. var e;
    1023. for (e = 0; e < t.length; ++e)
    1024. t[e] = ne()
    1025. }
    1026. function oe() {}
    1027. function ae(t, i) {
    1028. return new e(t,i)
    1029. }
    1030. function ce(t, i) {
    1031. if (i < t.length + 11)
    1032. return console.error("Message too long for RSA"),
    1033. null;
    1034. for (var s = new Array, n = t.length - 1; n >= 0 && i > 0; ) {
    1035. var r = t.charCodeAt(n--);
    1036. 128 > r ? s[--i] = r : r > 127 && 2048 > r ? (s[--i] = 63 & r | 128,
    1037. s[--i] = r >> 6 | 192) : (s[--i] = 63 & r | 128,
    1038. s[--i] = r >> 6 & 63 | 128,
    1039. s[--i] = r >> 12 | 224)
    1040. }
    1041. s[--i] = 0;
    1042. for (var o = new oe, a = new Array; i > 2; ) {
    1043. for (a[0] = 0; 0 == a[0]; )
    1044. o.nextBytes(a);
    1045. s[--i] = a[0]
    1046. }
    1047. return s[--i] = 2,
    1048. s[--i] = 0,
    1049. new e(s)
    1050. }
    1051. function le() {
    1052. this.n = null,
    1053. this.e = 0,
    1054. this.d = null,
    1055. this.p = null,
    1056. this.q = null,
    1057. this.dmp1 = null,
    1058. this.dmq1 = null,
    1059. this.coeff = null
    1060. }
    1061. function ue(t, e) {
    1062. null != t && null != e && t.length > 0 && e.length > 0 ? (this.n = ae(t, 16),
    1063. this.e = parseInt(e, 16)) : console.error("Invalid RSA public key")
    1064. }
    1065. function pe(t) {
    1066. return t.modPowInt(this.e, this.n)
    1067. }
    1068. function de(t) {
    1069. var e = ce(t, this.n.bitLength() + 7 >> 3);
    1070. if (null == e)
    1071. return null;
    1072. var i = this.doPublic(e);
    1073. if (null == i)
    1074. return null;
    1075. var s = i.toString(16);
    1076. return 0 == (1 & s.length) ? s : "0" + s
    1077. }
    1078. function he(t, e) {
    1079. for (var i = t.toByteArray(), s = 0; s < i.length && 0 == i[s]; )
    1080. ++s;
    1081. if (i.length - s != e - 1 || 2 != i[s])
    1082. return null;
    1083. for (++s; 0 != i[s]; )
    1084. if (++s >= i.length)
    1085. return null;
    1086. for (var n = ""; ++s < i.length; ) {
    1087. var r = 255 & i[s];
    1088. 128 > r ? n += String.fromCharCode(r) : r > 191 && 224 > r ? (n += String.fromCharCode((31 & r) << 6 | 63 & i[s + 1]),
    1089. ++s) : (n += String.fromCharCode((15 & r) << 12 | (63 & i[s + 1]) << 6 | 63 & i[s + 2]),
    1090. s += 2)
    1091. }
    1092. return n
    1093. }
    1094. function fe(t, e, i) {
    1095. null != t && null != e && t.length > 0 && e.length > 0 ? (this.n = ae(t, 16),
    1096. this.e = parseInt(e, 16),
    1097. this.d = ae(i, 16)) : console.error("Invalid RSA private key")
    1098. }
    1099. function ge(t, e, i, s, n, r, o, a) {
    1100. null != t && null != e && t.length > 0 && e.length > 0 ? (this.n = ae(t, 16),
    1101. this.e = parseInt(e, 16),
    1102. this.d = ae(i, 16),
    1103. this.p = ae(s, 16),
    1104. this.q = ae(n, 16),
    1105. this.dmp1 = ae(r, 16),
    1106. this.dmq1 = ae(o, 16),
    1107. this.coeff = ae(a, 16)) : console.error("Invalid RSA private key")
    1108. }
    1109. function me(t, i) {
    1110. var s = new oe
    1111. , n = t >> 1;
    1112. this.e = parseInt(i, 16);
    1113. for (var r = new e(i,16); ; ) {
    1114. for (; this.p = new e(t - n,1,s),
    1115. 0 != this.p.subtract(e.ONE).gcd(r).compareTo(e.ONE) || !this.p.isProbablePrime(10); )
    1116. ;
    1117. for (; this.q = new e(n,1,s),
    1118. 0 != this.q.subtract(e.ONE).gcd(r).compareTo(e.ONE) || !this.q.isProbablePrime(10); )
    1119. ;
    1120. if (this.p.compareTo(this.q) <= 0) {
    1121. var o = this.p;
    1122. this.p = this.q,
    1123. this.q = o
    1124. }
    1125. var a = this.p.subtract(e.ONE)
    1126. , c = this.q.subtract(e.ONE)
    1127. , l = a.multiply(c);
    1128. if (0 == l.gcd(r).compareTo(e.ONE)) {
    1129. this.n = this.p.multiply(this.q),
    1130. this.d = r.modInverse(l),
    1131. this.dmp1 = this.d.mod(a),
    1132. this.dmq1 = this.d.mod(c),
    1133. this.coeff = this.q.modInverse(this.p);
    1134. break
    1135. }
    1136. }
    1137. }
    1138. function ve(t) {
    1139. if (null == this.p || null == this.q)
    1140. return t.modPow(this.d, this.n);
    1141. 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; )
    1142. e = e.add(this.p);
    1143. return e.subtract(i).multiply(this.coeff).mod(this.p).multiply(this.q).add(i)
    1144. }
    1145. function _e(t) {
    1146. var e = ae(t, 16)
    1147. , i = this.doPrivate(e);
    1148. return null == i ? null : he(i, this.n.bitLength() + 7 >> 3)
    1149. }
    1150. function be(t) {
    1151. var e, i, s = "";
    1152. for (e = 0; e + 3 <= t.length; e += 3)
    1153. i = parseInt(t.substring(e, e + 3), 16),
    1154. s += je.charAt(i >> 6) + je.charAt(63 & i);
    1155. for (e + 1 == t.length ? (i = parseInt(t.substring(e, e + 1), 16),
    1156. s += je.charAt(i << 2)) : e + 2 == t.length && (i = parseInt(t.substring(e, e + 2), 16),
    1157. s += je.charAt(i >> 2) + je.charAt((3 & i) << 4)); (3 & s.length) > 0; )
    1158. s += Le;
    1159. return s
    1160. }
    1161. function ye(t) {
    1162. var e, i, s = "", n = 0;
    1163. for (e = 0; e < t.length && t.charAt(e) != Le; ++e)
    1164. v = je.indexOf(t.charAt(e)),
    1165. v < 0 || (0 == n ? (s += o(v >> 2),
    1166. i = 3 & v,
    1167. n = 1) : 1 == n ? (s += o(i << 2 | v >> 4),
    1168. i = 15 & v,
    1169. n = 2) : 2 == n ? (s += o(i),
    1170. s += o(v >> 2),
    1171. i = 3 & v,
    1172. n = 3) : (s += o(i << 2 | v >> 4),
    1173. s += o(15 & v),
    1174. n = 0));
    1175. return 1 == n && (s += o(i << 2)),
    1176. s
    1177. }
    1178. var we, ke = 0xdeadbeefcafe, xe = 15715070 == (16777215 & ke);
    1179. xe && "Microsoft Internet Explorer" == navigator.appName ? (e.prototype.am = n,
    1180. we = 30) : xe && "Netscape" != navigator.appName ? (e.prototype.am = s,
    1181. we = 26) : (e.prototype.am = r,
    1182. we = 28),
    1183. e.prototype.DB = we,
    1184. e.prototype.DM = (1 << we) - 1,
    1185. e.prototype.DV = 1 << we;
    1186. var De = 52;
    1187. e.prototype.FV = Math.pow(2, De),
    1188. e.prototype.F1 = De - we,
    1189. e.prototype.F2 = 2 * we - De;
    1190. var Se, Ce, Te = "0123456789abcdefghijklmnopqrstuvwxyz", Ie = new Array;
    1191. for (Se = "0".charCodeAt(0),
    1192. Ce = 0; 9 >= Ce; ++Ce)
    1193. Ie[Se++] = Ce;
    1194. for (Se = "a".charCodeAt(0),
    1195. Ce = 10; 36 > Ce; ++Ce)
    1196. Ie[Se++] = Ce;
    1197. for (Se = "A".charCodeAt(0),
    1198. Ce = 10; 36 > Ce; ++Ce)
    1199. Ie[Se++] = Ce;
    1200. $.prototype.convert = P,
    1201. $.prototype.revert = R,
    1202. $.prototype.reduce = A,
    1203. $.prototype.mulTo = E,
    1204. $.prototype.sqrTo = M,
    1205. O.prototype.convert = B,
    1206. O.prototype.revert = j,
    1207. O.prototype.reduce = L,
    1208. O.prototype.mulTo = K,
    1209. O.prototype.sqrTo = F,
    1210. e.prototype.copyTo = c,
    1211. e.prototype.fromInt = l,
    1212. e.prototype.fromString = p,
    1213. e.prototype.clamp = d,
    1214. e.prototype.dlShiftTo = y,
    1215. e.prototype.drShiftTo = w,
    1216. e.prototype.lShiftTo = k,
    1217. e.prototype.rShiftTo = x,
    1218. e.prototype.subTo = D,
    1219. e.prototype.multiplyTo = S,
    1220. e.prototype.squareTo = C,
    1221. e.prototype.divRemTo = T,
    1222. e.prototype.invDigit = N,
    1223. e.prototype.isEven = U,
    1224. e.prototype.exp = V,
    1225. e.prototype.toString = h,
    1226. e.prototype.negate = f,
    1227. e.prototype.abs = g,
    1228. e.prototype.compareTo = m,
    1229. e.prototype.bitLength = b,
    1230. e.prototype.mod = I,
    1231. e.prototype.modPowInt = z,
    1232. e.ZERO = u(0),
    1233. e.ONE = u(1),
    1234. Nt.prototype.convert = Ot,
    1235. Nt.prototype.revert = Ot,
    1236. Nt.prototype.mulTo = Bt,
    1237. Nt.prototype.sqrTo = jt,
    1238. Ut.prototype.convert = Vt,
    1239. Ut.prototype.revert = zt,
    1240. Ut.prototype.reduce = Ht,
    1241. Ut.prototype.mulTo = Jt,
    1242. Ut.prototype.sqrTo = qt;
    1243. var $e = [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]
    1244. , Pe = (1 << 26) / $e[$e.length - 1];
    1245. e.prototype.chunkSize = Y,
    1246. e.prototype.toRadix = Z,
    1247. e.prototype.fromRadix = Q,
    1248. e.prototype.fromNumber = X,
    1249. e.prototype.bitwiseTo = nt,
    1250. e.prototype.changeBit = wt,
    1251. e.prototype.addTo = St,
    1252. e.prototype.dMultiply = Et,
    1253. e.prototype.dAddOffset = Mt,
    1254. e.prototype.multiplyLowerTo = Ft,
    1255. e.prototype.multiplyUpperTo = Kt,
    1256. e.prototype.modInt = Wt,
    1257. e.prototype.millerRabin = Xt,
    1258. e.prototype.clone = H,
    1259. e.prototype.intValue = q,
    1260. e.prototype.byteValue = J,
    1261. e.prototype.shortValue = G,
    1262. e.prototype.signum = W,
    1263. e.prototype.toByteArray = tt,
    1264. e.prototype.equals = et,
    1265. e.prototype.min = it,
    1266. e.prototype.max = st,
    1267. e.prototype.and = ot,
    1268. e.prototype.or = ct,
    1269. e.prototype.xor = ut,
    1270. e.prototype.andNot = dt,
    1271. e.prototype.not = ht,
    1272. e.prototype.shiftLeft = ft,
    1273. e.prototype.shiftRight = gt,
    1274. e.prototype.getLowestSetBit = vt,
    1275. e.prototype.bitCount = bt,
    1276. e.prototype.testBit = yt,
    1277. e.prototype.setBit = kt,
    1278. e.prototype.clearBit = xt,
    1279. e.prototype.flipBit = Dt,
    1280. e.prototype.add = Ct,
    1281. e.prototype.subtract = Tt,
    1282. e.prototype.multiply = It,
    1283. e.prototype.divide = Pt,
    1284. e.prototype.remainder = Rt,
    1285. e.prototype.divideAndRemainder = At,
    1286. e.prototype.modPow = Gt,
    1287. e.prototype.modInverse = Zt,
    1288. e.prototype.pow = Lt,
    1289. e.prototype.gcd = Yt,
    1290. e.prototype.isProbablePrime = Qt,
    1291. e.prototype.square = $t,
    1292. te.prototype.init = ee,
    1293. te.prototype.next = ie;
    1294. var Re, Ae, Ee, Me = 256;
    1295. if (null == Ae) {
    1296. Ae = new Array,
    1297. Ee = 0;
    1298. var Ne;
    1299. if (window.crypto && window.crypto.getRandomValues) {
    1300. var Oe = new Uint32Array(256);
    1301. for (window.crypto.getRandomValues(Oe),
    1302. Ne = 0; Ne < Oe.length; ++Ne)
    1303. Ae[Ee++] = 255 & Oe[Ne]
    1304. }
    1305. var Be = function(t) {
    1306. if (this.count = this.count || 0,
    1307. this.count >= 256 || Ee >= Me)
    1308. return void (window.removeEventListener ? window.removeEventListener("mousemove", Be, !1) : window.detachEvent && window.detachEvent("onmousemove", Be));
    1309. try {
    1310. var e = t.x + t.y;
    1311. Ae[Ee++] = 255 & e,
    1312. this.count += 1
    1313. } catch (t) {}
    1314. };
    1315. window.addEventListener ? window.addEventListener("mousemove", Be, !1) : window.attachEvent && window.attachEvent("onmousemove", Be)
    1316. }
    1317. oe.prototype.nextBytes = re,
    1318. le.prototype.doPublic = pe,
    1319. le.prototype.setPublic = ue,
    1320. le.prototype.encrypt = de,
    1321. le.prototype.doPrivate = ve,
    1322. le.prototype.setPrivate = fe,
    1323. le.prototype.setPrivateEx = ge,
    1324. le.prototype.generate = me,
    1325. le.prototype.decrypt = _e,
    1326. function() {
    1327. var t = function(t, s, n) {
    1328. var r = new oe
    1329. , o = t >> 1;
    1330. this.e = parseInt(s, 16);
    1331. var a = new e(s,16)
    1332. , c = this
    1333. , l = function() {
    1334. var s = function() {
    1335. if (c.p.compareTo(c.q) <= 0) {
    1336. var t = c.p;
    1337. c.p = c.q,
    1338. c.q = t
    1339. }
    1340. var i = c.p.subtract(e.ONE)
    1341. , s = c.q.subtract(e.ONE)
    1342. , r = i.multiply(s);
    1343. 0 == r.gcd(a).compareTo(e.ONE) ? (c.n = c.p.multiply(c.q),
    1344. c.d = a.modInverse(r),
    1345. c.dmp1 = c.d.mod(i),
    1346. c.dmq1 = c.d.mod(s),
    1347. c.coeff = c.q.modInverse(c.p),
    1348. setTimeout(function() {
    1349. n()
    1350. }, 0)) : setTimeout(l, 0)
    1351. }
    1352. , u = function() {
    1353. c.q = i(),
    1354. c.q.fromNumberAsync(o, 1, r, function() {
    1355. c.q.subtract(e.ONE).gcda(a, function(t) {
    1356. 0 == t.compareTo(e.ONE) && c.q.isProbablePrime(10) ? setTimeout(s, 0) : setTimeout(u, 0)
    1357. })
    1358. })
    1359. }
    1360. , p = function() {
    1361. c.p = i(),
    1362. c.p.fromNumberAsync(t - o, 1, r, function() {
    1363. c.p.subtract(e.ONE).gcda(a, function(t) {
    1364. 0 == t.compareTo(e.ONE) && c.p.isProbablePrime(10) ? setTimeout(u, 0) : setTimeout(p, 0)
    1365. })
    1366. })
    1367. };
    1368. setTimeout(p, 0)
    1369. };
    1370. setTimeout(l, 0)
    1371. };
    1372. le.prototype.generateAsync = t;
    1373. var s = function(t, e) {
    1374. var i = this.s < 0 ? this.negate() : this.clone()
    1375. , s = t.s < 0 ? t.negate() : t.clone();
    1376. if (i.compareTo(s) < 0) {
    1377. var n = i;
    1378. i = s,
    1379. s = n
    1380. }
    1381. var r = i.getLowestSetBit()
    1382. , o = s.getLowestSetBit();
    1383. if (0 > o)
    1384. return void e(i);
    1385. o > r && (o = r),
    1386. o > 0 && (i.rShiftTo(o, i),
    1387. s.rShiftTo(o, s));
    1388. var a = function() {
    1389. (r = i.getLowestSetBit()) > 0 && i.rShiftTo(r, i),
    1390. (r = s.getLowestSetBit()) > 0 && s.rShiftTo(r, s),
    1391. i.compareTo(s) >= 0 ? (i.subTo(s, i),
    1392. i.rShiftTo(1, i)) : (s.subTo(i, s),
    1393. s.rShiftTo(1, s)),
    1394. i.signum() > 0 ? setTimeout(a, 0) : (o > 0 && s.lShiftTo(o, s),
    1395. setTimeout(function() {
    1396. e(s)
    1397. }, 0))
    1398. };
    1399. setTimeout(a, 10)
    1400. };
    1401. e.prototype.gcda = s;
    1402. var n = function(t, i, s, n) {
    1403. if ("number" == typeof i)
    1404. if (2 > t)
    1405. this.fromInt(1);
    1406. else {
    1407. this.fromNumber(t, s),
    1408. this.testBit(t - 1) || this.bitwiseTo(e.ONE.shiftLeft(t - 1), at, this),
    1409. this.isEven() && this.dAddOffset(1, 0);
    1410. var r = this
    1411. , o = function() {
    1412. r.dAddOffset(2, 0),
    1413. r.bitLength() > t && r.subTo(e.ONE.shiftLeft(t - 1), r),
    1414. r.isProbablePrime(i) ? setTimeout(function() {
    1415. n()
    1416. }, 0) : setTimeout(o, 0)
    1417. };
    1418. setTimeout(o, 0)
    1419. }
    1420. else {
    1421. var a = new Array
    1422. , c = 7 & t;
    1423. a.length = (t >> 3) + 1,
    1424. i.nextBytes(a),
    1425. c > 0 ? a[0] &= (1 << c) - 1 : a[0] = 0,
    1426. this.fromString(a, 256)
    1427. }
    1428. };
    1429. e.prototype.fromNumberAsync = n
    1430. }();
    1431. var je = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
    1432. , Le = "="
    1433. , Fe = Fe || {};
    1434. Fe.env = Fe.env || {};
    1435. var Ke = Fe
    1436. , Ue = Object.prototype
    1437. , Ve = "[object Function]"
    1438. , ze = ["toString", "valueOf"];
    1439. Fe.env.parseUA = function(t) {
    1440. var e, i = function(t) {
    1441. var e = 0;
    1442. return parseFloat(t.replace(/\./g, function() {
    1443. return 1 == e++ ? "" : "."
    1444. }))
    1445. }, s = navigator, n = {
    1446. ie: 0,
    1447. opera: 0,
    1448. gecko: 0,
    1449. webkit: 0,
    1450. chrome: 0,
    1451. mobile: null,
    1452. air: 0,
    1453. ipad: 0,
    1454. iphone: 0,
    1455. ipod: 0,
    1456. ios: null,
    1457. android: 0,
    1458. webos: 0,
    1459. caja: s && s.cajaVersion,
    1460. secure: !1,
    1461. os: null
    1462. }, r = t || navigator && navigator.userAgent, o = window && window.location, a = o && o.href;
    1463. return n.secure = a && 0 === a.toLowerCase().indexOf("https"),
    1464. r && (/windows|win32/i.test(r) ? n.os = "windows" : /macintosh/i.test(r) ? n.os = "macintosh" : /rhino/i.test(r) && (n.os = "rhino"),
    1465. /KHTML/.test(r) && (n.webkit = 1),
    1466. e = r.match(/AppleWebKit\/([^\s]*)/),
    1467. e && e[1] && (n.webkit = i(e[1]),
    1468. / Mobile\//.test(r) ? (n.mobile = "Apple",
    1469. e = r.match(/OS ([^\s]*)/),
    1470. e && e[1] && (e = i(e[1].replace("_", "."))),
    1471. n.ios = e,
    1472. n.ipad = n.ipod = n.iphone = 0,
    1473. e = r.match(/iPad|iPod|iPhone/),
    1474. e && e[0] && (n[e[0].toLowerCase()] = n.ios)) : (e = r.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/),
    1475. e && (n.mobile = e[0]),
    1476. /webOS/.test(r) && (n.mobile = "WebOS",
    1477. e = r.match(/webOS\/([^\s]*);/),
    1478. e && e[1] && (n.webos = i(e[1]))),
    1479. / Android/.test(r) && (n.mobile = "Android",
    1480. e = r.match(/Android ([^\s]*);/),
    1481. e && e[1] && (n.android = i(e[1])))),
    1482. e = r.match(/Chrome\/([^\s]*)/),
    1483. e && e[1] ? n.chrome = i(e[1]) : (e = r.match(/AdobeAIR\/([^\s]*)/),
    1484. e && (n.air = e[0]))),
    1485. n.webkit || (e = r.match(/Opera[\s\/]([^\s]*)/),
    1486. e && e[1] ? (n.opera = i(e[1]),
    1487. e = r.match(/Version\/([^\s]*)/),
    1488. e && e[1] && (n.opera = i(e[1])),
    1489. e = r.match(/Opera Mini[^;]*/),
    1490. e && (n.mobile = e[0])) : (e = r.match(/MSIE\s([^;]*)/),
    1491. e && e[1] ? n.ie = i(e[1]) : (e = r.match(/Gecko\/([^\s]*)/),
    1492. e && (n.gecko = 1,
    1493. e = r.match(/rv:([^\s\)]*)/),
    1494. e && e[1] && (n.gecko = i(e[1]))))))),
    1495. n
    1496. }
    1497. ,
    1498. Fe.env.ua = Fe.env.parseUA(),
    1499. Fe.isFunction = function(t) {
    1500. return "function" == typeof t || Ue.toString.apply(t) === Ve
    1501. }
    1502. ,
    1503. Fe._IEEnumFix = Fe.env.ua.ie ? function(t, e) {
    1504. var i, s, n;
    1505. for (i = 0; i < ze.length; i += 1)
    1506. s = ze[i],
    1507. n = e[s],
    1508. Ke.isFunction(n) && n != Ue[s] && (t[s] = n)
    1509. }
    1510. : function() {}
    1511. ,
    1512. Fe.extend = function(t, e, i) {
    1513. if (!e || !t)
    1514. throw new Error("extend failed, please check that all dependencies are included.");
    1515. var s, n = function() {};
    1516. if (n.prototype = e.prototype,
    1517. t.prototype = new n,
    1518. t.prototype.constructor = t,
    1519. t.superclass = e.prototype,
    1520. e.prototype.constructor == Ue.constructor && (e.prototype.constructor = e),
    1521. i) {
    1522. for (s in i)
    1523. Ke.hasOwnProperty(i, s) && (t.prototype[s] = i[s]);
    1524. Ke._IEEnumFix(t.prototype, i)
    1525. }
    1526. }
    1527. ,
    1528. /**
    1529. * @fileOverview
    1530. * @name asn1-1.0.js
    1531. * @author Kenji Urushima kenji.urushima@gmail.com
    1532. * @version 1.0.2 (2013-May-30)
    1533. * @since 2.1
    1534. * @license MIT License
    1535. */
    1536. "undefined" != typeof KJUR && KJUR || (KJUR = {}),
    1537. "undefined" != typeof KJUR.asn1 && KJUR.asn1 || (KJUR.asn1 = {}),
    1538. KJUR.asn1.ASN1Util = new function() {
    1539. this.integerToByteHex = function(t) {
    1540. var e = t.toString(16);
    1541. return e.length % 2 == 1 && (e = "0" + e),
    1542. e
    1543. }
    1544. ,
    1545. this.bigIntToMinTwosComplementsHex = function(t) {
    1546. var i = t.toString(16);
    1547. if ("-" != i.substr(0, 1))
    1548. i.length % 2 == 1 ? i = "0" + i : i.match(/^[0-7]/) || (i = "00" + i);
    1549. else {
    1550. var s = i.substr(1)
    1551. , n = s.length;
    1552. n % 2 == 1 ? n += 1 : i.match(/^[0-7]/) || (n += 2);
    1553. for (var r = "", o = 0; n > o; o++)
    1554. r += "f";
    1555. var a = new e(r,16)
    1556. , c = a.xor(t).add(e.ONE);
    1557. i = c.toString(16).replace(/^-/, "")
    1558. }
    1559. return i
    1560. }
    1561. ,
    1562. this.getPEMStringFromHex = function(t, e) {
    1563. var i = CryptoJS.enc.Hex.parse(t)
    1564. , s = CryptoJS.enc.Base64.stringify(i)
    1565. , n = s.replace(/(.{64})/g, "$1\r\n");
    1566. return n = n.replace(/\r\n$/, ""),
    1567. "-----BEGIN " + e + "-----\r\n" + n + "\r\n-----END " + e + "-----\r\n"
    1568. }
    1569. }
    1570. ,
    1571. KJUR.asn1.ASN1Object = function() {
    1572. var t = "";
    1573. this.getLengthHexFromValue = function() {
    1574. if ("undefined" == typeof this.hV || null == this.hV)
    1575. throw "this.hV is null or undefined.";
    1576. if (this.hV.length % 2 == 1)
    1577. throw "value hex must be even length: n=" + t.length + ",v=" + this.hV;
    1578. var e = this.hV.length / 2
    1579. , i = e.toString(16);
    1580. if (i.length % 2 == 1 && (i = "0" + i),
    1581. 128 > e)
    1582. return i;
    1583. var s = i.length / 2;
    1584. if (s > 15)
    1585. throw "ASN.1 length too long to represent by 8x: n = " + e.toString(16);
    1586. var n = 128 + s;
    1587. return n.toString(16) + i
    1588. }
    1589. ,
    1590. this.getEncodedHex = function() {
    1591. return (null == this.hTLV || this.isModified) && (this.hV = this.getFreshValueHex(),
    1592. this.hL = this.getLengthHexFromValue(),
    1593. this.hTLV = this.hT + this.hL + this.hV,
    1594. this.isModified = !1),
    1595. this.hTLV
    1596. }
    1597. ,
    1598. this.getValueHex = function() {
    1599. return this.getEncodedHex(),
    1600. this.hV
    1601. }
    1602. ,
    1603. this.getFreshValueHex = function() {
    1604. return ""
    1605. }
    1606. }
    1607. ,
    1608. KJUR.asn1.DERAbstractString = function(t) {
    1609. KJUR.asn1.DERAbstractString.superclass.constructor.call(this),
    1610. this.getString = function() {
    1611. return this.s
    1612. }
    1613. ,
    1614. this.setString = function(t) {
    1615. this.hTLV = null,
    1616. this.isModified = !0,
    1617. this.s = t,
    1618. this.hV = stohex(this.s)
    1619. }
    1620. ,
    1621. this.setStringHex = function(t) {
    1622. this.hTLV = null,
    1623. this.isModified = !0,
    1624. this.s = null,
    1625. this.hV = t
    1626. }
    1627. ,
    1628. this.getFreshValueHex = function() {
    1629. return this.hV
    1630. }
    1631. ,
    1632. "undefined" != typeof t && ("undefined" != typeof t.str ? this.setString(t.str) : "undefined" != typeof t.hex && this.setStringHex(t.hex))
    1633. }
    1634. ,
    1635. Fe.extend(KJUR.asn1.DERAbstractString, KJUR.asn1.ASN1Object),
    1636. KJUR.asn1.DERAbstractTime = function(t) {
    1637. KJUR.asn1.DERAbstractTime.superclass.constructor.call(this),
    1638. this.localDateToUTC = function(t) {
    1639. utc = t.getTime() + 6e4 * t.getTimezoneOffset();
    1640. var e = new Date(utc);
    1641. return e
    1642. }
    1643. ,
    1644. this.formatDate = function(t, e) {
    1645. var i = this.zeroPadding
    1646. , s = this.localDateToUTC(t)
    1647. , n = String(s.getFullYear());
    1648. "utc" == e && (n = n.substr(2, 2));
    1649. var r = i(String(s.getMonth() + 1), 2)
    1650. , o = i(String(s.getDate()), 2)
    1651. , a = i(String(s.getHours()), 2)
    1652. , c = i(String(s.getMinutes()), 2)
    1653. , l = i(String(s.getSeconds()), 2);
    1654. return n + r + o + a + c + l + "Z"
    1655. }
    1656. ,
    1657. this.zeroPadding = function(t, e) {
    1658. return t.length >= e ? t : new Array(e - t.length + 1).join("0") + t
    1659. }
    1660. ,
    1661. this.getString = function() {
    1662. return this.s
    1663. }
    1664. ,
    1665. this.setString = function(t) {
    1666. this.hTLV = null,
    1667. this.isModified = !0,
    1668. this.s = t,
    1669. this.hV = stohex(this.s)
    1670. }
    1671. ,
    1672. this.setByDateValue = function(t, e, i, s, n, r) {
    1673. var o = new Date(Date.UTC(t, e - 1, i, s, n, r, 0));
    1674. this.setByDate(o)
    1675. }
    1676. ,
    1677. this.getFreshValueHex = function() {
    1678. return this.hV
    1679. }
    1680. }
    1681. ,
    1682. Fe.extend(KJUR.asn1.DERAbstractTime, KJUR.asn1.ASN1Object),
    1683. KJUR.asn1.DERAbstractStructured = function(t) {
    1684. KJUR.asn1.DERAbstractString.superclass.constructor.call(this),
    1685. this.setByASN1ObjectArray = function(t) {
    1686. this.hTLV = null,
    1687. this.isModified = !0,
    1688. this.asn1Array = t
    1689. }
    1690. ,
    1691. this.appendASN1Object = function(t) {
    1692. this.hTLV = null,
    1693. this.isModified = !0,
    1694. this.asn1Array.push(t)
    1695. }
    1696. ,
    1697. this.asn1Array = new Array,
    1698. "undefined" != typeof t && "undefined" != typeof t.array && (this.asn1Array = t.array)
    1699. }
    1700. ,
    1701. Fe.extend(KJUR.asn1.DERAbstractStructured, KJUR.asn1.ASN1Object),
    1702. KJUR.asn1.DERBoolean = function() {
    1703. KJUR.asn1.DERBoolean.superclass.constructor.call(this),
    1704. this.hT = "01",
    1705. this.hTLV = "0101ff"
    1706. }
    1707. ,
    1708. Fe.extend(KJUR.asn1.DERBoolean, KJUR.asn1.ASN1Object),
    1709. KJUR.asn1.DERInteger = function(t) {
    1710. KJUR.asn1.DERInteger.superclass.constructor.call(this),
    1711. this.hT = "02",
    1712. this.setByBigInteger = function(t) {
    1713. this.hTLV = null,
    1714. this.isModified = !0,
    1715. this.hV = KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)
    1716. }
    1717. ,
    1718. this.setByInteger = function(t) {
    1719. var i = new e(String(t),10);
    1720. this.setByBigInteger(i)
    1721. }
    1722. ,
    1723. this.setValueHex = function(t) {
    1724. this.hV = t
    1725. }
    1726. ,
    1727. this.getFreshValueHex = function() {
    1728. return this.hV
    1729. }
    1730. ,
    1731. "undefined" != typeof t && ("undefined" != typeof t.bigint ? this.setByBigInteger(t.bigint) : "undefined" != typeof t.int ? this.setByInteger(t.int) : "undefined" != typeof t.hex && this.setValueHex(t.hex))
    1732. }
    1733. ,
    1734. Fe.extend(KJUR.asn1.DERInteger, KJUR.asn1.ASN1Object),
    1735. KJUR.asn1.DERBitString = function(t) {
    1736. KJUR.asn1.DERBitString.superclass.constructor.call(this),
    1737. this.hT = "03",
    1738. this.setHexValueIncludingUnusedBits = function(t) {
    1739. this.hTLV = null,
    1740. this.isModified = !0,
    1741. this.hV = t
    1742. }
    1743. ,
    1744. this.setUnusedBitsAndHexValue = function(t, e) {
    1745. if (0 > t || t > 7)
    1746. throw "unused bits shall be from 0 to 7: u = " + t;
    1747. var i = "0" + t;
    1748. this.hTLV = null,
    1749. this.isModified = !0,
    1750. this.hV = i + e
    1751. }
    1752. ,
    1753. this.setByBinaryString = function(t) {
    1754. t = t.replace(/0+$/, "");
    1755. var e = 8 - t.length % 8;
    1756. 8 == e && (e = 0);
    1757. for (var i = 0; e >= i; i++)
    1758. t += "0";
    1759. for (var s = "", i = 0; i < t.length - 1; i += 8) {
    1760. var n = t.substr(i, 8)
    1761. , r = parseInt(n, 2).toString(16);
    1762. 1 == r.length && (r = "0" + r),
    1763. s += r
    1764. }
    1765. this.hTLV = null,
    1766. this.isModified = !0,
    1767. this.hV = "0" + e + s
    1768. }
    1769. ,
    1770. this.setByBooleanArray = function(t) {
    1771. for (var e = "", i = 0; i < t.length; i++)
    1772. e += 1 == t[i] ? "1" : "0";
    1773. this.setByBinaryString(e)
    1774. }
    1775. ,
    1776. this.newFalseArray = function(t) {
    1777. for (var e = new Array(t), i = 0; t > i; i++)
    1778. e[i] = !1;
    1779. return e
    1780. }
    1781. ,
    1782. this.getFreshValueHex = function() {
    1783. return this.hV
    1784. }
    1785. ,
    1786. "undefined" != typeof t && ("undefined" != typeof t.hex ? this.setHexValueIncludingUnusedBits(t.hex) : "undefined" != typeof t.bin ? this.setByBinaryString(t.bin) : "undefined" != typeof t.array && this.setByBooleanArray(t.array))
    1787. }
    1788. ,
    1789. Fe.extend(KJUR.asn1.DERBitString, KJUR.asn1.ASN1Object),
    1790. KJUR.asn1.DEROctetString = function(t) {
    1791. KJUR.asn1.DEROctetString.superclass.constructor.call(this, t),
    1792. this.hT = "04"
    1793. }
    1794. ,
    1795. Fe.extend(KJUR.asn1.DEROctetString, KJUR.asn1.DERAbstractString),
    1796. KJUR.asn1.DERNull = function() {
    1797. KJUR.asn1.DERNull.superclass.constructor.call(this),
    1798. this.hT = "05",
    1799. this.hTLV = "0500"
    1800. }
    1801. ,
    1802. Fe.extend(KJUR.asn1.DERNull, KJUR.asn1.ASN1Object),
    1803. KJUR.asn1.DERObjectIdentifier = function(t) {
    1804. var i = function(t) {
    1805. var e = t.toString(16);
    1806. return 1 == e.length && (e = "0" + e),
    1807. e
    1808. }
    1809. , s = function(t) {
    1810. var s = ""
    1811. , n = new e(t,10)
    1812. , r = n.toString(2)
    1813. , o = 7 - r.length % 7;
    1814. 7 == o && (o = 0);
    1815. for (var a = "", c = 0; o > c; c++)
    1816. a += "0";
    1817. r = a + r;
    1818. for (var c = 0; c < r.length - 1; c += 7) {
    1819. var l = r.substr(c, 7);
    1820. c != r.length - 7 && (l = "1" + l),
    1821. s += i(parseInt(l, 2))
    1822. }
    1823. return s
    1824. };
    1825. KJUR.asn1.DERObjectIdentifier.superclass.constructor.call(this),
    1826. this.hT = "06",
    1827. this.setValueHex = function(t) {
    1828. this.hTLV = null,
    1829. this.isModified = !0,
    1830. this.s = null,
    1831. this.hV = t
    1832. }
    1833. ,
    1834. this.setValueOidString = function(t) {
    1835. if (!t.match(/^[0-9.]+$/))
    1836. throw "malformed oid string: " + t;
    1837. var e = ""
    1838. , n = t.split(".")
    1839. , r = 40 * parseInt(n[0]) + parseInt(n[1]);
    1840. e += i(r),
    1841. n.splice(0, 2);
    1842. for (var o = 0; o < n.length; o++)
    1843. e += s(n[o]);
    1844. this.hTLV = null,
    1845. this.isModified = !0,
    1846. this.s = null,
    1847. this.hV = e
    1848. }
    1849. ,
    1850. this.setValueName = function(t) {
    1851. if ("undefined" == typeof KJUR.asn1.x509.OID.name2oidList[t])
    1852. throw "DERObjectIdentifier oidName undefined: " + t;
    1853. var e = KJUR.asn1.x509.OID.name2oidList[t];
    1854. this.setValueOidString(e)
    1855. }
    1856. ,
    1857. this.getFreshValueHex = function() {
    1858. return this.hV
    1859. }
    1860. ,
    1861. "undefined" != typeof t && ("undefined" != typeof t.oid ? this.setValueOidString(t.oid) : "undefined" != typeof t.hex ? this.setValueHex(t.hex) : "undefined" != typeof t.name && this.setValueName(t.name))
    1862. }
    1863. ,
    1864. Fe.extend(KJUR.asn1.DERObjectIdentifier, KJUR.asn1.ASN1Object),
    1865. KJUR.asn1.DERUTF8String = function(t) {
    1866. KJUR.asn1.DERUTF8String.superclass.constructor.call(this, t),
    1867. this.hT = "0c"
    1868. }
    1869. ,
    1870. Fe.extend(KJUR.asn1.DERUTF8String, KJUR.asn1.DERAbstractString),
    1871. KJUR.asn1.DERNumericString = function(t) {
    1872. KJUR.asn1.DERNumericString.superclass.constructor.call(this, t),
    1873. this.hT = "12"
    1874. }
    1875. ,
    1876. Fe.extend(KJUR.asn1.DERNumericString, KJUR.asn1.DERAbstractString),
    1877. KJUR.asn1.DERPrintableString = function(t) {
    1878. KJUR.asn1.DERPrintableString.superclass.constructor.call(this, t),
    1879. this.hT = "13"
    1880. }
    1881. ,
    1882. Fe.extend(KJUR.asn1.DERPrintableString, KJUR.asn1.DERAbstractString),
    1883. KJUR.asn1.DERTeletexString = function(t) {
    1884. KJUR.asn1.DERTeletexString.superclass.constructor.call(this, t),
    1885. this.hT = "14"
    1886. }
    1887. ,
    1888. Fe.extend(KJUR.asn1.DERTeletexString, KJUR.asn1.DERAbstractString),
    1889. KJUR.asn1.DERIA5String = function(t) {
    1890. KJUR.asn1.DERIA5String.superclass.constructor.call(this, t),
    1891. this.hT = "16"
    1892. }
    1893. ,
    1894. Fe.extend(KJUR.asn1.DERIA5String, KJUR.asn1.DERAbstractString),
    1895. KJUR.asn1.DERUTCTime = function(t) {
    1896. KJUR.asn1.DERUTCTime.superclass.constructor.call(this, t),
    1897. this.hT = "17",
    1898. this.setByDate = function(t) {
    1899. this.hTLV = null,
    1900. this.isModified = !0,
    1901. this.date = t,
    1902. this.s = this.formatDate(this.date, "utc"),
    1903. this.hV = stohex(this.s)
    1904. }
    1905. ,
    1906. "undefined" != typeof t && ("undefined" != typeof t.str ? this.setString(t.str) : "undefined" != typeof t.hex ? this.setStringHex(t.hex) : "undefined" != typeof t.date && this.setByDate(t.date))
    1907. }
    1908. ,
    1909. Fe.extend(KJUR.asn1.DERUTCTime, KJUR.asn1.DERAbstractTime),
    1910. KJUR.asn1.DERGeneralizedTime = function(t) {
    1911. KJUR.asn1.DERGeneralizedTime.superclass.constructor.call(this, t),
    1912. this.hT = "18",
    1913. this.setByDate = function(t) {
    1914. this.hTLV = null,
    1915. this.isModified = !0,
    1916. this.date = t,
    1917. this.s = this.formatDate(this.date, "gen"),
    1918. this.hV = stohex(this.s)
    1919. }
    1920. ,
    1921. "undefined" != typeof t && ("undefined" != typeof t.str ? this.setString(t.str) : "undefined" != typeof t.hex ? this.setStringHex(t.hex) : "undefined" != typeof t.date && this.setByDate(t.date))
    1922. }
    1923. ,
    1924. Fe.extend(KJUR.asn1.DERGeneralizedTime, KJUR.asn1.DERAbstractTime),
    1925. KJUR.asn1.DERSequence = function(t) {
    1926. KJUR.asn1.DERSequence.superclass.constructor.call(this, t),
    1927. this.hT = "30",
    1928. this.getFreshValueHex = function() {
    1929. for (var t = "", e = 0; e < this.asn1Array.length; e++) {
    1930. var i = this.asn1Array[e];
    1931. t += i.getEncodedHex()
    1932. }
    1933. return this.hV = t,
    1934. this.hV
    1935. }
    1936. }
    1937. ,
    1938. Fe.extend(KJUR.asn1.DERSequence, KJUR.asn1.DERAbstractStructured),
    1939. KJUR.asn1.DERSet = function(t) {
    1940. KJUR.asn1.DERSet.superclass.constructor.call(this, t),
    1941. this.hT = "31",
    1942. this.getFreshValueHex = function() {
    1943. for (var t = new Array, e = 0; e < this.asn1Array.length; e++) {
    1944. var i = this.asn1Array[e];
    1945. t.push(i.getEncodedHex())
    1946. }
    1947. return t.sort(),
    1948. this.hV = t.join(""),
    1949. this.hV
    1950. }
    1951. }
    1952. ,
    1953. Fe.extend(KJUR.asn1.DERSet, KJUR.asn1.DERAbstractStructured),
    1954. KJUR.asn1.DERTaggedObject = function(t) {
    1955. KJUR.asn1.DERTaggedObject.superclass.constructor.call(this),
    1956. this.hT = "a0",
    1957. this.hV = "",
    1958. this.isExplicit = !0,
    1959. this.asn1Object = null,
    1960. this.setASN1Object = function(t, e, i) {
    1961. this.hT = e,
    1962. this.isExplicit = t,
    1963. this.asn1Object = i,
    1964. this.isExplicit ? (this.hV = this.asn1Object.getEncodedHex(),
    1965. this.hTLV = null,
    1966. this.isModified = !0) : (this.hV = null,
    1967. this.hTLV = i.getEncodedHex(),
    1968. this.hTLV = this.hTLV.replace(/^../, e),
    1969. this.isModified = !1)
    1970. }
    1971. ,
    1972. this.getFreshValueHex = function() {
    1973. return this.hV
    1974. }
    1975. ,
    1976. "undefined" != typeof t && ("undefined" != typeof t.tag && (this.hT = t.tag),
    1977. "undefined" != typeof t.explicit && (this.isExplicit = t.explicit),
    1978. "undefined" != typeof t.obj && (this.asn1Object = t.obj,
    1979. this.setASN1Object(this.isExplicit, this.hT, this.asn1Object)))
    1980. }
    1981. ,
    1982. Fe.extend(KJUR.asn1.DERTaggedObject, KJUR.asn1.ASN1Object),
    1983. function(t) {
    1984. "use strict";
    1985. var e, i = {};
    1986. i.decode = function(i) {
    1987. var s;
    1988. if (e === t) {
    1989. var n = "0123456789ABCDEF"
    1990. , r = " \f\n\r  \u2028\u2029";
    1991. for (e = [],
    1992. s = 0; 16 > s; ++s)
    1993. e[n.charAt(s)] = s;
    1994. for (n = n.toLowerCase(),
    1995. s = 10; 16 > s; ++s)
    1996. e[n.charAt(s)] = s;
    1997. for (s = 0; s < r.length; ++s)
    1998. e[r.charAt(s)] = -1
    1999. }
    2000. var o = []
    2001. , a = 0
    2002. , c = 0;
    2003. for (s = 0; s < i.length; ++s) {
    2004. var l = i.charAt(s);
    2005. if ("=" == l)
    2006. break;
    2007. if (l = e[l],
    2008. -1 != l) {
    2009. if (l === t)
    2010. throw "Illegal character at offset " + s;
    2011. a |= l,
    2012. ++c >= 2 ? (o[o.length] = a,
    2013. a = 0,
    2014. c = 0) : a <<= 4
    2015. }
    2016. }
    2017. if (c)
    2018. throw "Hex encoding incomplete: 4 bits missing";
    2019. return o
    2020. }
    2021. ,
    2022. window.Hex = i
    2023. }(),
    2024. function(t) {
    2025. "use strict";
    2026. var e, i = {};
    2027. i.decode = function(i) {
    2028. var s;
    2029. if (e === t) {
    2030. var n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
    2031. , r = "= \f\n\r  \u2028\u2029";
    2032. for (e = [],
    2033. s = 0; 64 > s; ++s)
    2034. e[n.charAt(s)] = s;
    2035. for (s = 0; s < r.length; ++s)
    2036. e[r.charAt(s)] = -1
    2037. }
    2038. var o = []
    2039. , a = 0
    2040. , c = 0;
    2041. for (s = 0; s < i.length; ++s) {
    2042. var l = i.charAt(s);
    2043. if ("=" == l)
    2044. break;
    2045. if (l = e[l],
    2046. -1 != l) {
    2047. if (l === t)
    2048. throw "Illegal character at offset " + s;
    2049. a |= l,
    2050. ++c >= 4 ? (o[o.length] = a >> 16,
    2051. o[o.length] = a >> 8 & 255,
    2052. o[o.length] = 255 & a,
    2053. a = 0,
    2054. c = 0) : a <<= 6
    2055. }
    2056. }
    2057. switch (c) {
    2058. case 1:
    2059. throw "Base64 encoding incomplete: at least 2 bits missing";
    2060. case 2:
    2061. o[o.length] = a >> 10;
    2062. break;
    2063. case 3:
    2064. o[o.length] = a >> 16,
    2065. o[o.length] = a >> 8 & 255
    2066. }
    2067. return o
    2068. }
    2069. ,
    2070. i.re = /-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,
    2071. i.unarmor = function(t) {
    2072. var e = i.re.exec(t);
    2073. if (e)
    2074. if (e[1])
    2075. t = e[1];
    2076. else {
    2077. if (!e[2])
    2078. throw "RegExp out of sync";
    2079. t = e[2]
    2080. }
    2081. return i.decode(t)
    2082. }
    2083. ,
    2084. window.Base64 = i
    2085. }(),
    2086. function(t) {
    2087. "use strict";
    2088. function e(t, i) {
    2089. t instanceof e ? (this.enc = t.enc,
    2090. this.pos = t.pos) : (this.enc = t,
    2091. this.pos = i)
    2092. }
    2093. function i(t, e, i, s, n) {
    2094. this.stream = t,
    2095. this.header = e,
    2096. this.length = i,
    2097. this.tag = s,
    2098. this.sub = n
    2099. }
    2100. var s = 100
    2101. , n = "…"
    2102. , r = {
    2103. tag: function(t, e) {
    2104. var i = document.createElement(t);
    2105. return i.className = e,
    2106. i
    2107. },
    2108. text: function(t) {
    2109. return document.createTextNode(t)
    2110. }
    2111. };
    2112. e.prototype.get = function(e) {
    2113. if (e === t && (e = this.pos++),
    2114. e >= this.enc.length)
    2115. throw "Requesting byte offset " + e + " on a stream of length " + this.enc.length;
    2116. return this.enc[e]
    2117. }
    2118. ,
    2119. e.prototype.hexDigits = "0123456789ABCDEF",
    2120. e.prototype.hexByte = function(t) {
    2121. return this.hexDigits.charAt(t >> 4 & 15) + this.hexDigits.charAt(15 & t)
    2122. }
    2123. ,
    2124. e.prototype.hexDump = function(t, e, i) {
    2125. for (var s = "", n = t; e > n; ++n)
    2126. if (s += this.hexByte(this.get(n)),
    2127. i !== !0)
    2128. switch (15 & n) {
    2129. case 7:
    2130. s += " ";
    2131. break;
    2132. case 15:
    2133. s += "\n";
    2134. break;
    2135. default:
    2136. s += " "
    2137. }
    2138. return s
    2139. }
    2140. ,
    2141. e.prototype.parseStringISO = function(t, e) {
    2142. for (var i = "", s = t; e > s; ++s)
    2143. i += String.fromCharCode(this.get(s));
    2144. return i
    2145. }
    2146. ,
    2147. e.prototype.parseStringUTF = function(t, e) {
    2148. for (var i = "", s = t; e > s; ) {
    2149. var n = this.get(s++);
    2150. i += 128 > n ? String.fromCharCode(n) : n > 191 && 224 > n ? String.fromCharCode((31 & n) << 6 | 63 & this.get(s++)) : String.fromCharCode((15 & n) << 12 | (63 & this.get(s++)) << 6 | 63 & this.get(s++))
    2151. }
    2152. return i
    2153. }
    2154. ,
    2155. e.prototype.parseStringBMP = function(t, e) {
    2156. for (var i = "", s = t; e > s; s += 2) {
    2157. var n = this.get(s)
    2158. , r = this.get(s + 1);
    2159. i += String.fromCharCode((n << 8) + r)
    2160. }
    2161. return i
    2162. }
    2163. ,
    2164. 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)?)?$/,
    2165. e.prototype.parseTime = function(t, e) {
    2166. var i = this.parseStringISO(t, e)
    2167. , s = this.reTime.exec(i);
    2168. return s ? (i = s[1] + "-" + s[2] + "-" + s[3] + " " + s[4],
    2169. s[5] && (i += ":" + s[5],
    2170. s[6] && (i += ":" + s[6],
    2171. s[7] && (i += "." + s[7]))),
    2172. s[8] && (i += " UTC",
    2173. "Z" != s[8] && (i += s[8],
    2174. s[9] && (i += ":" + s[9]))),
    2175. i) : "Unrecognized time: " + i
    2176. }
    2177. ,
    2178. e.prototype.parseInteger = function(t, e) {
    2179. var i = e - t;
    2180. if (i > 4) {
    2181. i <<= 3;
    2182. var s = this.get(t);
    2183. if (0 === s)
    2184. i -= 8;
    2185. else
    2186. for (; 128 > s; )
    2187. s <<= 1,
    2188. --i;
    2189. return "(" + i + " bit)"
    2190. }
    2191. for (var n = 0, r = t; e > r; ++r)
    2192. n = n << 8 | this.get(r);
    2193. return n
    2194. }
    2195. ,
    2196. e.prototype.parseBitString = function(t, e) {
    2197. var i = this.get(t)
    2198. , s = (e - t - 1 << 3) - i
    2199. , n = "(" + s + " bit)";
    2200. if (20 >= s) {
    2201. var r = i;
    2202. n += " ";
    2203. for (var o = e - 1; o > t; --o) {
    2204. for (var a = this.get(o), c = r; 8 > c; ++c)
    2205. n += a >> c & 1 ? "1" : "0";
    2206. r = 0
    2207. }
    2208. }
    2209. return n
    2210. }
    2211. ,
    2212. e.prototype.parseOctetString = function(t, e) {
    2213. var i = e - t
    2214. , r = "(" + i + " byte) ";
    2215. i > s && (e = t + s);
    2216. for (var o = t; e > o; ++o)
    2217. r += this.hexByte(this.get(o));
    2218. return i > s && (r += n),
    2219. r
    2220. }
    2221. ,
    2222. e.prototype.parseOID = function(t, e) {
    2223. for (var i = "", s = 0, n = 0, r = t; e > r; ++r) {
    2224. var o = this.get(r);
    2225. if (s = s << 7 | 127 & o,
    2226. n += 7,
    2227. !(128 & o)) {
    2228. if ("" === i) {
    2229. var a = 80 > s ? 40 > s ? 0 : 1 : 2;
    2230. i = a + "." + (s - 40 * a)
    2231. } else
    2232. i += "." + (n >= 31 ? "bigint" : s);
    2233. s = n = 0
    2234. }
    2235. }
    2236. return i
    2237. }
    2238. ,
    2239. i.prototype.typeName = function() {
    2240. if (this.tag === t)
    2241. return "unknown";
    2242. var e = this.tag >> 6
    2243. , i = (this.tag >> 5 & 1,
    2244. 31 & this.tag);
    2245. switch (e) {
    2246. case 0:
    2247. switch (i) {
    2248. case 0:
    2249. return "EOC";
    2250. case 1:
    2251. return "BOOLEAN";
    2252. case 2:
    2253. return "INTEGER";
    2254. case 3:
    2255. return "BIT_STRING";
    2256. case 4:
    2257. return "OCTET_STRING";
    2258. case 5:
    2259. return "NULL";
    2260. case 6:
    2261. return "OBJECT_IDENTIFIER";
    2262. case 7:
    2263. return "ObjectDescriptor";
    2264. case 8:
    2265. return "EXTERNAL";
    2266. case 9:
    2267. return "REAL";
    2268. case 10:
    2269. return "ENUMERATED";
    2270. case 11:
    2271. return "EMBEDDED_PDV";
    2272. case 12:
    2273. return "UTF8String";
    2274. case 16:
    2275. return "SEQUENCE";
    2276. case 17:
    2277. return "SET";
    2278. case 18:
    2279. return "NumericString";
    2280. case 19:
    2281. return "PrintableString";
    2282. case 20:
    2283. return "TeletexString";
    2284. case 21:
    2285. return "VideotexString";
    2286. case 22:
    2287. return "IA5String";
    2288. case 23:
    2289. return "UTCTime";
    2290. case 24:
    2291. return "GeneralizedTime";
    2292. case 25:
    2293. return "GraphicString";
    2294. case 26:
    2295. return "VisibleString";
    2296. case 27:
    2297. return "GeneralString";
    2298. case 28:
    2299. return "UniversalString";
    2300. case 30:
    2301. return "BMPString";
    2302. default:
    2303. return "Universal_" + i.toString(16)
    2304. }
    2305. case 1:
    2306. return "Application_" + i.toString(16);
    2307. case 2:
    2308. return "[" + i + "]";
    2309. case 3:
    2310. return "Private_" + i.toString(16)
    2311. }
    2312. }
    2313. ,
    2314. i.prototype.reSeemsASCII = /^[ -~]+$/,
    2315. i.prototype.content = function() {
    2316. if (this.tag === t)
    2317. return null;
    2318. var e = this.tag >> 6
    2319. , i = 31 & this.tag
    2320. , r = this.posContent()
    2321. , o = Math.abs(this.length);
    2322. if (0 !== e) {
    2323. if (null !== this.sub)
    2324. return "(" + this.sub.length + " elem)";
    2325. var a = this.stream.parseStringISO(r, r + Math.min(o, s));
    2326. return this.reSeemsASCII.test(a) ? a.substring(0, 2 * s) + (a.length > 2 * s ? n : "") : this.stream.parseOctetString(r, r + o)
    2327. }
    2328. switch (i) {
    2329. case 1:
    2330. return 0 === this.stream.get(r) ? "false" : "true";
    2331. case 2:
    2332. return this.stream.parseInteger(r, r + o);
    2333. case 3:
    2334. return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseBitString(r, r + o);
    2335. case 4:
    2336. return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(r, r + o);
    2337. case 6:
    2338. return this.stream.parseOID(r, r + o);
    2339. case 16:
    2340. case 17:
    2341. return "(" + this.sub.length + " elem)";
    2342. case 12:
    2343. return this.stream.parseStringUTF(r, r + o);
    2344. case 18:
    2345. case 19:
    2346. case 20:
    2347. case 21:
    2348. case 22:
    2349. case 26:
    2350. return this.stream.parseStringISO(r, r + o);
    2351. case 30:
    2352. return this.stream.parseStringBMP(r, r + o);
    2353. case 23:
    2354. case 24:
    2355. return this.stream.parseTime(r, r + o)
    2356. }
    2357. return null
    2358. }
    2359. ,
    2360. i.prototype.toString = function() {
    2361. return this.typeName() + "@" + this.stream.pos + "[header:" + this.header + ",length:" + this.length + ",sub:" + (null === this.sub ? "null" : this.sub.length) + "]"
    2362. }
    2363. ,
    2364. i.prototype.print = function(e) {
    2365. if (e === t && (e = ""),
    2366. document.writeln(e + this),
    2367. null !== this.sub) {
    2368. e += " ";
    2369. for (var i = 0, s = this.sub.length; s > i; ++i)
    2370. this.sub[i].print(e)
    2371. }
    2372. }
    2373. ,
    2374. i.prototype.toPrettyString = function(e) {
    2375. e === t && (e = "");
    2376. var i = e + this.typeName() + " @" + this.stream.pos;
    2377. if (this.length >= 0 && (i += "+"),
    2378. i += this.length,
    2379. 32 & this.tag ? i += " (constructed)" : 3 != this.tag && 4 != this.tag || null === this.sub || (i += " (encapsulates)"),
    2380. i += "\n",
    2381. null !== this.sub) {
    2382. e += " ";
    2383. for (var s = 0, n = this.sub.length; n > s; ++s)
    2384. i += this.sub[s].toPrettyString(e)
    2385. }
    2386. return i
    2387. }
    2388. ,
    2389. i.prototype.toDOM = function() {
    2390. var t = r.tag("div", "node");
    2391. t.asn1 = this;
    2392. var e = r.tag("div", "head")
    2393. , i = this.typeName().replace(/_/g, " ");
    2394. e.innerHTML = i;
    2395. var s = this.content();
    2396. if (null !== s) {
    2397. s = String(s).replace(/, "<");
    2398. var n = r.tag("span", "preview");
    2399. n.appendChild(r.text(s)),
    2400. e.appendChild(n)
    2401. }
    2402. t.appendChild(e),
    2403. this.node = t,
    2404. this.head = e;
    2405. var o = r.tag("div", "value");
    2406. if (i = "Offset: " + this.stream.pos + "
      "
      ,
    2407. i += "Length: " + this.header + "+",
    2408. i += this.length >= 0 ? this.length : -this.length + " (undefined)",
    2409. 32 & this.tag ? i += "
      (constructed)"
      : 3 != this.tag && 4 != this.tag || null === this.sub || (i += "
      (encapsulates)"
      ),
    2410. null !== s && (i += "
      Value:
      "
      + s + "",
    2411. "object" == typeof oids && 6 == this.tag)) {
    2412. var a = oids[s];
    2413. a && (a.d && (i += "
      "
      + a.d),
    2414. a.c && (i += "
      "
      + a.c),
    2415. a.w && (i += "
      (warning!)"
      ))
    2416. }
    2417. o.innerHTML = i,
    2418. t.appendChild(o);
    2419. var c = r.tag("div", "sub");
    2420. if (null !== this.sub)
    2421. for (var l = 0, u = this.sub.length; u > l; ++l)
    2422. c.appendChild(this.sub[l].toDOM());
    2423. return t.appendChild(c),
    2424. e.onclick = function() {
    2425. t.className = "node collapsed" == t.className ? "node" : "node collapsed"
    2426. }
    2427. ,
    2428. t
    2429. }
    2430. ,
    2431. i.prototype.posStart = function() {
    2432. return this.stream.pos
    2433. }
    2434. ,
    2435. i.prototype.posContent = function() {
    2436. return this.stream.pos + this.header
    2437. }
    2438. ,
    2439. i.prototype.posEnd = function() {
    2440. return this.stream.pos + this.header + Math.abs(this.length)
    2441. }
    2442. ,
    2443. i.prototype.fakeHover = function(t) {
    2444. this.node.className += " hover",
    2445. t && (this.head.className += " hover")
    2446. }
    2447. ,
    2448. i.prototype.fakeOut = function(t) {
    2449. var e = / ?hover/;
    2450. this.node.className = this.node.className.replace(e, ""),
    2451. t && (this.head.className = this.head.className.replace(e, ""))
    2452. }
    2453. ,
    2454. i.prototype.toHexDOM_sub = function(t, e, i, s, n) {
    2455. if (!(s >= n)) {
    2456. var o = r.tag("span", e);
    2457. o.appendChild(r.text(i.hexDump(s, n))),
    2458. t.appendChild(o)
    2459. }
    2460. }
    2461. ,
    2462. i.prototype.toHexDOM = function(e) {
    2463. var i = r.tag("span", "hex");
    2464. if (e === t && (e = i),
    2465. this.head.hexNode = i,
    2466. this.head.onmouseover = function() {
    2467. this.hexNode.className = "hexCurrent"
    2468. }
    2469. ,
    2470. this.head.onmouseout = function() {
    2471. this.hexNode.className = "hex"
    2472. }
    2473. ,
    2474. i.asn1 = this,
    2475. i.onmouseover = function() {
    2476. var t = !e.selected;
    2477. t && (e.selected = this.asn1,
    2478. this.className = "hexCurrent"),
    2479. this.asn1.fakeHover(t)
    2480. }
    2481. ,
    2482. i.onmouseout = function() {
    2483. var t = e.selected == this.asn1;
    2484. this.asn1.fakeOut(t),
    2485. t && (e.selected = null,
    2486. this.className = "hex")
    2487. }
    2488. ,
    2489. this.toHexDOM_sub(i, "tag", this.stream, this.posStart(), this.posStart() + 1),
    2490. this.toHexDOM_sub(i, this.length >= 0 ? "dlen" : "ulen", this.stream, this.posStart() + 1, this.posContent()),
    2491. null === this.sub)
    2492. i.appendChild(r.text(this.stream.hexDump(this.posContent(), this.posEnd())));
    2493. else if (this.sub.length > 0) {
    2494. var s = this.sub[0]
    2495. , n = this.sub[this.sub.length - 1];
    2496. this.toHexDOM_sub(i, "intro", this.stream, this.posContent(), s.posStart());
    2497. for (var o = 0, a = this.sub.length; a > o; ++o)
    2498. i.appendChild(this.sub[o].toHexDOM(e));
    2499. this.toHexDOM_sub(i, "outro", this.stream, n.posEnd(), this.posEnd())
    2500. }
    2501. return i
    2502. }
    2503. ,
    2504. i.prototype.toHexString = function(t) {
    2505. return this.stream.hexDump(this.posStart(), this.posEnd(), !0)
    2506. }
    2507. ,
    2508. i.decodeLength = function(t) {
    2509. var e = t.get()
    2510. , i = 127 & e;
    2511. if (i == e)
    2512. return i;
    2513. if (i > 3)
    2514. throw "Length over 24 bits not supported at position " + (t.pos - 1);
    2515. if (0 === i)
    2516. return -1;
    2517. e = 0;
    2518. for (var s = 0; i > s; ++s)
    2519. e = e << 8 | t.get();
    2520. return e
    2521. }
    2522. ,
    2523. i.hasContent = function(t, s, n) {
    2524. if (32 & t)
    2525. return !0;
    2526. if (3 > t || t > 4)
    2527. return !1;
    2528. var r = new e(n);
    2529. 3 == t && r.get();
    2530. var o = r.get();
    2531. if (o >> 6 & 1)
    2532. return !1;
    2533. try {
    2534. var a = i.decodeLength(r);
    2535. return r.pos - n.pos + a == s
    2536. } catch (t) {
    2537. return !1
    2538. }
    2539. }
    2540. ,
    2541. i.decode = function(t) {
    2542. t instanceof e || (t = new e(t,0));
    2543. var s = new e(t)
    2544. , n = t.get()
    2545. , r = i.decodeLength(t)
    2546. , o = t.pos - s.pos
    2547. , a = null;
    2548. if (i.hasContent(n, r, t)) {
    2549. var c = t.pos;
    2550. if (3 == n && t.get(),
    2551. a = [],
    2552. r >= 0) {
    2553. for (var l = c + r; t.pos < l; )
    2554. a[a.length] = i.decode(t);
    2555. if (t.pos != l)
    2556. throw "Content size is not correct for container starting at offset " + c
    2557. } else
    2558. try {
    2559. for (; ; ) {
    2560. var u = i.decode(t);
    2561. if (0 === u.tag)
    2562. break;
    2563. a[a.length] = u
    2564. }
    2565. r = c - t.pos
    2566. } catch (t) {
    2567. throw "Exception while decoding undefined length content: " + t
    2568. }
    2569. } else
    2570. t.pos += r;
    2571. return new i(s,o,r,n,a)
    2572. }
    2573. ,
    2574. i.test = function() {
    2575. for (var t = [{
    2576. value: [39],
    2577. expected: 39
    2578. }, {
    2579. value: [129, 201],
    2580. expected: 201
    2581. }, {
    2582. value: [131, 254, 220, 186],
    2583. expected: 16702650
    2584. }], s = 0, n = t.length; n > s; ++s) {
    2585. var r = new e(t[s].value,0)
    2586. , o = i.decodeLength(r);
    2587. o != t[s].expected && document.write("In test[" + s + "] expected " + t[s].expected + " got " + o + "\n")
    2588. }
    2589. }
    2590. ,
    2591. window.ASN1 = i
    2592. }(),
    2593. ASN1.prototype.getHexStringValue = function() {
    2594. var t = this.toHexString()
    2595. , e = 2 * this.header
    2596. , i = 2 * this.length;
    2597. return t.substr(e, i)
    2598. }
    2599. ,
    2600. le.prototype.parseKey = function(t) {
    2601. try {
    2602. var e = 0
    2603. , i = 0
    2604. , s = /^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/
    2605. , n = s.test(t) ? Hex.decode(t) : Base64.unarmor(t)
    2606. , r = ASN1.decode(n);
    2607. if (3 === r.sub.length && (r = r.sub[2].sub[0]),
    2608. 9 === r.sub.length) {
    2609. e = r.sub[1].getHexStringValue(),
    2610. this.n = ae(e, 16),
    2611. i = r.sub[2].getHexStringValue(),
    2612. this.e = parseInt(i, 16);
    2613. var o = r.sub[3].getHexStringValue();
    2614. this.d = ae(o, 16);
    2615. var a = r.sub[4].getHexStringValue();
    2616. this.p = ae(a, 16);
    2617. var c = r.sub[5].getHexStringValue();
    2618. this.q = ae(c, 16);
    2619. var l = r.sub[6].getHexStringValue();
    2620. this.dmp1 = ae(l, 16);
    2621. var u = r.sub[7].getHexStringValue();
    2622. this.dmq1 = ae(u, 16);
    2623. var p = r.sub[8].getHexStringValue();
    2624. this.coeff = ae(p, 16)
    2625. } else {
    2626. if (2 !== r.sub.length)
    2627. return !1;
    2628. var d = r.sub[1]
    2629. , h = d.sub[0];
    2630. e = h.sub[0].getHexStringValue(),
    2631. this.n = ae(e, 16),
    2632. i = h.sub[1].getHexStringValue(),
    2633. this.e = parseInt(i, 16)
    2634. }
    2635. return !0
    2636. } catch (t) {
    2637. return !1
    2638. }
    2639. }
    2640. ,
    2641. le.prototype.getPrivateBaseKey = function() {
    2642. var t = {
    2643. array: [new KJUR.asn1.DERInteger({
    2644. int: 0
    2645. }), new KJUR.asn1.DERInteger({
    2646. bigint: this.n
    2647. }), new KJUR.asn1.DERInteger({
    2648. int: this.e
    2649. }), new KJUR.asn1.DERInteger({
    2650. bigint: this.d
    2651. }), new KJUR.asn1.DERInteger({
    2652. bigint: this.p
    2653. }), new KJUR.asn1.DERInteger({
    2654. bigint: this.q
    2655. }), new KJUR.asn1.DERInteger({
    2656. bigint: this.dmp1
    2657. }), new KJUR.asn1.DERInteger({
    2658. bigint: this.dmq1
    2659. }), new KJUR.asn1.DERInteger({
    2660. bigint: this.coeff
    2661. })]
    2662. }
    2663. , e = new KJUR.asn1.DERSequence(t);
    2664. return e.getEncodedHex()
    2665. }
    2666. ,
    2667. le.prototype.getPrivateBaseKeyB64 = function() {
    2668. return be(this.getPrivateBaseKey())
    2669. }
    2670. ,
    2671. le.prototype.getPublicBaseKey = function() {
    2672. var t = {
    2673. array: [new KJUR.asn1.DERObjectIdentifier({
    2674. oid: "1.2.840.113549.1.1.1"
    2675. }), new KJUR.asn1.DERNull]
    2676. }
    2677. , e = new KJUR.asn1.DERSequence(t);
    2678. t = {
    2679. array: [new KJUR.asn1.DERInteger({
    2680. bigint: this.n
    2681. }), new KJUR.asn1.DERInteger({
    2682. int: this.e
    2683. })]
    2684. };
    2685. var i = new KJUR.asn1.DERSequence(t);
    2686. t = {
    2687. hex: "00" + i.getEncodedHex()
    2688. };
    2689. var s = new KJUR.asn1.DERBitString(t);
    2690. t = {
    2691. array: [e, s]
    2692. };
    2693. var n = new KJUR.asn1.DERSequence(t);
    2694. return n.getEncodedHex()
    2695. }
    2696. ,
    2697. le.prototype.getPublicBaseKeyB64 = function() {
    2698. return be(this.getPublicBaseKey())
    2699. }
    2700. ,
    2701. le.prototype.wordwrap = function(t, e) {
    2702. if (e = e || 64,
    2703. !t)
    2704. return t;
    2705. var i = "(.{1," + e + "})( +|$\n?)|(.{1," + e + "})";
    2706. return t.match(RegExp(i, "g")).join("\n")
    2707. }
    2708. ,
    2709. le.prototype.getPrivateKey = function() {
    2710. var t = "-----BEGIN RSA PRIVATE KEY-----\n";
    2711. return t += this.wordwrap(this.getPrivateBaseKeyB64()) + "\n",
    2712. t += "-----END RSA PRIVATE KEY-----"
    2713. }
    2714. ,
    2715. le.prototype.getPublicKey = function() {
    2716. var t = "-----BEGIN PUBLIC KEY-----\n";
    2717. return t += this.wordwrap(this.getPublicBaseKeyB64()) + "\n",
    2718. t += "-----END PUBLIC KEY-----"
    2719. }
    2720. ,
    2721. le.prototype.hasPublicKeyProperty = function(t) {
    2722. return t = t || {},
    2723. t.hasOwnProperty("n") && t.hasOwnProperty("e")
    2724. }
    2725. ,
    2726. le.prototype.hasPrivateKeyProperty = function(t) {
    2727. return t = t || {},
    2728. t.hasOwnProperty("n") && t.hasOwnProperty("e") && t.hasOwnProperty("d") && t.hasOwnProperty("p") && t.hasOwnProperty("q") && t.hasOwnProperty("dmp1") && t.hasOwnProperty("dmq1") && t.hasOwnProperty("coeff")
    2729. }
    2730. ,
    2731. le.prototype.parsePropertiesFrom = function(t) {
    2732. this.n = t.n,
    2733. this.e = t.e,
    2734. t.hasOwnProperty("d") && (this.d = t.d,
    2735. this.p = t.p,
    2736. this.q = t.q,
    2737. this.dmp1 = t.dmp1,
    2738. this.dmq1 = t.dmq1,
    2739. this.coeff = t.coeff)
    2740. }
    2741. ;
    2742. var He = function(t) {
    2743. le.call(this),
    2744. t && ("string" == typeof t ? this.parseKey(t) : (this.hasPrivateKeyProperty(t) || this.hasPublicKeyProperty(t)) && this.parsePropertiesFrom(t))
    2745. };
    2746. He.prototype = new le,
    2747. He.prototype.constructor = He;
    2748. var qe = function(t) {
    2749. t = t || {},
    2750. this.default_key_size = parseInt(t.default_key_size) || 1024,
    2751. this.default_public_exponent = t.default_public_exponent || "010001",
    2752. this.log = t.log || !1,
    2753. this.key = null
    2754. };
    2755. qe.prototype.setKey = function(t) {
    2756. this.log && this.key && console.warn("A key was already set, overriding existing."),
    2757. this.key = new He(t)
    2758. }
    2759. ,
    2760. qe.prototype.setPrivateKey = function(t) {
    2761. this.setKey(t)
    2762. }
    2763. ,
    2764. qe.prototype.setPublicKey = function(t) {
    2765. this.setKey(t)
    2766. }
    2767. ,
    2768. qe.prototype.decrypt = function(t) {
    2769. try {
    2770. return this.getKey().decrypt(ye(t))
    2771. } catch (t) {
    2772. return !1
    2773. }
    2774. }
    2775. ,
    2776. qe.prototype.encrypt = function(t) {
    2777. try {
    2778. return be(this.getKey().encrypt(t))
    2779. } catch (t) {
    2780. return !1
    2781. }
    2782. }
    2783. ,
    2784. qe.prototype.getKey = function(t) {
    2785. if (!this.key) {
    2786. if (this.key = new He,
    2787. t && "[object Function]" === {}.toString.call(t))
    2788. return void this.key.generateAsync(this.default_key_size, this.default_public_exponent, t);
    2789. this.key.generate(this.default_key_size, this.default_public_exponent)
    2790. }
    2791. return this.key
    2792. }
    2793. ,
    2794. qe.prototype.getPrivateKey = function() {
    2795. return this.getKey().getPrivateKey()
    2796. }
    2797. ,
    2798. qe.prototype.getPrivateKeyB64 = function() {
    2799. return this.getKey().getPrivateBaseKeyB64()
    2800. }
    2801. ,
    2802. qe.prototype.getPublicKey = function() {
    2803. return this.getKey().getPublicKey()
    2804. }
    2805. ,
    2806. qe.prototype.getPublicKeyB64 = function() {
    2807. return this.getKey().getPublicBaseKeyB64()
    2808. }
    2809. ,
    2810. qe.version = "2.3.1",
    2811. t.JSEncrypt = qe
    2812. })
    2813. }
    2814. .call(e, i, e, t),
    2815. !(void 0 !== s && (t.exports = s))
    2816. },
    2817. });
    2818. // 测试样例
    2819. function getPwd(){
    2820. var pwd = '123456',
    2821. s = (new Date).getTime(),
    2822. code_func_3 = code('3');
    2823. encrypt = new code_func_3
    2824. return encrypt.encode(pwd, s)
    2825. }
    2826. console.log(getPwd())
    2827. // python 调用
    2828. // function getPwd(password){
    2829. // var pwd = password,
    2830. // s = (new Date).getTime(),
    2831. // code_func_3 = code('3');
    2832. // encrypt = new code_func_3
    2833. // return encrypt.encode(pwd, s)
    2834. // }
    2835. //console.log(getPwd())

    password 参数的逆向分析到此为止,python 模拟登录部分代码在此就不予提供了,关于该网站登录中验证码的处理提供三种方式:

    • 该网站验证码混淆不严重可以直接通过 OpenCV 库进行识别
    • 通过验证码图片的接口 verify_image 将验证码保存到本地,然后通过 Image 库打开本地图片并通过 show() 方法展示出来,最后 input 手动输入即可
    • 打码平台

    总结

            以上是对某妹游戏网登录的逆向分析,以及对 webpack 的改写调用,如有任何见解欢迎评论区或私信指正交流~   

  • 相关阅读:
    【Linux kernel基础】arch_initcall到底是怎么是一回事
    作为前端你还不懂MutationObserver?那Out了
    软件开发项目 质量管理的6大关键事项
    基于springboot的社区团购系统设计与实现
    SpringBoot 27 Dubbo-admin、Zookeeper 安装
    NLP的数据增强技术总结
    李峋同款爱心代码【有声版】
    Linux开发讲课18--- “>file 2>&1“ 和 “2>&1 >file“ 的区别
    【2023云栖】黄博远:阿里云人工智能平台PAI年度发布
    LeetCode - 112. 路径总和;113. 路径总和 II【进阶】
  • 原文地址:https://blog.csdn.net/Yy_Rose/article/details/126282073