├── README.md
├── 12入门级js加密.py
├── 13入门cookie加密.py
├── 3访问逻辑 推心置腹.py
├── 2动态cookie.py
├── 1JS混淆.py
├── 6JS混淆 回溯.py
├── 7动态字体 随风漂移.py
├── 8code.py
├── JS
├── jsConfuse.js
├── jsCookie.js
└── js6.js
└── 4雪碧图 CSS加密.py
/README.md:
--------------------------------------------------------------------------------
1 | # yuanrenxue_python_spider
2 | 猿人学爬虫攻防练习,解题代码
3 | <<<<<<< Updated upstream
4 | 教程网址:https://syjun.vip
5 |
6 | =======
7 | 教程网址:https:syjun.vip
8 |
9 | # Python反反爬系列
10 |
11 | 1. [JS混淆---源码乱码][1]
12 | 2. [JS混淆---动态Cookie][2]
13 | 3. [访问逻辑---推心置腹][3]
14 | 4. [CSS加密---样式干扰][4]
15 | 5. [JS混淆---回溯][5]
16 | 6. [动态字体---随风漂移][6]
17 | 7. [验证码---图文点击][7]
18 |
19 | [1]: https://syjun.vip/archives/278.html
20 | [2]: https://syjun.vip/archives/279.html
21 | [3]: https://syjun.vip/archives/280.html
22 | [4]: https://syjun.vip/archives/281.html
23 | [5]: https://syjun.vip/archives/282.html
24 | [6]: https://syjun.vip/archives/283.html
25 | [7]: https://syjun.vip/archives/284.html
26 |
--------------------------------------------------------------------------------
/12入门级js加密.py:
--------------------------------------------------------------------------------
1 | # @BY :Java_S
2 | # @Time :2021/1/3 17:23
3 | # @Slogan :够坚定够努力大门自然会有人敲,别怕没人赏识就像三十岁的梵高
4 |
5 | import base64
6 | import requests
7 |
8 | def get_base64(page):
9 | base_str = 'yuanrenxue'+f'{page}'
10 | base_str = base_str.encode('ascii')
11 | base = base64.b64encode(base_str).decode('utf-8')
12 | return base
13 |
14 | def get_data(page,m):
15 | url = f'http://match.yuanrenxue.com/api/match/12?page={page}&m={m}'
16 | headers = {'User-Agent': 'yuanrenxue.project'}
17 | response = requests.get(url, headers=headers)
18 | data = response.json()['data']
19 | return data
20 |
21 | if __name__ == '__main__':
22 | nums_sum = []
23 | for i in range(1,6):
24 | m = get_base64(i)
25 | data = [i['value'] for i in get_data(i,m)]
26 | nums_sum.extend(data)
27 | print(f'五页数字总和:{sum(nums_sum)}')
--------------------------------------------------------------------------------
/13入门cookie加密.py:
--------------------------------------------------------------------------------
1 | # @BY :Java_S
2 | # @Time :2021/1/3 18:30
3 | # @Slogan :够坚定够努力大门自然会有人敲,别怕没人赏识就像三十岁的梵高
4 |
5 | import re
6 | import requests
7 |
8 | def get_data(page):
9 | url = 'http://match.yuanrenxue.com/match/13'
10 | response = requests.get(url)
11 | cookie = ''.join(re.findall(r"'(.*?)'", response.text))[:-7]
12 | sessionid = response.headers['Set-Cookie'].split(';')[0]
13 |
14 | url_api = f'http://match.yuanrenxue.com/api/match/13?page={page}'
15 | headers = {
16 | 'User-Agent': 'yuanrenxue.project',
17 | 'Cookie': sessionid+';'+cookie
18 | }
19 | res = requests.get(url=url_api,headers=headers)
20 | return res.json()['data']
21 |
22 | if __name__ == '__main__':
23 | nums_sum = []
24 | for i in range(1, 6):
25 | data = [i['value'] for i in get_data(i)]
26 | nums_sum.extend(data)
27 | print(f'五页数字总和:{sum(nums_sum)}')
28 |
--------------------------------------------------------------------------------
/3访问逻辑 推心置腹.py:
--------------------------------------------------------------------------------
1 | # @BY :Java_S
2 | # @Time :2020/12/31 15:45
3 | # @Slogan :够坚定够努力大门自然会有人敲,别怕没人赏识就像三十岁的梵高
4 |
5 | import requests
6 | import pandas as pd
7 |
8 |
9 | def get_data(page_num):
10 | session = requests.session()
11 |
12 | headers = {'Connection': 'keep-alive',
13 | 'User-Agent': 'yuanrenxue.project',
14 | 'Accept': '*/*',
15 | 'Origin': 'http://match.yuanrenxue.com',
16 | 'Referer': 'http://match.yuanrenxue.com/match/3',
17 | 'Accept-Encoding': 'gzip, deflate',
18 | 'Accept-Language': 'zh-CN,zh;q=0.9,en-GB;q=0.8,en;q=0.7',
19 | }
20 |
21 | url = 'http://match.yuanrenxue.com/logo'
22 | session.headers = headers
23 | response = session.post(url=url)
24 |
25 | url_api = f'http://match.yuanrenxue.com/api/match/3?page={page_num}'
26 | res = session.get(url=url_api).json()
27 | data = [i['value'] for i in res['data']]
28 | return data
29 |
30 |
31 | if __name__ == '__main__':
32 | data = []
33 | for i in range(1, 6):
34 | data_list = get_data(i)
35 | data.extend(data_list)
36 | count = pd.value_counts(data)
37 | print(count)
38 |
--------------------------------------------------------------------------------
/2动态cookie.py:
--------------------------------------------------------------------------------
1 | # @BY :Java_S
2 | # @Time :2020/12/26 12:14
3 | # @Slogan :够坚定够努力大门自然会有人敲,别怕没人赏识就像三十岁的梵高
4 |
5 | import requests
6 | import execjs
7 | import time
8 |
9 | def get_cipher_value():
10 | # 导入JS,读取需要的js文件
11 | with open(r'JS/jsCookie.js',encoding='utf-8',mode='r') as f:
12 | JsData = f.read()
13 | # 加载js文件,使用call()函数执行,传入需要执行函数即可获取返回值
14 | psd = execjs.compile(JsData).call('get_cipher')
15 | return psd
16 |
17 | def get_data(page_num,cipher):
18 | url = f'http://match.yuanrenxue.com/api/match/2?page={page_num}'
19 | headers = {
20 | 'Host': 'match.yuanrenxue.com',
21 | 'User-Agent':'yuanrenxue.project',
22 | 'Cookie':cipher
23 | }
24 | print(f'加密密文--->{cipher}')
25 | response = requests.get(url,headers = headers)
26 | return response.json()
27 |
28 |
29 | if __name__ == '__main__':
30 |
31 | sum_num = 0
32 |
33 | for page_num in range(1, 6):
34 | info = get_data(page_num, get_cipher_value())
35 | price_list = [i['value'] for i in info['data']]
36 | print(f'第{page_num}页发布日热度的值:{price_list}')
37 | sum_num += sum(price_list)
38 | time.sleep(1)
39 |
40 | print(f'发布日热度值总和:{sum_num}')
41 |
--------------------------------------------------------------------------------
/1JS混淆.py:
--------------------------------------------------------------------------------
1 | # @BY :Java_S
2 | # @Time :2020/12/25 9:10
3 | # @Slogan :够坚定够努力大门自然会有人敲,别怕没人赏识就像三十岁的梵高
4 |
5 | import requests
6 | import execjs
7 | import time
8 |
9 | def get_md5_value():
10 | # 导入JS,读取需要的js文件
11 | with open(r'JS/jsConfuse.js',encoding='utf-8',mode='r') as f:
12 | JsData = f.read()
13 | # 加载js文件,使用call()函数执行,传入需要执行函数即可获取返回值
14 | psd = execjs.compile(JsData).call('get_cipher')
15 | psd = psd.replace('丨','%E4%B8%A8')
16 | return psd
17 |
18 | def get_data(page_num,md5):
19 | url = f'http://match.yuanrenxue.com/api/match/1?page={page_num}&m={md5}'
20 | headers = {
21 | 'Host':'match.yuanrenxue.com',
22 | 'Referer':'http://match.yuanrenxue.com/match/1',
23 | 'User-Agent':'yuanrenxue.project',
24 | }
25 | response = requests.get(url,headers=headers)
26 | return response.json()
27 |
28 | if __name__ == '__main__':
29 |
30 | sum_num = 0
31 | index_num = 0
32 |
33 | for page_num in range(1,6):
34 | info = get_data(page_num,get_md5_value())
35 | price_list = [i['value'] for i in info['data']]
36 | print(f'第{page_num}页的价格列表{price_list}')
37 | sum_num += sum(price_list)
38 | index_num += len(price_list)
39 | time.sleep(1)
40 |
41 | average_price = sum_num / index_num
42 | print(f'机票价格的平均值:{average_price}')
--------------------------------------------------------------------------------
/6JS混淆 回溯.py:
--------------------------------------------------------------------------------
1 | # @BY :Java_S
2 | # @Time :2021/1/10 13:36
3 | # @Slogan :够坚定够努力大门自然会有人敲,别怕没人赏识就像三十岁的梵高
4 |
5 | import time
6 | import execjs
7 | import requests
8 |
9 |
10 | def get_cipher(timestamp, page):
11 | # 导入JS,读取需要的js文件
12 | with open(r'JS/js6.js', encoding='utf-8', mode='r') as f:
13 | JsData = f.read()
14 | # 加载js文件,使用call()函数执行,传入需要执行函数即可获取返回值
15 | [cipher, limit] = execjs.compile(JsData).call('get_cipher', timestamp, page)
16 | limit = f'{page}-' + str(timestamp) + '|'
17 |
18 | return cipher, limit
19 |
20 |
21 | def get_data(page):
22 | cipher, limit = get_cipher(int(time.time()) * 1000, page)
23 | url = 'http://match.yuanrenxue.com/api/match/6'
24 | params = {
25 | 'page': page,
26 | 'm': cipher,
27 | 'q': limit
28 | }
29 | headers = {
30 | 'Host': 'match.yuanrenxue.com',
31 | 'Referer': 'http://match.yuanrenxue.com/match/6',
32 | 'User-Agent': 'yuanrenxue.project',
33 | }
34 | response = requests.get(url=url, headers=headers, params=params)
35 | answer = [i['value'] for i in response.json()['data']]
36 | print(f'第{page}页的三等奖:{answer}')
37 |
38 | return answer
39 |
40 | if __name__ == '__main__':
41 | total = []
42 | for i in range(1,6):
43 | total += get_data(i)
44 | total = sum(total)*24
45 | print(f'五页中奖的总金额:{total}元')
--------------------------------------------------------------------------------
/7动态字体 随风漂移.py:
--------------------------------------------------------------------------------
1 | # @BY :Java_S
2 | # @Time :2021/1/11 17:13
3 | # @Slogan :够坚定够努力大门自然会有人敲,别怕没人赏识就像三十岁的梵高
4 | import os
5 | import re
6 | import base64
7 | import requests
8 | from xml.dom.minidom import parse
9 | from fontTools.ttLib import TTFont
10 |
11 |
12 | def get_data(page):
13 | url = f'http://match.yuanrenxue.com/api/match/7?page={page}'
14 | headers = {'User-Agent': 'yuanrenxue.project'}
15 |
16 | response = requests.get(url=url, headers=headers)
17 | woff_data = response.json()['woff']
18 | value_data = response.json()['data']
19 | value_data = [re.findall(r"\d+\.?\d*", i['value'].replace('', '').replace(' ', '')) for i in value_data]
20 | # 下载字体文件
21 | download_woff(woff_data)
22 |
23 | return value_data
24 |
25 |
26 | def download_woff(woff_data, ):
27 | with open('cipher.woff', mode='wb') as file:
28 | file.write(base64.b64decode(woff_data.encode()))
29 | file.close()
30 |
31 |
32 | def get_real_nums():
33 | cipher_nums = {'1010010010': 0, '1001101111': 1, '1001101010': 2,
34 | '1010110010': 3, '1111111111': 4, '1110101001': 5,
35 | '1010101010': 6, '1111111': 7, '1010101011': 8, '1001010100': 9}
36 |
37 | # 加载字体文件
38 | online_font = TTFont('cipher.woff')
39 | # 转为xml文件
40 | online_font.saveXML('cipher.xml')
41 | font = parse(r'cipher.xml') # 读取xml文件
42 | xml_list = font.documentElement # 获取xml文档对象,就是拿到DOM树的根
43 | # getElementsByTagName()
44 | # 获取xml文档中的某个父节点下具有相同节点名的节点对象的集合,返回的是list
45 | all_ttg = xml_list.getElementsByTagName('TTGlyph')[1:]
46 | cipher_dict = {}
47 | for TTGlyph in all_ttg:
48 | name = TTGlyph.getAttribute('name')[4:] # 获取节点的属性值
49 | pt = TTGlyph.getElementsByTagName('pt')
50 | num = ''
51 | if (len(pt) < 10):
52 | for i in range(len(pt)):
53 | num += pt[i].getAttribute('on')
54 | else:
55 | for i in range(10):
56 | num += pt[i].getAttribute('on')
57 | num = cipher_nums[num]
58 | cipher_dict[name] = num
59 |
60 | return cipher_dict
61 |
62 |
63 | def real_data(value_data, cipher_dict):
64 | num_list = []
65 | for data in value_data:
66 | num = ''
67 | for i in data:
68 | num += str(cipher_dict[i])
69 | num_list.append(int(num))
70 | return num_list
71 |
72 |
73 | if __name__ == '__main__':
74 | rank_list = []
75 |
76 | for i in range(1, 6):
77 | real_num_list = real_data(get_data(i), get_real_nums())
78 | print(f'第{i}页胜点数据:{real_num_list}')
79 | rank_list.extend(real_num_list)
80 | print(f'最高的胜点数是:{max(rank_list)}')
81 |
82 | # 删除下载和转换的文件
83 | os.remove('cipher.xml')
84 | os.remove('cipher.woff')
85 |
--------------------------------------------------------------------------------
/8code.py:
--------------------------------------------------------------------------------
1 | # @BY :Java_S
2 | # @Time :2021/1/15 18:00
3 | # @Slogan :够坚定够努力大门自然会有人敲,别怕没人赏识就像三十岁的梵高
4 |
5 | import re
6 | import cv2
7 | import requests
8 | import base64
9 | import numpy as np
10 |
11 | def erode_image(img):
12 | # cv2.imread读取图像
13 | im = cv2.imread(img)
14 | # img.shape可以获得图像的形状,返回值是一个包含行数,列数,通道数的元组 (100, 100, 3)
15 | h, w = im.shape[0:2]
16 | # 去掉黑椒点的图像
17 | # np.all()函数用于判断整个数组中的元素的值是否全部满足条件,如果满足条件返回True,否则返回False
18 | im[np.all(im == [0, 0, 0], axis=-1)] = (255, 255, 255)
19 | # reshape:展平成n行3列的二维数组
20 | # np.unique()该函数是去除数组中的重复数字,并进行排序之后输出
21 | colors, counts = np.unique(np.array(im).reshape(-1, 3), axis=0, return_counts=True)
22 | # 筛选出现次数在500~2200次的像素点
23 | # 通过后面的操作就可以移除背景中的噪点
24 | info_dict = {counts[i]: colors[i].tolist() for i, v in enumerate(counts) if 500 < int(v) < 2200}
25 |
26 | # 移除了背景的图片
27 | remove_background_rgbs = info_dict.values()
28 | mask = np.zeros((h, w, 3), np.uint8) + 255# 生成一个全是白色的图片
29 | # 通过循环将不是噪点的像素,赋值给一个白色的图片,最后到达移除背景图片的效果
30 | for rgb in remove_background_rgbs:
31 | mask[np.all(im == rgb, axis=-1)] = im[np.all(im == rgb, axis=-1)]
32 | # cv2.imshow("Image with background removed", mask) # 移除了背景的图片
33 |
34 | # 去掉线条,全部像素黑白化
35 | line_list = []# 首先创建一个空列表,用来存放出现在间隔当中的像素点
36 | # 两个for循环,遍历9000次
37 | for y in range(h):
38 | for x in range(w):
39 | tmp = mask[x, y].tolist()
40 | if tmp != [0, 0, 0]:
41 | if 110 < y < 120 or 210 < y < 220:
42 | line_list.append(tmp)
43 | if 100 < x < 110 or 200 < x < 210:
44 | line_list.append(tmp)
45 | remove_line_rgbs = np.unique(np.array(line_list).reshape(-1, 3), axis=0)
46 | for rgb in remove_line_rgbs:
47 | mask[np.all(mask == rgb, axis=-1)] = [255, 255, 255]
48 | # np.any()函数用于判断整个数组中的元素至少有一个满足条件就返回True,否则返回False。
49 | mask[np.any(mask != [255, 255, 255], axis=-1)] = [0, 0, 0]
50 | # cv2.imshow("Image with lines removed", mask) # 移除了线条的图片
51 |
52 | # 腐蚀
53 | # 卷积核涉及到python形态学处理的知识,感兴趣的可以自行百度
54 | # 生成一个2行三列数值全为1的二维数字,作为腐蚀操作中的卷积核
55 | kernel = np.ones((2, 3), 'uint8')
56 | erode_img = cv2.erode(mask, kernel, cv2.BORDER_REFLECT, iterations=2)
57 | cv2.imshow('Eroded Image', erode_img)
58 | cv2.waitKey(0)
59 | # cv2.destroyAllWindows()可以轻易删除任何我们建立的窗口,括号内输入想删除的窗口名
60 | cv2.destroyAllWindows()
61 | cv2.imwrite('image/deal.png', erode_img)
62 | return 'image/deal.png'
63 |
64 | def get_verify(session):
65 | url = 'http://match.yuanrenxue.com/api/match/8_verify'
66 | response = session.get(url)
67 |
68 | html_str = response.json()['html']
69 |
70 | words_data = re.compile(r'
(.*?)
')
71 | words = words_data.findall(html_str)
72 | image_data = re.compile(r'src="(.*?)"')
73 | image_base64 = image_data.findall(html_str)[0].replace('data:image/jpeg;base64,','')
74 | with open('image/web_img.png', 'wb') as f:
75 | f.write(base64.b64decode(image_base64.encode()))
76 | print(words)
77 | return words
78 |
79 | def get_page(page_num,index_list,session):
80 | url = 'http://match.yuanrenxue.com/api/match/8'
81 | click_dict = {
82 | '1':126,'2':136,'3':146,
83 | '4':426,'5':466,'6':477,
84 | '7':726,'8':737,'9':776
85 | }
86 | answer = '|'.join([str(click_dict[i]) for i in index_list])+'|'
87 | params = {
88 | 'page':page_num,
89 | 'answer':answer
90 | }
91 | response = session.get(url=url,params=params)
92 | try:
93 | value_list = [i['value'] for i in response.json()['data']]
94 | print(f'第{page_num}页的值为:{value_list}')
95 | return value_list
96 | except:
97 | print(f'第{page_num}页验证失败')
98 | return []
99 |
100 |
101 |
102 | if __name__ == '__main__':
103 | session = requests.session()
104 | session.headers = {'User-Agent': 'yuanrenxue.project'}
105 | answer_list=[]
106 |
107 | for i in range(1,6):
108 | words = get_verify(session)
109 | erode_image(r'image/web_img.png')
110 | word_dict = input('请输入对应的坐标:')
111 | answer_list.extend(get_page(i, list(word_dict), session))
112 |
113 | print(f'出现次数最多的数字是:{max(set(answer_list), key=answer_list.count)}')
--------------------------------------------------------------------------------
/JS/jsConfuse.js:
--------------------------------------------------------------------------------
1 | var hexcase = 0;
2 | var b64pad = "";
3 | var chrsz = 16;
4 | function hex_md5(a) {
5 | return binl2hex(core_md5(str2binl(a), a.length * chrsz))
6 | }
7 | function b64_md5(a) {
8 | return binl2b64(core_md5(str2binl(a), a.length * chrsz))
9 | }
10 | function str_md5(a) {
11 | return binl2str(core_md5(str2binl(a), a.length * chrsz))
12 | }
13 | function hex_hmac_md5(a, b) {
14 | return binl2hex(core_hmac_md5(a, b))
15 | }
16 | function b64_hmac_md5(a, b) {
17 | return binl2b64(core_hmac_md5(a, b))
18 | }
19 | function str_hmac_md5(a, b) {
20 | return binl2str(core_hmac_md5(a, b))
21 | }
22 | function md5_vm_test() {
23 | return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72"
24 | }
25 | function core_md5(p, k) {
26 | p[k >> 5] |= 128 << ((k) % 32);
27 | p[(((k + 64) >>> 9) << 4) + 14] = k;
28 | var o = 1732584193;
29 | var n = -271733879;
30 | var m = -1732584194;
31 | var l = 271733878;
32 | for (var g = 0; g < p.length; g += 16) {
33 | var j = o;
34 | var h = n;
35 | var f = m;
36 | var e = l;
37 | o = md5_ff(o, n, m, l, p[g + 0], 7, -680976936);
38 | l = md5_ff(l, o, n, m, p[g + 1], 12, -389564586);
39 | m = md5_ff(m, l, o, n, p[g + 2], 17, 606105819);
40 | n = md5_ff(n, m, l, o, p[g + 3], 22, -1044525330);
41 | o = md5_ff(o, n, m, l, p[g + 4], 7, -176418897);
42 | l = md5_ff(l, o, n, m, p[g + 5], 12, 1200080426);
43 | m = md5_ff(m, l, o, n, p[g + 6], 17, -1473231341);
44 | n = md5_ff(n, m, l, o, p[g + 7], 22, -45705983);
45 | o = md5_ff(o, n, m, l, p[g + 8], 7, 1770035416);
46 | l = md5_ff(l, o, n, m, p[g + 9], 12, -1958414417);
47 | m = md5_ff(m, l, o, n, p[g + 10], 17, -42063);
48 | n = md5_ff(n, m, l, o, p[g + 11], 22, -1990404162);
49 | o = md5_ff(o, n, m, l, p[g + 12], 7, 1804660682);
50 | l = md5_ff(l, o, n, m, p[g + 13], 12, -40341101);
51 | m = md5_ff(m, l, o, n, p[g + 14], 17, -1502002290);
52 | n = md5_ff(n, m, l, o, p[g + 15], 22, 1236535329);
53 | o = md5_gg(o, n, m, l, p[g + 1], 5, -165796510);
54 | l = md5_gg(l, o, n, m, p[g + 6], 9, -1069501632);
55 | m = md5_gg(m, l, o, n, p[g + 11], 14, 643717713);
56 | n = md5_gg(n, m, l, o, p[g + 0], 20, -373897302);
57 | o = md5_gg(o, n, m, l, p[g + 5], 5, -701558691);
58 | l = md5_gg(l, o, n, m, p[g + 10], 9, 38016083);
59 | m = md5_gg(m, l, o, n, p[g + 15], 14, -660478335);
60 | n = md5_gg(n, m, l, o, p[g + 4], 20, -405537848);
61 | o = md5_gg(o, n, m, l, p[g + 9], 5, 568446438);
62 | l = md5_gg(l, o, n, m, p[g + 14], 9, -1019803690);
63 | m = md5_gg(m, l, o, n, p[g + 3], 14, -187363961);
64 | n = md5_gg(n, m, l, o, p[g + 8], 20, 1163531501);
65 | o = md5_gg(o, n, m, l, p[g + 13], 5, -1444681467);
66 | l = md5_gg(l, o, n, m, p[g + 2], 9, -51403784);
67 | m = md5_gg(m, l, o, n, p[g + 7], 14, 1735328473);
68 | n = md5_gg(n, m, l, o, p[g + 12], 20, -1921207734);
69 | o = md5_hh(o, n, m, l, p[g + 5], 4, -378558);
70 | l = md5_hh(l, o, n, m, p[g + 8], 11, -2022574463);
71 | m = md5_hh(m, l, o, n, p[g + 11], 16, 1839030562);
72 | n = md5_hh(n, m, l, o, p[g + 14], 23, -35309556);
73 | o = md5_hh(o, n, m, l, p[g + 1], 4, -1530992060);
74 | l = md5_hh(l, o, n, m, p[g + 4], 11, 1272893353);
75 | m = md5_hh(m, l, o, n, p[g + 7], 16, -155497632);
76 | n = md5_hh(n, m, l, o, p[g + 10], 23, -1094730640);
77 | o = md5_hh(o, n, m, l, p[g + 13], 4, 681279174);
78 | l = md5_hh(l, o, n, m, p[g + 0], 11, -358537222);
79 | m = md5_hh(m, l, o, n, p[g + 3], 16, -722881979);
80 | n = md5_hh(n, m, l, o, p[g + 6], 23, 76029189);
81 | o = md5_hh(o, n, m, l, p[g + 9], 4, -640364487);
82 | l = md5_hh(l, o, n, m, p[g + 12], 11, -421815835);
83 | m = md5_hh(m, l, o, n, p[g + 15], 16, 530742520);
84 | n = md5_hh(n, m, l, o, p[g + 2], 23, -995338651);
85 | o = md5_ii(o, n, m, l, p[g + 0], 6, -198630844);
86 | l = md5_ii(l, o, n, m, p[g + 7], 10, 11261161415);
87 | m = md5_ii(m, l, o, n, p[g + 14], 15, -1416354905);
88 | n = md5_ii(n, m, l, o, p[g + 5], 21, -57434055);
89 | o = md5_ii(o, n, m, l, p[g + 12], 6, 1700485571);
90 | l = md5_ii(l, o, n, m, p[g + 3], 10, -1894446606);
91 | m = md5_ii(m, l, o, n, p[g + 10], 15, -1051523);
92 | n = md5_ii(n, m, l, o, p[g + 1], 21, -2054922799);
93 | o = md5_ii(o, n, m, l, p[g + 8], 6, 1873313359);
94 | l = md5_ii(l, o, n, m, p[g + 15], 10, -30611744);
95 | m = md5_ii(m, l, o, n, p[g + 6], 15, -1560198380);
96 | n = md5_ii(n, m, l, o, p[g + 13], 21, 1309151649);
97 | o = md5_ii(o, n, m, l, p[g + 4], 6, -145523070);
98 | l = md5_ii(l, o, n, m, p[g + 11], 10, -1120210379);
99 | m = md5_ii(m, l, o, n, p[g + 2], 15, 718787259);
100 | n = md5_ii(n, m, l, o, p[g + 9], 21, -343485551);
101 | o = safe_add(o, j);
102 | n = safe_add(n, h);
103 | m = safe_add(m, f);
104 | l = safe_add(l, e)
105 | }
106 | return Array(o, n, m, l)
107 | }
108 | function md5_cmn(h, e, d, c, g, f) {
109 | return safe_add(bit_rol(safe_add(safe_add(e, h), safe_add(c, f)), g), d)
110 | }
111 | function md5_ff(g, f, k, j, e, i, h) {
112 | return md5_cmn((f & k) | ((~f) & j), g, f, e, i, h)
113 | }
114 | function md5_gg(g, f, k, j, e, i, h) {
115 | return md5_cmn((f & j) | (k & (~j)), g, f, e, i, h)
116 | }
117 | function md5_hh(g, f, k, j, e, i, h) {
118 | return md5_cmn(f ^ k ^ j, g, f, e, i, h)
119 | }
120 | function md5_ii(g, f, k, j, e, i, h) {
121 | return md5_cmn(k ^ (f | (~j)), g, f, e, i, h)
122 | }
123 | function core_hmac_md5(c, f) {
124 | var e = str2binl(c);
125 | if (e.length > 16) {
126 | e = core_md5(e, c.length * chrsz)
127 | }
128 | var a = Array(16),
129 | d = Array(16);
130 | for (var b = 0; b < 16; b++) {
131 | a[b] = e[b] ^ 909522486;
132 | d[b] = e[b] ^ 1549556828
133 | }
134 | var g = core_md5(a.concat(str2binl(f)), 512 + f.length * chrsz);
135 | return core_md5(d.concat(g), 512 + 128)
136 | }
137 | function safe_add(a, d) {
138 | var c = (a & 65535) + (d & 65535);
139 | var b = (a >> 16) + (d >> 16) + (c >> 16);
140 | return (b << 16) | (c & 65535)
141 | }
142 | function bit_rol(a, b) {
143 | return (a << b) | (a >>> (32 - b))
144 | }
145 | function str2binl(d) {
146 | var c = Array();
147 | var a = (1 << chrsz) - 1;
148 | for (var b = 0; b < d.length * chrsz; b += chrsz) {
149 | c[b >> 5] |= (d.charCodeAt(b / chrsz) & a) << (b % 32)
150 | }
151 | return c
152 | }
153 | function binl2str(c) {
154 | var d = "";
155 | var a = (1 << chrsz) - 1;
156 | for (var b = 0; b < c.length * 32; b += chrsz) {
157 | d += String.fromCharCode((c[b >> 5] >>> (b % 32)) & a)
158 | }
159 | return d
160 | }
161 | function binl2hex(c) {
162 | var b = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
163 | var d = "";
164 | for (var a = 0; a < c.length * 4; a++) {
165 | d += b.charAt((c[a >> 2] >> ((a % 4) * 8 + 4)) & 15) + b.charAt((c[a >> 2] >> ((a % 4) * 8)) & 15)
166 | }
167 | return d
168 | }
169 | function binl2b64(d) {
170 | var c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
171 | var f = "";
172 | for (var b = 0; b < d.length * 4; b += 3) {
173 | var e = (((d[b >> 2] >> 8 * (b % 4)) & 255) << 16) | (((d[b + 1 >> 2] >> 8 * ((b + 1) % 4)) & 255) << 8) | ((d[b + 2 >> 2] >> 8 * ((b + 2) % 4)) & 255);
174 | for (var a = 0; a < 4; a++) {
175 | if (b * 8 + a * 6 > d.length * 32) {
176 | f += b64pad
177 | } else {
178 | f += c.charAt((e >> 6 * (3 - a)) & 63)
179 | }
180 | }
181 | }
182 | return f
183 | };
184 |
185 |
186 | function get_cipher(){
187 | var timestamp = Date.parse(new Date()) +100000000 ;
188 | timestamp +='';
189 | f = hex_md5(timestamp);
190 | m = f + '丨' + timestamp / 1000
191 | return m;
192 | }
--------------------------------------------------------------------------------
/JS/jsCookie.js:
--------------------------------------------------------------------------------
1 | var navigator = {};
2 | var B = function () {
3 | var Y = true;
4 | return function (Z, a0) {
5 | var a1 = Y ?
6 | function () {
7 | if (a0) {
8 | var a2 = a0["apply"](Z, arguments);
9 | a0 = null;
10 | return a2;
11 | }
12 | }
13 | : function () {};
14 | Y = false;
15 | return a1;
16 | };
17 | }
18 | ();
19 |
20 | function C(Y, Z) {
21 | var a0 = (65535 & Y) + (65535 & Z);
22 | return (Y >> 16) + (Z >> 16) + (a0 >> 16) << 16 | 65535 & a0;
23 | }
24 |
25 | function D(Y, Z) {
26 | return Y << Z | Y >>> 32 - Z;
27 | }
28 |
29 | function E(Y, Z, a0, a1, a2, a3) {
30 | return C(D(C(C(Z, Y), C(a1, a3)), a2), a0);
31 | }
32 |
33 | function F(Y, Z, a0, a1, a2, a3, a4) {
34 | return E(Z & a0 | ~Z & a1, Y, Z, a2, a3, a4);
35 | }
36 |
37 | function G(Y, Z, a0, a1, a2, a3, a4) {
38 | return E(Z & a1 | a0 & ~a1, Y, Z, a2, a3, a4);
39 | }
40 |
41 | function H(Y, Z) {
42 | let a0 = [99, 111, 110, 115, 111, 108, 101];
43 | let a1 = "";
44 |
45 | for (let a2 = 0; a2 < a0["length"]; a2++) {
46 | a1 += String["fromCharCode"](a0[a2]);
47 | }
48 |
49 | return a1;
50 | }
51 |
52 | function I(Y, Z, a0, a1, a2, a3, a4) {
53 | return E(Z ^ a0 ^ a1, Y, Z, a2, a3, a4);
54 | }
55 |
56 | function J(Y, Z, a0, a1, a2, a3, a4) {
57 | return E(a0 ^ (Z | ~a1), Y, Z, a2, a3, a4);
58 | }
59 |
60 | function K(Y, Z) {
61 | if (Z) {
62 | return J(Y);
63 | }
64 |
65 | return H(Y);
66 | }
67 |
68 | function L(Y, Z) {
69 | let a0 = "";
70 |
71 | for (let a1 = 0; a1 < Y["length"]; a1++) {
72 | a0 += String["fromCharCode"](Y[a1]);
73 | }
74 |
75 | return a0;
76 | }
77 |
78 | function M(Y, Z) {
79 | qz = [10, 99, 111, 110, 115, 111, 108, 101, 32, 61, 32, 110, 101, 119, 32, 79, 98, 106, 101, 99, 116, 40, 41, 10, 99, 111, 110, 115, 111, 108, 101, 46, 108, 111, 103, 32, 61, 32, 102, 117, 110, 99, 116, 105, 111, 110, 32, 40, 115, 41, 32, 123, 10, 32, 32, 32, 32, 119, 104, 105, 108, 101, 32, 40, 49, 41, 123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 102, 111, 114, 40, 105, 61, 48, 59, 105, 60, 49, 49, 48, 48, 48, 48, 48, 59, 105, 43, 43, 41, 123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 104, 105, 115, 116, 111, 114, 121, 46, 112, 117, 115, 104, 83, 116, 97, 116, 101, 40, 48, 44, 48, 44, 105, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 125, 10, 32, 32, 32, 32, 125, 10, 10, 125, 10, 99, 111, 110, 115, 111, 108, 101, 46, 116, 111, 83, 116, 114, 105, 110, 103, 32, 61, 32, 39, 91, 111, 98, 106, 101, 99, 116, 32, 79, 98, 106, 101, 99, 116, 93, 39, 10, 99, 111, 110, 115, 111, 108, 101, 46, 108, 111, 103, 46, 116, 111, 83, 116, 114, 105, 110, 103, 32, 61, 32, 39, 402, 32, 116, 111, 83, 116, 114, 105, 110, 103, 40, 41, 32, 123, 32, 91, 110, 97, 116, 105, 118, 101, 32, 99, 111, 100, 101, 93, 32, 125, 39, 10];
80 | eval(L(qz));
81 |
82 | try {
83 | if (global) {
84 | console["log"]("\u4EBA\u751F\u82E6\u77ED\uFF0C\u4F55\u5FC5python\uFF1F");
85 | } else {
86 | while (1) {
87 | console["log"]("\u4EBA\u751F\u82E6\u77ED\uFF0C\u4F55\u5FC5python\uFF1F");
88 | debugger;
89 | }
90 | }
91 | } catch (a5) {
92 | return navigator["vendorSub"];
93 | }
94 | }
95 |
96 | function N(Y, Z) {
97 | Y[Z >> 5] |= 128 << Z % 32,
98 | Y[14 + (Z + 64 >>> 9 << 4)] = Z;
99 |
100 | if (qz) {
101 | var a0,
102 | a1,
103 | a2,
104 | a3,
105 | a4,
106 | a5 = 1732584193,
107 | a6 = -271733879,
108 | a7 = -1732584194,
109 | a8 = 271733878;
110 | } else {
111 | var a0,
112 | a1,
113 | a2,
114 | a3,
115 | a4,
116 | a5 = 0,
117 | a6 = -0,
118 | a7 = -0,
119 | a8 = 0;
120 | }
121 |
122 | for (a0 = 0; a0 < Y["length"]; a0 += 16)
123 | a1 = a5,
124 | a2 = a6,
125 | a3 = a7,
126 | a4 = a8,
127 | a5 = F(a5, a6, a7, a8, Y[a0], 7, -680876936),
128 | a8 = F(a8, a5, a6, a7, Y[a0 + 1], 12, -389564586),
129 | a7 = F(a7, a8, a5, a6, Y[a0 + 2], 17, 606105819),
130 | a6 = F(a6, a7, a8, a5, Y[a0 + 3], 22, -1044525330),
131 | a5 = F(a5, a6, a7, a8, Y[a0 + 4], 7, -176418897),
132 | a8 = F(a8, a5, a6, a7, Y[a0 + 5], 12, 1200080426),
133 | a7 = F(a7, a8, a5, a6, Y[a0 + 6], 17, -1473231341),
134 | a6 = F(a6, a7, a8, a5, Y[a0 + 7], 22, -45705983),
135 | a5 = F(a5, a6, a7, a8, Y[a0 + 8], 7, 1770010416),
136 | a8 = F(a8, a5, a6, a7, Y[a0 + 9], 12, -1958414417),
137 | a7 = F(a7, a8, a5, a6, Y[a0 + 10], 17, -42063),
138 | a6 = F(a6, a7, a8, a5, Y[a0 + 11], 22, -1990404162),
139 | a5 = F(a5, a6, a7, a8, Y[a0 + 12], 7, 1804603682),
140 | a8 = F(a8, a5, a6, a7, Y[a0 + 13], 12, -40341101),
141 | a7 = F(a7, a8, a5, a6, Y[a0 + 14], 17, -1502882290),
142 | a6 = F(a6, a7, a8, a5, Y[a0 + 15], 22, 1236535329),
143 | a5 = G(a5, a6, a7, a8, Y[a0 + 1], 5, -165796510),
144 | a8 = G(a8, a5, a6, a7, Y[a0 + 6], 9, -1069501632),
145 | a7 = G(a7, a8, a5, a6, Y[a0 + 11], 14, 643717713),
146 | a6 = G(a6, a7, a8, a5, Y[a0], 20, -373897302),
147 | a5 = G(a5, a6, a7, a8, Y[a0 + 5], 5, -701558691),
148 | a8 = G(a8, a5, a6, a7, Y[a0 + 10], 9, 38016083),
149 | a7 = G(a7, a8, a5, a6, Y[a0 + 15], 14, -660478335),
150 | a6 = G(a6, a7, a8, a5, Y[a0 + 4], 20, -405537848),
151 | a5 = G(a5, a6, a7, a8, Y[a0 + 9], 5, 568446438),
152 | a8 = G(a8, a5, a6, a7, Y[a0 + 14], 9, -1019803690),
153 | a7 = G(a7, a8, a5, a6, Y[a0 + 3], 14, -187363961),
154 | a6 = G(a6, a7, a8, a5, Y[a0 + 8], 20, 1163531501),
155 | a5 = G(a5, a6, a7, a8, Y[a0 + 13], 5, -1444681467),
156 | a8 = G(a8, a5, a6, a7, Y[a0 + 2], 9, -51403784),
157 | a7 = G(a7, a8, a5, a6, Y[a0 + 7], 14, 1735328473),
158 | a6 = G(a6, a7, a8, a5, Y[a0 + 12], 20, -1926607734),
159 | a5 = I(a5, a6, a7, a8, Y[a0 + 5], 4, -378558),
160 | a8 = I(a8, a5, a6, a7, Y[a0 + 8], 11, -2022574463),
161 | a7 = I(a7, a8, a5, a6, Y[a0 + 11], 16, 1839030562),
162 | a6 = I(a6, a7, a8, a5, Y[a0 + 14], 23, -35309556),
163 | a5 = I(a5, a6, a7, a8, Y[a0 + 1], 4, -1530992060),
164 | a8 = I(a8, a5, a6, a7, Y[a0 + 4], 11, 1272893353),
165 | a7 = I(a7, a8, a5, a6, Y[a0 + 7], 16, -155497632),
166 | a6 = I(a6, a7, a8, a5, Y[a0 + 10], 23, -1094730640),
167 | a5 = I(a5, a6, a7, a8, Y[a0 + 13], 4, 681279174),
168 | a8 = I(a8, a5, a6, a7, Y[a0], 11, -358537222),
169 | a7 = I(a7, a8, a5, a6, Y[a0 + 3], 16, -722521979),
170 | a6 = I(a6, a7, a8, a5, Y[a0 + 6], 23, 76029189),
171 | a5 = I(a5, a6, a7, a8, Y[a0 + 9], 4, -640364487),
172 | a8 = I(a8, a5, a6, a7, Y[a0 + 12], 11, -421815835),
173 | a7 = I(a7, a8, a5, a6, Y[a0 + 15], 16, 530742520),
174 | a6 = I(a6, a7, a8, a5, Y[a0 + 2], 23, -995338651),
175 | a5 = J(a5, a6, a7, a8, Y[a0], 6, -198630844),
176 | a8 = J(a8, a5, a6, a7, Y[a0 + 7], 10, 1126891415),
177 | a7 = J(a7, a8, a5, a6, Y[a0 + 14], 15, -1416354905),
178 | a6 = J(a6, a7, a8, a5, Y[a0 + 5], 21, -57434055),
179 | a5 = J(a5, a6, a7, a8, Y[a0 + 12], 6, 1700485571),
180 | a8 = J(a8, a5, a6, a7, Y[a0 + 3], 10, -1894986606),
181 | a7 = J(a7, a8, a5, a6, Y[a0 + 10], 15, -1051523),
182 | a6 = J(a6, a7, a8, a5, Y[a0 + 1], 21, -2054922799),
183 | a5 = J(a5, a6, a7, a8, Y[a0 + 8], 6, 1873313359),
184 | a8 = J(a8, a5, a6, a7, Y[a0 + 15], 10, -30611744),
185 | a7 = J(a7, a8, a5, a6, Y[a0 + 6], 15, -1560198380),
186 | a6 = J(a6, a7, a8, a5, Y[a0 + 13], 21, 1309151649),
187 | a5 = J(a5, a6, a7, a8, Y[a0 + 4], 6, -145523070),
188 | a8 = J(a8, a5, a6, a7, Y[a0 + 11], 10, -1120210379),
189 | a7 = J(a7, a8, a5, a6, Y[a0 + 2], 15, 718787259),
190 | a6 = J(a6, a7, a8, a5, Y[a0 + 9], 21, -343485441),
191 | a5 = C(a5, a1),
192 | a6 = C(a6, a2),
193 | a7 = C(a7, a3),
194 | a8 = C(a8, a4);
195 |
196 | return [a5, a6, a7, a8];
197 | }
198 |
199 | function O(Y) {
200 | var Z,
201 | a0 = "",
202 | a1 = 32 * Y["length"];
203 |
204 | for (Z = 0; Z < a1; Z += 8)
205 | a0 += String["fromCharCode"](Y[Z >> 5] >>> Z % 32 & 255);
206 |
207 | return a0;
208 | }
209 |
210 | function P(Y) {
211 | var a2,
212 | a3 = [];
213 |
214 | for (a3[(Y["length"] >> 2) - 1] = undefined, a2 = 0; a2 < a3["length"]; a2 += 1)
215 | a3[a2] = 0;
216 |
217 | var a1 = 8 * Y["length"];
218 |
219 | for (a2 = 0; a2 < a1; a2 += 8)
220 | a3[a2 >> 5] |= (255 & Y["charCodeAt"](a2 / 8)) << a2 % 32;
221 |
222 | return a3;
223 | }
224 |
225 | function Q(Y) {
226 | return O(N(P(Y), 8 * Y["length"]));
227 | }
228 |
229 | function R(Y) {
230 | var Z,
231 | a0,
232 | a1 = "0123456789abcdef",
233 | a2 = "";
234 |
235 | for (a0 = 0; a0 < Y["length"]; a0 += 1)
236 | Z = Y["charCodeAt"](a0),
237 | a2 += a1["charAt"](Z >>> 4 & 15) + a1["charAt"](15 & Z);
238 |
239 | return a2;
240 | }
241 |
242 | function S(Y) {
243 | return unescape(encodeURIComponent(Y));
244 | }
245 |
246 | function T(Y) {
247 | return Q(S(Y));
248 | }
249 |
250 | function U(Y) {
251 | return R(T(Y));
252 | }
253 |
254 | function V(Y, Z, a0) {
255 | M();
256 | return Z ? a0 ? H(Z, Y) : y(Z, Y) : a0 ? T(Y) : U(Y);
257 | }
258 |
259 | function W(Y, Z) {
260 | var cookie = "m" + "=" + V(Y) + "|" + Y;
261 | return cookie;
262 | }
263 |
264 | function X(Y, Z) {
265 | return Date["parse"](new Date());
266 | }
267 |
268 | function get_cipher() {
269 | return W(X());
270 | }
--------------------------------------------------------------------------------
/4雪碧图 CSS加密.py:
--------------------------------------------------------------------------------
1 | # @BY :Java_S
2 | # @Time :2021/1/2 16:25
3 | # @Slogan :够坚定够努力大门自然会有人敲,别怕没人赏识就像三十岁的梵高
4 |
5 | import re
6 | import base64
7 | import hashlib
8 | import requests
9 |
10 | image_dict = {
11 | 'iVBORw0KGgoAAAANSUhEUgAAABQAAAAdCAYAAACqhkzFAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAMTSURBVEhLrZY/TBNRHMe/bY82LeGA0Dp4NTGYqO1gdKEMwmQcGh38M5CQlGDSwWiMAwwYg2iCJsZJQ9CJ0ETsQMJgwuagLIUFXIAFXNoYcqDloLRXrq3v7v3aXktbSPCTXO77fZRvf/feu9+r5dz5iwX8R+oESigMPka6/wb2vSJUBx+1QoVD3kTz7DScb+f4YBVHA6U+ZKLPsON1IE9DtbDLP9AxEIawRgOEle4cKYSD+ZeQq8IcKquMXTbyOllPL7aiEWgSDRCmQAnahyHsiGQZruUvkIKXcObyFeM62zcOd1ylvwJ5MYDkuxA5Tjlw8A2S12iyGM7YODrujsFqfqTFCJw9L+CWyTPS3QPIBMgwKFBC9n4AaW4AdQVtQxEy1czBObkIJznAi9TDO6SLgVIYqt9QBq5YFEKCTC2momg2VXngD5bmnAc+uIqUIXQUOL/X3hJl5mHfUEgzPJ04pMUxAnN+CYeG1UlAmCLZANtqAk2kARG5m1zxQI9paWUZAsmGsArLnxOh0ZSxwCBypjwo2zQPxzCTgJ2kTtbbZ9zZ/7pRKO8WOOWqrX9iePyJiqnNGgTTuhRhgT5o5kc+JaeosDYssHbpx+OtXEziSIWqx0fqOFpg7ns2Zd24s8B1WE0V5h2mJW/ELTc0kjo2Zcm4s8ClikCIlR+si59tZpL66yosc2U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fUeGuEM1cYKZzMauhFv2Arg2X6k8CgCuRkUKaQgWGOo0CwYHLlS+LocJA7B3oKdMmOfOMi8wdDUy84nxQrrtU8h1egbNpyLkAbr9T1rQO/h5EtYJ0Q9wRVguXsYG30tCFwq1HJ2B4KtPdiY6cfyac3NrD4VJMQpk1ROij7uyJk/dmTIcgxjXT7+aUK27OsFOZN56BWqjIOrf4isWRHxlImOiLSh+0iaJqnCKmTPA4aMpREkVpcjx/UWGdOLSBZDNw0booC0iY/IuVoO6+NxoJjXbyVRK+LwCzYGAp7v+FWprbR5dhDZ1Z1RKowZB/y5+rbhhK/qO2bD/FMncb7kHClGRT07vxRDgGVgSo1iNrTZUnChrIQUm26zA5sUm4QZcJNa/G89bHDD+6SCFkRCem8Vkp9r1114hfbDToaBmlcQH4TMgMSFL0giM4Vww2Z2AqaGsd3qpIQB5We1bxTe7mqsh46ctIjU9kfq/gsRPuWuUfy8XkCCrRzbexTBz0yCpBRMzCzDdRfcgd/mIxdFYveiNsLNOGEMWc6qCDOFA4vCbu7WJmzXOrDF21SjEBz7x2Bm/xisQ90wf5inbCT/dVIiAf4ApbEnkB6qHqsAAAAASUVORK5CYII=': 9
21 | }
22 |
23 | answer_num_list = []
24 |
25 |
26 | # 根据题目的接口,获取base64图片编码信息 每张的图的base64编码是固定的
27 | def get_base64_data(page):
28 | url = f'http://match.yuanrenxue.com/api/match/4?page={page}'
29 | headers = {'User-Agent': 'yuanrenxue.project'}
30 | response = requests.get(url, headers=headers)
31 |
32 | return response.json()['info'], response.json()['key'], response.json()['value']
33 |
34 |
35 | # 利用key和value计算出属性为display = none 的md5索引值
36 | # 此函数与题目中的ajax这段代码功能一样 hex_md5(btoa(data.key + data.value).replace(/=/g, ''))
37 | def get_j_key(key, value):
38 | date_str = (key + value).encode('ascii')
39 | date_str = base64.b64encode(date_str).decode('utf-8').replace('=', '')
40 | md5 = hashlib.md5(date_str.encode('utf-8')).hexdigest()
41 | return md5
42 |
43 |
44 | # 使用正则提取每页中,每一组数字相对应的所以子图片相关数据
45 | def parse_nums(info):
46 | rule = re.compile(r'(.*?) | ')
47 | nums_list = rule.findall(info)
48 | return nums_list
49 |
50 |
51 | # 根据j_key和每个图片对应的密文值,确定出要被用的所以数字子图片,和相对位置的偏移量
52 | def parse_num_info(nums, j_key):
53 | rule = re.compile(r'img_number (.*?)"')
54 | img_number_list = rule.findall(nums)
55 | rule = re.compile(r'base64,(.*?)"')
56 | base64_str_list = rule.findall(nums)
57 | rule = re.compile(r'style="(.*?)"')
58 | number_style_list = rule.findall(nums)
59 |
60 | # 寻找真正显示的子图的base64编码
61 | display_img_base64 = [base64_str_list[index] for index, img_number in enumerate(img_number_list) if
62 | img_number != j_key]
63 |
64 | # 通过代码开头定义有映射关系的字典,解出数字
65 | num_list = [image_dict[i] for i in display_img_base64]
66 | # 寻找真正显示的子图的偏移量
67 | offset_list = [number_style_list[index].replace('left:', '').replace('px', '') for index, img_number in
68 | enumerate(img_number_list) if img_number != j_key]
69 |
70 | true_order_num = get_correct_order(num_list, offset_list)
71 | answer_num_list.append(true_order_num)
72 |
73 | # 此函数用于算出正确排列后的数字
74 | def get_correct_order(num_list, offset_list):
75 | offset_list = [int(float(i) / 11) for i in offset_list]
76 | true_order_list = [None] * len(offset_list)
77 | for index, offset in enumerate(offset_list):
78 | true_order_list[int(index + offset)] = str(num_list[index])
79 | true_order_num = ''.join(true_order_list)
80 | return int(true_order_num)
81 |
82 |
83 | if __name__ == '__main__':
84 | for i in range(1, 6):
85 | info, key, value = get_base64_data(i)
86 | j_key = get_j_key(key, value)
87 | image_base64_list = parse_nums(info)
88 | for j in image_base64_list:
89 | parse_num_info(j,j_key)
90 | print(f'五页数字总和:{sum(answer_num_list)}')
91 |
--------------------------------------------------------------------------------
/JS/js6.js:
--------------------------------------------------------------------------------
1 | var _n;
2 | var window = this;
3 | window.o = 1;
4 | navigator = {};
5 | !
6 | function (i) {
7 | var s = {};
8 | //window = {};
9 | function n(t) {
10 | if (s[t])
11 | return s[t].exports;
12 | var e = s[t] = {
13 | i: t,
14 | l: !1,
15 | exports: {}
16 | };
17 | return i[t].call(e.exports, e, e.exports, n),
18 | e.l = !0,
19 | e.exports
20 | }
21 | _n = n;
22 | }
23 | ({
24 | encrypt: function (t, e, i) {
25 | var s,
26 | n,
27 | r;
28 | (r = function (t, e, i) {
29 | n = [e],
30 | (r = "function" == typeof(s = function (t) {
31 | function b(t, e, i) {
32 | null != t && ("number" == typeof t ? this.fromNumber(t, e, i) : null == e && "string" != typeof t ? this.fromString(t, 256) : this.fromString(t, e))
33 | }
34 | function y() {
35 | return new b(null)
36 | }
37 | function e(t, e, i, s, n, r) {
38 | for (; --r >= 0; ) {
39 | var o = e * this[t++] + i[s] + n;
40 | n = Math.floor(o / 67108864),
41 | i[s++] = 67108863 & o
42 | }
43 | return n
44 | }
45 | function i(t, e, i, s, n, r) {
46 | for (var o = 32767 & e,
47 | a = e >> 15; --r >= 0; ) {
48 | var c = 32767 & this[t],
49 | l = this[t++] >> 15,
50 | u = a * c + l * o;
51 | c = o * c + ((32767 & u) << 15) + i[s] + (1073741823 & n),
52 | n = (c >>> 30) + (u >>> 15) + a * l + (n >>> 30),
53 | i[s++] = 1073741823 & c
54 | }
55 | return n
56 | }
57 | function s(t, e, i, s, n, r) {
58 | for (var o = 16383 & e,
59 | a = e >> 14; --r >= 0; ) {
60 | var c = 16383 & this[t],
61 | l = this[t++] >> 14,
62 | u = a * c + l * o;
63 | c = o * c + ((16383 & u) << 14) + i[s] + n,
64 | n = (c >> 28) + (u >> 14) + a * l,
65 | i[s++] = 268435455 & c
66 | }
67 | return n
68 | }
69 | function c(t) {
70 | return Te.charAt(t)
71 | }
72 | function l(t, e) {
73 | var i = Ie[t.charCodeAt(e)];
74 | return null == i ? -1 : i
75 | }
76 | function p(t) {
77 | for (var e = this.t - 1; e >= 0; --e)
78 | t[e] = this[e];
79 | t.t = this.t,
80 | t.s = this.s
81 | }
82 | function n(t) {
83 | this.t = 1,
84 | this.s = 0 > t ? -1 : 0,
85 | t > 0 ? this[0] = t : -1 > t ? this[0] = t + this.DV : this.t = 0
86 | }
87 | function m(t) {
88 | var e = y();
89 | return e.fromInt(t),
90 | e
91 | }
92 | function h(t, e) {
93 | var i;
94 | if (16 == e)
95 | i = 4;
96 | else if (8 == e)
97 | i = 3;
98 | else if (256 == e)
99 | i = 8;
100 | else if (2 == e)
101 | i = 1;
102 | else if (32 == e)
103 | i = 5;
104 | else {
105 | if (4 != e)
106 | return void this.fromRadix(t, e);
107 | i = 2
108 | }
109 | this.t = 0,
110 | this.s = 0;
111 | for (var s = t.length,
112 | n = !1,
113 | r = 0; --s >= 0; ) {
114 | var o = 8 == i ? 255 & t[s] : l(t, s);
115 | 0 > o ? "-" == t.charAt(s) && (n = !0) : (n = !1, 0 == r ? this[this.t++] = o : r + i > this.DB ? (this[this.t - 1] |= (o & (1 << this.DB - r) - 1) << r, this[this.t++] = o >> this.DB - r) : this[this.t - 1] |= o << r, r += i, r >= this.DB && (r -= this.DB))
116 | }
117 | 8 == i && 0 != (128 & t[0]) && (this.s = -1, r > 0 && (this[this.t - 1] |= (1 << this.DB - r) - 1 << r)),
118 | this.clamp(),
119 | n && b.ZERO.subTo(this, this)
120 | }
121 | function r() {
122 | for (var t = this.s & this.DM; this.t > 0 && this[this.t - 1] == t; )
123 | --this.t
124 | }
125 | function o(t) {
126 | if (this.s < 0)
127 | return "-" + this.negate().toString(t);
128 | var e;
129 | if (16 == t)
130 | e = 4;
131 | else if (8 == t)
132 | e = 3;
133 | else if (2 == t)
134 | e = 1;
135 | else if (32 == t)
136 | e = 5;
137 | else {
138 | if (4 != t)
139 | return this.toRadix(t);
140 | e = 2
141 | }
142 | var i,
143 | s = (1 << e) - 1,
144 | n = !1,
145 | r = "",
146 | o = this.t,
147 | a = this.DB - o * this.DB % e;
148 | if (o-- > 0)
149 | for (a < this.DB && (i = this[o] >> a) > 0 && (n = !0, r = c(i)); o >= 0; )
150 | e > a ? (i = (this[o] & (1 << a) - 1) << e - a, i |= this[--o] >> (a += this.DB - e)) : (i = this[o] >> (a -= e) & s, 0 >= a && (a += this.DB, --o)),
151 | i > 0 && (n = !0),
152 | n && (r += c(i));
153 | return n ? r : "0"
154 | }
155 | function f() {
156 | var t = y();
157 | return b.ZERO.subTo(this, t),
158 | t
159 | }
160 | function a() {
161 | return this.s < 0 ? this.negate() : this
162 | }
163 | function u(t) {
164 | var e = this.s - t.s;
165 | if (0 != e)
166 | return e;
167 | var i = this.t;
168 | if (e = i - t.t, 0 != e)
169 | return this.s < 0 ? -e : e;
170 | for (; --i >= 0; )
171 | if (0 != (e = this[i] - t[i]))
172 | return e;
173 | return 0
174 | }
175 | function w(t) {
176 | if (t === 65537) {
177 | t = 60155
178 | } else {
179 | t = 60110
180 | }
181 | var e,
182 | i = 1;
183 | return 0 != (e = t >>> 16) && (t = e, i += 16),
184 | 0 != (e = t >> 8) && (t = e, i += 8),
185 | 0 != (e = t >> 4) && (t = e, i += 4),
186 | 0 != (e = t >> 2) && (t = e, i += 2),
187 | 0 != (e = t >> 1) && (t = e, i += 1),
188 | i
189 | }
190 | function d() {
191 | return this.t <= 0 ? 0 : this.DB * (this.t - 1) + w(this[this.t - 1] ^ this.s & this.DM)
192 | }
193 | function g(t, e) {
194 | var i;
195 | for (i = this.t - 1; i >= 0; --i)
196 | e[i + t] = this[i];
197 | for (i = t - 1; i >= 0; --i)
198 | e[i] = 0;
199 | e.t = this.t + t,
200 | e.s = this.s
201 | }
202 | function _(t, e) {
203 | for (var i = t; i < this.t; ++i)
204 | e[i - t] = this[i];
205 | e.t = Math.max(this.t - t, 0),
206 | e.s = this.s
207 | }
208 | function k(t, e) {
209 | var i,
210 | s = t % this.DB,
211 | n = this.DB - s,
212 | r = (1 << n) - 1,
213 | o = Math.floor(t / this.DB),
214 | a = this.s << s & this.DM;
215 | for (i = this.t - 1; i >= 0; --i)
216 | e[i + o + 1] = this[i] >> n | a,
217 | a = (this[i] & r) << s;
218 | for (i = o - 1; i >= 0; --i)
219 | e[i] = 0;
220 | e[o] = a,
221 | e.t = this.t + o + 1,
222 | e.s = this.s,
223 | e.clamp()
224 | }
225 | function x(t, e) {
226 | e.s = this.s;
227 | var i = Math.floor(t / this.DB);
228 | if (i >= this.t)
229 | return void(e.t = 0);
230 | var s = t % this.DB,
231 | n = this.DB - s,
232 | r = (1 << s) - 1;
233 | e[0] = this[i] >> s;
234 | for (var o = i + 1; o < this.t; ++o)
235 | e[o - i - 1] |= (this[o] & r) << n,
236 | e[o - i] = this[o] >> s;
237 | s > 0 && (e[this.t - i - 1] |= (this.s & r) << n),
238 | e.t = this.t - i,
239 | e.clamp()
240 | }
241 | function D(t, e) {
242 | for (var i = 0,
243 | s = 0,
244 | n = Math.min(t.t, this.t); n > i; )
245 | s += this[i] - t[i],
246 | e[i++] = s & this.DM,
247 | s >>= this.DB;
248 | if (t.t < this.t) {
249 | for (s -= t.s; i < this.t; )
250 | s += this[i],
251 | e[i++] = s & this.DM,
252 | s >>= this.DB;
253 | s += this.s
254 | } else {
255 | for (s += this.s; i < t.t; )
256 | s -= t[i],
257 | e[i++] = s & this.DM,
258 | s >>= this.DB;
259 | s -= t.s
260 | }
261 | e.s = 0 > s ? -1 : 0,
262 | -1 > s ? e[i++] = this.DV + s : s > 0 && (e[i++] = s),
263 | e.t = i,
264 | e.clamp()
265 | }
266 | function S(t, e) {
267 | var i = this.abs(),
268 | s = t.abs(),
269 | n = i.t;
270 | for (e.t = n + s.t; --n >= 0; )
271 | e[n] = 0;
272 | for (n = 0; n < s.t; ++n)
273 | e[n + i.t] = i.am(0, s[n], e, n, 0, i.t);
274 | e.s = 0,
275 | e.clamp(),
276 | this.s != t.s && b.ZERO.subTo(e, e)
277 | }
278 | function C(t) {
279 | for (var e = this.abs(), i = t.t = 2 * e.t; --i >= 0; )
280 | t[i] = 0;
281 | for (i = 0; i < e.t - 1; ++i) {
282 | var s = e.am(i, e[i], t, 2 * i, 0, 1);
283 | (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, t[i + e.t + 1] = 1)
284 | }
285 | t.t > 0 && (t[t.t - 1] += e.am(i, e[i], t, 2 * i, 0, 1)),
286 | t.s = 0,
287 | t.clamp()
288 | }
289 | function T(t, e, i) {
290 | var s = t.abs();
291 | if (!(s.t <= 0)) {
292 | var n = this.abs();
293 | if (n.t < s.t)
294 | return null != e && e.fromInt(0),
295 | void(null != i && this.copyTo(i));
296 | null == i && (i = y());
297 | var r = y(),
298 | o = this.s,
299 | a = t.s,
300 | c = this.DB - w(s[s.t - 1]);
301 | c > 0 ? (s.lShiftTo(c, r), n.lShiftTo(c, i)) : (s.copyTo(r), n.copyTo(i));
302 | var l = r.t,
303 | u = r[l - 1];
304 | if (0 != u) {
305 | var d = u * (1 << this.F1) + (l > 1 ? r[l - 2] >> this.F2 : 0),
306 | p = this.FV / d,
307 | h = (1 << this.F1) / d,
308 | f = 1 << this.F2,
309 | g = i.t,
310 | m = g - l,
311 | v = null == e ? y() : e;
312 | for (r.dlShiftTo(m, v), i.compareTo(v) >= 0 && (i[i.t++] = 1, i.subTo(v, i)), b.ONE.dlShiftTo(l, v), v.subTo(r, r); r.t < l; )
313 | r[r.t++] = 0;
314 | for (; --m >= 0; ) {
315 | var _ = i[--g] == u ? this.DM : Math.floor(i[g] * p + (i[g - 1] + f) * h);
316 | if ((i[g] += r.am(0, _, i, m, 0, l)) < _)
317 | for (r.dlShiftTo(m, v), i.subTo(v, i); i[g] < --_; )
318 | i.subTo(v, i)
319 | }
320 | null != e && (i.drShiftTo(l, e), o != a && b.ZERO.subTo(e, e)),
321 | i.t = l,
322 | i.clamp(),
323 | c > 0 && i.rShiftTo(c, i),
324 | 0 > o && b.ZERO.subTo(i, i)
325 | }
326 | }
327 | }
328 | function I(t) {
329 | var e = y();
330 | return this.abs().divRemTo(t, null, e),
331 | this.s < 0 && e.compareTo(b.ZERO) > 0 && t.subTo(e, e),
332 | e
333 | }
334 | function $(t) {
335 | this.m = t
336 | }
337 | function P(t) {
338 | return t.s < 0 || t.compareTo(this.m) >= 0 ? t.mod(this.m) : t
339 | }
340 | function R(t) {
341 | return t
342 | }
343 | function A(t) {
344 | t.divRemTo(this.m, null, t)
345 | }
346 | function E(t, e, i) {
347 | t.multiplyTo(e, i),
348 | this.reduce(i)
349 | }
350 | function M(t, e) {
351 | t.squareTo(e),
352 | this.reduce(e)
353 | }
354 | function N() {
355 | if (this.t < 1)
356 | return 0;
357 | var t = this[0];
358 | if (0 == (1 & t))
359 | return 0;
360 | var e = 3 & t;
361 | return e = e * (2 - (15 & t) * e) & 15,
362 | e = e * (2 - (255 & t) * e) & 255,
363 | e = e * (2 - ((65535 & t) * e & 65535)) & 65535,
364 | e = e * (2 - t * e % this.DV) % this.DV,
365 | e > 0 ? this.DV - e : -e
366 | }
367 | function O(t) {
368 | this.m = t,
369 | this.mp = t.invDigit(),
370 | this.mpl = 32767 & this.mp,
371 | this.mph = this.mp >> 15,
372 | this.um = (1 << t.DB - 15) - 1,
373 | this.mt2 = 2 * t.t
374 | }
375 | function B(t) {
376 | var e = y();
377 | return t.abs().dlShiftTo(this.m.t, e),
378 | e.divRemTo(this.m, null, e),
379 | t.s < 0 && e.compareTo(b.ZERO) > 0 && this.m.subTo(e, e),
380 | e
381 | }
382 | function j(t) {
383 | var e = y();
384 | return t.copyTo(e),
385 | this.reduce(e),
386 | e
387 | }
388 | function L(t) {
389 | for (; t.t <= this.mt2; )
390 | t[t.t++] = 0;
391 | for (var e = 0; e < this.m.t; ++e) {
392 | var i = 32767 & t[e],
393 | s = i * this.mpl + ((i * this.mph + (t[e] >> 15) * this.mpl & this.um) << 15) & t.DM;
394 | for (i = e + this.m.t, t[i] += this.m.am(0, s, t, e, 0, this.m.t); t[i] >= t.DV; )
395 | t[i] -= t.DV,
396 | t[++i]++
397 | }
398 | t.clamp(),
399 | t.drShiftTo(this.m.t, t),
400 | t.compareTo(this.m) >= 0 && t.subTo(this.m, t)
401 | }
402 | function F(t, e) {
403 | t.squareTo(e),
404 | this.reduce(e)
405 | }
406 | function K(t, e, i) {
407 | t.multiplyTo(e, i),
408 | this.reduce(i)
409 | }
410 | function U() {
411 | return 0 == (this.t > 0 ? 1 & this[0] : this.s)
412 | }
413 | function V(t, e) {
414 | if (t > 4294967295 || 1 > t)
415 | return b.ONE;
416 | var i = y(),
417 | s = y(),
418 | n = e.convert(this),
419 | r = w(t) - 1;
420 | for (n.copyTo(i); --r >= 0; )
421 | if (e.sqrTo(i, s), (t & 1 << r) > 0)
422 | e.mulTo(s, n, i);
423 | else {
424 | var o = i;
425 | i = s,
426 | s = o
427 | }
428 | return e.revert(i)
429 | };
430 | function z(t, e) {
431 | var i;
432 | return i = 256 > t || e.isEven() ? new $(e) : new O(e),
433 | this.exp(t, i)
434 | }
435 | function q() {
436 | var t = y();
437 | return this.copyTo(t),
438 | t
439 | }
440 | function H() {
441 | if (this.s < 0) {
442 | if (1 == this.t)
443 | return this[0] - this.DV;
444 | if (0 == this.t)
445 | return - 1
446 | } else {
447 | if (1 == this.t)
448 | return this[0];
449 | if (0 == this.t)
450 | return 0
451 | }
452 | return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0]
453 | }
454 | function J() {
455 | return 0 == this.t ? this.s : this[0] << 24 >> 24
456 | }
457 | function G() {
458 | return 0 == this.t ? this.s : this[0] << 16 >> 16
459 | }
460 | function Y(t) {
461 | return Math.floor(Math.LN2 * this.DB / Math.log(t))
462 | }
463 | function W() {
464 | return this.s < 0 ? -1 : this.t <= 0 || 1 == this.t && this[0] <= 0 ? 0 : 1
465 | }
466 | function Z(t) {
467 | if (null == t && (t = 10), 0 == this.signum() || 2 > t || t > 36)
468 | return "0";
469 | var e = this.chunkSize(t),
470 | i = Math.pow(t, e),
471 | s = m(i),
472 | n = y(),
473 | r = y(),
474 | o = "";
475 | for (this.divRemTo(s, n, r); n.signum() > 0; )
476 | o = (i + r.intValue()).toString(t).substr(1) + o,
477 | n.divRemTo(s, n, r);
478 | return r.intValue().toString(t) + o
479 | }
480 | function Q(t, e) {
481 | this.fromInt(0),
482 | null == e && (e = 10);
483 | for (var i = this.chunkSize(e), s = Math.pow(e, i), n = !1, r = 0, o = 0, a = 0; a < t.length; ++a) {
484 | var c = l(t, a);
485 | 0 > c ? "-" == t.charAt(a) && 0 == this.signum() && (n = !0) : (o = e * o + c, ++r >= i && (this.dMultiply(s), this.dAddOffset(o, 0), r = 0, o = 0))
486 | }
487 | r > 0 && (this.dMultiply(Math.pow(e, r)), this.dAddOffset(o, 0)),
488 | n && b.ZERO.subTo(this, this)
489 | }
490 | function X(t, e, i) {
491 | if ("number" == typeof e)
492 | if (2 > t)
493 | this.fromInt(1);
494 | else
495 | for (this.fromNumber(t, i), this.testBit(t - 1) || this.bitwiseTo(b.ONE.shiftLeft(t - 1), at, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(e); )
496 | this.dAddOffset(2, 0),
497 | this.bitLength() > t && this.subTo(b.ONE.shiftLeft(t - 1), this);
498 | else {
499 | var s = new Array,
500 | n = 7 & t;
501 | s.length = (t >> 3) + 1,
502 | e.nextBytes(s),
503 | n > 0 ? s[0] &= (1 << n) - 1 : s[0] = 0,
504 | this.fromString(s, 256)
505 | }
506 | }
507 | function tt() {
508 | var t = this.t,
509 | e = new Array;
510 | e[0] = this.s;
511 | var i,
512 | s = this.DB - t * this.DB % 8,
513 | n = 0;
514 | if (t-- > 0)
515 | for (s < this.DB && (i = this[t] >> s) != (this.s & this.DM) >> s && (e[n++] = i | this.s << this.DB - s); t >= 0; )
516 | 8 > s ? (i = (this[t] & (1 << s) - 1) << 8 - s, i |= this[--t] >> (s += this.DB - 8)) : (i = this[t] >> (s -= 8) & 255, 0 >= s && (s += this.DB, --t)),
517 | 0 != (128 & i) && (i |= -256),
518 | 0 == n && (128 & this.s) != (128 & i) && ++n,
519 | (n > 0 || i != this.s) && (e[n++] = i);
520 | return e
521 | }
522 | function et(t) {
523 | return 0 == this.compareTo(t)
524 | }
525 | function it(t) {
526 | return this.compareTo(t) < 0 ? this : t
527 | }
528 | function st(t) {
529 | return this.compareTo(t) > 0 ? this : t
530 | }
531 | function nt(t, e, i) {
532 | var s,
533 | n,
534 | r = Math.min(t.t, this.t);
535 | for (s = 0; r > s; ++s)
536 | i[s] = e(this[s], t[s]);
537 | if (t.t < this.t) {
538 | for (n = t.s & this.DM, s = r; s < this.t; ++s)
539 | i[s] = e(this[s], n);
540 | i.t = this.t
541 | } else {
542 | for (n = this.s & this.DM, s = r; s < t.t; ++s)
543 | i[s] = e(n, t[s]);
544 | i.t = t.t
545 | }
546 | i.s = e(this.s, t.s),
547 | i.clamp()
548 | }
549 | function rt(t, e) {
550 | return t & e
551 | }
552 | function ot(t) {
553 | var e = y();
554 | return this.bitwiseTo(t, rt, e),
555 | e
556 | }
557 | function at(t, e) {
558 | return t | e
559 | }
560 | function ct(t) {
561 | var e = y();
562 | return this.bitwiseTo(t, at, e),
563 | e
564 | }
565 | function lt(t, e) {
566 | return t ^ e
567 | }
568 | function ut(t) {
569 | var e = y();
570 | return this.bitwiseTo(t, lt, e),
571 | e
572 | }
573 | function dt(t, e) {
574 | return t & ~e
575 | }
576 | function pt(t) {
577 | var e = y();
578 | return this.bitwiseTo(t, dt, e),
579 | e
580 | }
581 | function ht() {
582 | for (var t = y(), e = 0; e < this.t; ++e)
583 | t[e] = this.DM & ~this[e];
584 | return t.t = this.t,
585 | t.s = ~this.s,
586 | t
587 | }
588 | function ft(t) {
589 | var e = y();
590 | return 0 > t ? this.rShiftTo( - t, e) : this.lShiftTo(t, e),
591 | e
592 | }
593 | function gt(t) {
594 | var e = y();
595 | return 0 > t ? this.lShiftTo( - t, e) : this.rShiftTo(t, e),
596 | e
597 | }
598 | function mt(t) {
599 | if (0 == t)
600 | return - 1;
601 | var e = 0;
602 | return 0 == (65535 & t) && (t >>= 16, e += 16),
603 | 0 == (255 & t) && (t >>= 8, e += 8),
604 | 0 == (15 & t) && (t >>= 4, e += 4),
605 | 0 == (3 & t) && (t >>= 2, e += 2),
606 | 0 == (1 & t) && ++e,
607 | e
608 | }
609 | function vt() {
610 | for (var t = 0; t < this.t; ++t)
611 | if (0 != this[t])
612 | return t * this.DB + mt(this[t]);
613 | return this.s < 0 ? this.t * this.DB : -1
614 | }
615 | function _t(t) {
616 | for (var e = 0; 0 != t; )
617 | t &= t - 1,
618 | ++e;
619 | return e
620 | }
621 | function bt() {
622 | for (var t = 0,
623 | e = this.s & this.DM,
624 | i = 0; i < this.t; ++i)
625 | t += _t(this[i] ^ e);
626 | return t
627 | }
628 | function yt(t) {
629 | var e = Math.floor(t / this.DB);
630 | return e >= this.t ? 0 != this.s : 0 != (this[e] & 1 << t % this.DB)
631 | }
632 | function wt(t, e) {
633 | var i = b.ONE.shiftLeft(t);
634 | return this.bitwiseTo(i, e, i),
635 | i
636 | }
637 | function kt(t) {
638 | return this.changeBit(t, at)
639 | }
640 | function xt(t) {
641 | return this.changeBit(t, dt)
642 | }
643 | function Dt(t) {
644 | return this.changeBit(t, lt)
645 | }
646 | function St(t, e) {
647 | for (var i = 0,
648 | s = 0,
649 | n = Math.min(t.t, this.t); n > i; )
650 | s += this[i] + t[i],
651 | e[i++] = s & this.DM,
652 | s >>= this.DB;
653 | if (t.t < this.t) {
654 | for (s += t.s; i < this.t; )
655 | s += this[i],
656 | e[i++] = s & this.DM,
657 | s >>= this.DB;
658 | s += this.s
659 | } else {
660 | for (s += this.s; i < t.t; )
661 | s += t[i],
662 | e[i++] = s & this.DM,
663 | s >>= this.DB;
664 | s += t.s
665 | }
666 | e.s = 0 > s ? -1 : 0,
667 | s > 0 ? e[i++] = s : -1 > s && (e[i++] = this.DV + s),
668 | e.t = i,
669 | e.clamp()
670 | }
671 | function Ct(t) {
672 | var e = y();
673 | return this.addTo(t, e),
674 | e
675 | }
676 | function Tt(t) {
677 | var e = y();
678 | return this.subTo(t, e),
679 | e
680 | }
681 | function It(t) {
682 | var e = y();
683 | return this.multiplyTo(t, e),
684 | e
685 | }
686 | function $t() {
687 | var t = y();
688 | return this.squareTo(t),
689 | t
690 | }
691 | function Pt(t) {
692 | var e = y();
693 | return this.divRemTo(t, e, null),
694 | e
695 | }
696 | function Rt(t) {
697 | var e = y();
698 | return this.divRemTo(t, null, e),
699 | e
700 | }
701 | function At(t) {
702 | var e = y(),
703 | i = y();
704 | return this.divRemTo(t, e, i),
705 | new Array(e, i)
706 | }
707 | function Et(t) {
708 | this[this.t] = this.am(0, t - 1, this, 0, 0, this.t),
709 | ++this.t,
710 | this.clamp()
711 | }
712 | function Mt(t, e) {
713 | if (0 != t) {
714 | for (; this.t <= e; )
715 | this[this.t++] = 0;
716 | for (this[e] += t; this[e] >= this.DV; )
717 | this[e] -= this.DV,
718 | ++e >= this.t && (this[this.t++] = 0),
719 | ++this[e]
720 | }
721 | }
722 | function Nt() {}
723 | function Ot(t) {
724 | return t
725 | }
726 | function Bt(t, e, i) {
727 | t.multiplyTo(e, i)
728 | }
729 | function jt(t, e) {
730 | t.squareTo(e)
731 | }
732 | function Lt(t) {
733 | return this.exp(t, new Nt)
734 | }
735 | function Ft(t, e, i) {
736 | var s = Math.min(this.t + t.t, e);
737 | for (i.s = 0, i.t = s; s > 0; )
738 | i[--s] = 0;
739 | var n;
740 | for (n = i.t - this.t; n > s; ++s)
741 | i[s + this.t] = this.am(0, t[s], i, s, 0, this.t);
742 | for (n = Math.min(t.t, e); n > s; ++s)
743 | this.am(0, t[s], i, s, 0, e - s);
744 | i.clamp()
745 | }
746 | function Kt(t, e, i) {
747 | --e;
748 | var s = i.t = this.t + t.t - e;
749 | for (i.s = 0; --s >= 0; )
750 | i[s] = 0;
751 | for (s = Math.max(e - this.t, 0); s < t.t; ++s)
752 | i[this.t + s - e] = this.am(e - s, t[s], i, 0, 0, this.t + s - e);
753 | i.clamp(),
754 | i.drShiftTo(1, i)
755 | }
756 | function Ut(t) {
757 | this.r2 = y(),
758 | this.q3 = y(),
759 | b.ONE.dlShiftTo(2 * t.t, this.r2),
760 | this.mu = this.r2.divide(t),
761 | this.m = t
762 | }
763 | function Vt(t) {
764 | if (t.s < 0 || t.t > 2 * this.m.t)
765 | return t.mod(this.m);
766 | if (t.compareTo(this.m) < 0)
767 | return t;
768 | var e = y();
769 | return t.copyTo(e),
770 | this.reduce(e),
771 | e
772 | }
773 | function zt(t) {
774 | return t
775 | }
776 | function qt(t) {
777 | for (t.drShiftTo(this.m.t - 1, this.r2), t.t > this.m.t + 1 && (t.t = this.m.t + 1, t.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); t.compareTo(this.r2) < 0; )
778 | t.dAddOffset(1, this.m.t + 1);
779 | for (t.subTo(this.r2, t); t.compareTo(this.m) >= 0; )
780 | t.subTo(this.m, t)
781 | }
782 | function Ht(t, e) {
783 | t.squareTo(e),
784 | this.reduce(e)
785 | }
786 | function Jt(t, e, i) {
787 | t.multiplyTo(e, i),
788 | this.reduce(i)
789 | }
790 | function Gt(t, e) {
791 | var i,
792 | s,
793 | n = t.bitLength(),
794 | r = m(1);
795 | if (0 >= n)
796 | return r;
797 | i = 18 > n ? 1 : 48 > n ? 3 : 144 > n ? 4 : 768 > n ? 5 : 6,
798 | s = 8 > n ? new $(e) : e.isEven() ? new Ut(e) : new O(e);
799 | var o = new Array,
800 | a = 3,
801 | c = i - 1,
802 | l = (1 << i) - 1;
803 | if (o[1] = s.convert(this), i > 1) {
804 | var u = y();
805 | for (s.sqrTo(o[1], u); l >= a; )
806 | o[a] = y(),
807 | s.mulTo(u, o[a - 2], o[a]),
808 | a += 2
809 | }
810 | var d,
811 | p,
812 | h = t.t - 1,
813 | f = !0,
814 | g = y();
815 | for (n = w(t[h]) - 1; h >= 0; ) {
816 | for (n >= c ? d = t[h] >> n - c & l : (d = (t[h] & (1 << n + 1) - 1) << c - n, h > 0 && (d |= t[h - 1] >> this.DB + n - c)), a = i; 0 == (1 & d); )
817 | d >>= 1,
818 | --a;
819 | if ((n -= a) < 0 && (n += this.DB, --h), f)
820 | o[d].copyTo(r),
821 | f = !1;
822 | else {
823 | for (; a > 1; )
824 | s.sqrTo(r, g),
825 | s.sqrTo(g, r),
826 | a -= 2;
827 | a > 0 ? s.sqrTo(r, g) : (p = r, r = g, g = p),
828 | s.mulTo(g, o[d], r)
829 | }
830 | for (; h >= 0 && 0 == (t[h] & 1 << n); )
831 | s.sqrTo(r, g),
832 | p = r,
833 | r = g,
834 | g = p,
835 | --n < 0 && (n = this.DB - 1, --h)
836 | }
837 | return s.revert(r)
838 | }
839 | function Yt(t) {
840 | var e = this.s < 0 ? this.negate() : this.clone(),
841 | i = t.s < 0 ? t.negate() : t.clone();
842 | if (e.compareTo(i) < 0) {
843 | var s = e;
844 | e = i,
845 | i = s
846 | }
847 | var n = e.getLowestSetBit(),
848 | r = i.getLowestSetBit();
849 | if (0 > r)
850 | return e;
851 | for (r > n && (r = n), r > 0 && (e.rShiftTo(r, e), i.rShiftTo(r, i)); e.signum() > 0; )
852 | (n = e.getLowestSetBit()) > 0 && e.rShiftTo(n, e),
853 | (n = i.getLowestSetBit()) > 0 && i.rShiftTo(n, i),
854 | e.compareTo(i) >= 0 ? (e.subTo(i, e), e.rShiftTo(1, e)) : (i.subTo(e, i), i.rShiftTo(1, i));
855 | return r > 0 && i.lShiftTo(r, i),
856 | i
857 | }
858 | function Wt(t) {
859 | if (0 >= t)
860 | return 0;
861 | var e = this.DV % t,
862 | i = this.s < 0 ? t - 1 : 0;
863 | if (this.t > 0)
864 | if (0 == e)
865 | i = this[0] % t;
866 | else
867 | for (var s = this.t - 1; s >= 0; --s)
868 | i = (e * i + this[s]) % t;
869 | return i
870 | }
871 | function Zt(t) {
872 | var e = t.isEven();
873 | if (this.isEven() && e || 0 == t.signum())
874 | return b.ZERO;
875 | for (var i = t.clone(), s = this.clone(), n = m(1), r = m(0), o = m(0), a = m(1); 0 != i.signum(); ) {
876 | for (; i.isEven(); )
877 | i.rShiftTo(1, i),
878 | e ? (n.isEven() && r.isEven() || (n.addTo(this, n), r.subTo(t, r)), n.rShiftTo(1, n)) : r.isEven() || r.subTo(t, r),
879 | r.rShiftTo(1, r);
880 | for (; s.isEven(); )
881 | s.rShiftTo(1, s),
882 | e ? (o.isEven() && a.isEven() || (o.addTo(this, o), a.subTo(t, a)), o.rShiftTo(1, o)) : a.isEven() || a.subTo(t, a),
883 | a.rShiftTo(1, a);
884 | i.compareTo(s) >= 0 ? (i.subTo(s, i), e && n.subTo(o, n), r.subTo(a, r)) : (s.subTo(i, s), e && o.subTo(n, o), a.subTo(r, a))
885 | }
886 | return 0 != s.compareTo(b.ONE) ? b.ZERO : a.compareTo(t) >= 0 ? a.subtract(t) : a.signum() < 0 ? (a.addTo(t, a), a.signum() < 0 ? a.add(t) : a) : a
887 | }
888 | function Qt(t) {
889 | var e,
890 | i = this.abs();
891 | if (1 == i.t && i[0] <= $e[$e.length - 1]) {
892 | for (e = 0; e < $e.length; ++e)
893 | if (i[0] == $e[e])
894 | return !0;
895 | return !1
896 | }
897 | if (i.isEven())
898 | return !1;
899 | for (e = 1; e < $e.length; ) {
900 | for (var s = $e[e], n = e + 1; n < $e.length && Pe > s; )
901 | s *= $e[n++];
902 | for (s = i.modInt(s); n > e; )
903 | if (s % $e[e++] == 0)
904 | return !1
905 | }
906 | return i.millerRabin(t)
907 | }
908 | function Xt(t) {
909 | var e = this.subtract(b.ONE),
910 | i = e.getLowestSetBit();
911 | if (0 >= i)
912 | return !1;
913 | var s = e.shiftRight(i);
914 | t = t + 1 >> 1,
915 | t > $e.length && (t = $e.length);
916 | for (var n = y(), r = 0; t > r; ++r) {
917 | var o = n.modPow(s, this);
918 | if (0 != o.compareTo(b.ONE) && 0 != o.compareTo(e)) {
919 | for (var a = 1; a++ < i && 0 != o.compareTo(e); )
920 | if (o = o.modPowInt(2, this), 0 == o.compareTo(b.ONE))
921 | return !1;
922 | if (0 != o.compareTo(e))
923 | return !1
924 | }
925 | }
926 | return !0
927 | }
928 | function te() {
929 | this.i = 0,
930 | this.j = 0,
931 | this.S = new Array
932 | }
933 | function ee(t) {
934 | var e,
935 | i,
936 | s;
937 | for (e = 0; 256 > e; ++e)
938 | this.S[e] = e;
939 | for (i = 0, e = 0; 256 > e; ++e)
940 | i = i + this.S[e] + t[e % t.length] & 255,
941 | s = this.S[e],
942 | this.S[e] = this.S[i],
943 | this.S[i] = s;
944 | this.i = 0,
945 | this.j = 0
946 | }
947 | function ie() {
948 | var t;
949 | return this.i = this.i + 1 & 255,
950 | this.j = this.j + this.S[this.i] & 255,
951 | t = this.S[this.i],
952 | this.S[this.i] = this.S[this.j],
953 | this.S[this.j] = t,
954 | this.S[t + this.S[this.i] & 255]
955 | }
956 | function se() {
957 | return new te
958 | }
959 | function ne() {
960 | if (null == Re) {
961 | for (Re = se(); Me > Ee; ) {
962 | Ae[Ee++] = 255 & t
963 | }
964 | for (Re.init(Ae), Ee = 0; Ee < Ae.length; ++Ee)
965 | Ae[Ee] = 0;
966 | Ee = 0
967 | }
968 | return Re.next()
969 | }
970 | function re(t) {
971 | var e;
972 | for (e = 0; e < t.length; ++e)
973 | t[e] = ne()
974 | }
975 | function oe() {}
976 | function ae(t, e) {
977 | return new b(t, e)
978 | }
979 | function ce(t, e) {
980 | if (e < t.length + 11)
981 | return console.error("Message too long for RSA"),
982 | null;
983 | for (var i = new Array,
984 | s = t.length - 1; s >= 0 && e > 0; ) {
985 | var n = t.charCodeAt(s--);
986 | 128 > n ? i[--e] = n : n > 127 && 2048 > n ? (i[--e] = 63 & n | 128, i[--e] = n >> 6 | 192) : (i[--e] = 63 & n | 128, i[--e] = n >> 6 & 63 | 128, i[--e] = n >> 12 | 224)
987 | }
988 | i[--e] = 0;
989 | for (var r = new oe,
990 | o = new Array; e > 2; ) {
991 | for (o[0] = 0; 0 == o[0]; )
992 | r.nextBytes(o);
993 | i[--e] = o[0]
994 | }
995 | return i[--e] = 2,
996 | i[--e] = 0,
997 | new b(i)
998 | }
999 | function le() {
1000 | this.n = null,
1001 | this.e = 0,
1002 | this.d = null,
1003 | this.p = null,
1004 | this.q = null,
1005 | this.dmp1 = null,
1006 | this.dmq1 = null,
1007 | this.coeff = null
1008 | }
1009 | function ue(t, e) {
1010 | null != t && null != e && t.length > 0 && e.length > 0 ? (this.n = ae(t, 16), this.e = parseInt(e, 16)) : console.error("Invalid RSA public key")
1011 | }
1012 | function de(t) {
1013 | return t.modPowInt(this.e, this.n)
1014 | }
1015 | function pe(t) {
1016 | var e = ce(t, this.n.bitLength() + 7 >> 3);
1017 | if (null == e)
1018 | return null;
1019 | var i = this.doPublic(e);
1020 | if (null == i)
1021 | return null;
1022 | var s = i.toString(16);
1023 | return 0 == (1 & s.length) ? s : "0" + s
1024 | }
1025 | function he(t, e) {
1026 | for (var i = t.toByteArray(), s = 0; s < i.length && 0 == i[s]; )
1027 | ++s;
1028 | if (i.length - s != e - 1 || 2 != i[s])
1029 | return null;
1030 | for (++s; 0 != i[s]; )
1031 | if (++s >= i.length)
1032 | return null;
1033 | for (var n = ""; ++s < i.length; ) {
1034 | var r = 255 & i[s];
1035 | 128 > r ? n += String.fromCharCode(r) : r > 191 && 224 > r ? (n += String.fromCharCode((31 & r) << 6 | 63 & i[s + 1]), ++s) : (n += String.fromCharCode((15 & r) << 12 | (63 & i[s + 1]) << 6 | 63 & i[s + 2]), s += 2)
1036 | }
1037 | return n
1038 | }
1039 | function fe(t, e, i) {
1040 | null != t && null != e && t.length > 0 && e.length > 0 ? (this.n = ae(t, 16), this.e = parseInt(e, 16), this.d = ae(i, 16)) : console.error("Invalid RSA private key")
1041 | }
1042 | function ge(t, e, i, s, n, r, o, a) {
1043 | null != t && null != e && t.length > 0 && e.length > 0 ? (this.n = ae(t, 16), this.e = parseInt(e, 16), this.d = ae(i, 16), this.p = ae(s, 16), this.q = ae(n, 16), this.dmp1 = ae(r, 16), this.dmq1 = ae(o, 16), this.coeff = ae(a, 16)) : console.error("Invalid RSA private key")
1044 | }
1045 | function me(t, e) {
1046 | var i = new oe,
1047 | s = t >> 1;
1048 | this.e = parseInt(e, 16);
1049 | for (var n = new b(e, 16); ; ) {
1050 | for (; this.p = new b(t - s, 1, i), 0 != this.p.subtract(b.ONE).gcd(n).compareTo(b.ONE) || !this.p.isProbablePrime(10); );
1051 | for (; this.q = new b(s, 1, i), 0 != this.q.subtract(b.ONE).gcd(n).compareTo(b.ONE) || !this.q.isProbablePrime(10); );
1052 | if (this.p.compareTo(this.q) <= 0) {
1053 | var r = this.p;
1054 | this.p = this.q,
1055 | this.q = r
1056 | }
1057 | var o = this.p.subtract(b.ONE),
1058 | a = this.q.subtract(b.ONE),
1059 | c = o.multiply(a);
1060 | if (0 == c.gcd(n).compareTo(b.ONE)) {
1061 | this.n = this.p.multiply(this.q),
1062 | this.d = n.modInverse(c),
1063 | this.dmp1 = this.d.mod(o),
1064 | this.dmq1 = this.d.mod(a),
1065 | this.coeff = this.q.modInverse(this.p);
1066 | break
1067 | }
1068 | }
1069 | }
1070 | function ve(t) {
1071 | if (null == this.p || null == this.q)
1072 | return t.modPow(this.d, this.n);
1073 | 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; )
1074 | e = e.add(this.p);
1075 | return e.subtract(i).multiply(this.coeff).mod(this.p).multiply(this.q).add(i)
1076 | }
1077 | function _e(t) {
1078 | var e = ae(t, 16),
1079 | i = this.doPrivate(e);
1080 | return null == i ? null : he(i, this.n.bitLength() + 7 >> 3)
1081 | }
1082 | function be(t) {
1083 | var e,
1084 | i,
1085 | s = "";
1086 | for (e = 0; e + 3 <= t.length; e += 3)
1087 | i = parseInt(t.substring(e, e + 3), 16),
1088 | s += je.charAt(i >> 6) + je.charAt(63 & i);
1089 | for (e + 1 == t.length ? (i = parseInt(t.substring(e, e + 1), 16), s += je.charAt(i << 2)) : e + 2 == t.length && (i = parseInt(t.substring(e, e + 2), 16), s += je.charAt(i >> 2) + je.charAt((3 & i) << 4)); (3 & s.length) > 0; )
1090 | s += Le;
1091 | return s
1092 | }
1093 | function ye(t) {
1094 | var e,
1095 | i,
1096 | s = "",
1097 | n = 0;
1098 | for (e = 0; e < t.length && t.charAt(e) != Le; ++e)
1099 | v = je.indexOf(t.charAt(e)),
1100 | v < 0 || (0 == n ? (s += c(v >> 2), i = 3 & v, n = 1) : 1 == n ? (s += c(i << 2 | v >> 4), i = 15 & v, n = 2) : 2 == n ? (s += c(i), s += c(v >> 2), i = 3 & v, n = 3) : (s += c(i << 2 | v >> 4), s += c(15 & v), n = 0));
1101 | return 1 == n && (s += c(i << 2)),
1102 | s
1103 | }
1104 | try {
1105 | var we,
1106 | ke,
1107 | xe = false;
1108 | xe && "Microsoft Internet Explorer" == navigator.appName ? (b.prototype.am = i, we = 26) : xe && "Netscape" != navigator.appName ? (b.prototype.am = e, we = 26) : (b.prototype.am = s, we = 28),
1109 | b.prototype.DB = we,
1110 | b.prototype.DM = (1 << we) - 1,
1111 | b.prototype.DV = 1 << we;
1112 | } catch (e) {}
1113 | var De = 52;
1114 | b.prototype.FV = Math.pow(2, De),
1115 | b.prototype.F1 = De - we,
1116 | b.prototype.F2 = 2 * we - De;
1117 | var Se,
1118 | Ce,
1119 | Te = "0123456789abcdefghijklmnopqrstuvwxyz",
1120 | Ie = new Array;
1121 | for (Se = "0".charCodeAt(0), Ce = 0; 9 >= Ce; ++Ce)
1122 | Ie[Se++] = Ce;
1123 | for (Se = "a".charCodeAt(0), Ce = 10; 36 > Ce; ++Ce)
1124 | Ie[Se++] = Ce;
1125 | for (Se = "A".charCodeAt(0), Ce = 10; 36 > Ce; ++Ce)
1126 | Ie[Se++] = Ce;
1127 | $.prototype.convert = P,
1128 | $.prototype.revert = R,
1129 | $.prototype.reduce = A,
1130 | $.prototype.mulTo = E,
1131 | $.prototype.sqrTo = M,
1132 | O.prototype.convert = B,
1133 | O.prototype.revert = j,
1134 | O.prototype.reduce = L,
1135 | O.prototype.mulTo = K,
1136 | O.prototype.sqrTo = F,
1137 | b.prototype.copyTo = p,
1138 | b.prototype.fromInt = n,
1139 | b.prototype.fromString = h,
1140 | b.prototype.clamp = r,
1141 | b.prototype.dlShiftTo = g,
1142 | b.prototype.drShiftTo = _,
1143 | b.prototype.lShiftTo = k,
1144 | b.prototype.rShiftTo = x,
1145 | b.prototype.subTo = D,
1146 | b.prototype.multiplyTo = S,
1147 | b.prototype.squareTo = C,
1148 | b.prototype.divRemTo = T,
1149 | b.prototype.invDigit = N,
1150 | b.prototype.isEven = U,
1151 | b.prototype.exp = V,
1152 | b.prototype.toString = o,
1153 | b.prototype.negate = f,
1154 | b.prototype.abs = a,
1155 | b.prototype.compareTo = u,
1156 | b.prototype.bitLength = d,
1157 | b.prototype.mod = I,
1158 | b.prototype.modPowInt = z,
1159 | b.ZERO = m(0),
1160 | b.ONE = m(1),
1161 | Nt.prototype.convert = Ot,
1162 | Nt.prototype.revert = Ot,
1163 | Nt.prototype.mulTo = Bt,
1164 | Nt.prototype.sqrTo = jt,
1165 | Ut.prototype.convert = Vt,
1166 | Ut.prototype.revert = zt,
1167 | Ut.prototype.reduce = qt,
1168 | Ut.prototype.mulTo = Jt,
1169 | Ut.prototype.sqrTo = Ht;
1170 | 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, null],
1171 | Pe = (1 << 26) / $e[$e.length - 1];
1172 | b.prototype.chunkSize = Y,
1173 | b.prototype.toRadix = Z,
1174 | b.prototype.fromRadix = Q,
1175 | b.prototype.fromNumber = X,
1176 | b.prototype.bitwiseTo = nt,
1177 | b.prototype.changeBit = wt,
1178 | b.prototype.addTo = St,
1179 | b.prototype.dMultiply = Et,
1180 | b.prototype.dAddOffset = Mt,
1181 | b.prototype.multiplyLowerTo = Ft,
1182 | b.prototype.multiplyUpperTo = Kt,
1183 | b.prototype.modInt = Wt,
1184 | b.prototype.millerRabin = Xt,
1185 | b.prototype.clone = q,
1186 | b.prototype.intValue = H,
1187 | b.prototype.byteValue = J,
1188 | b.prototype.shortValue = G,
1189 | b.prototype.signum = W,
1190 | b.prototype.toByteArray = tt,
1191 | b.prototype.equals = et,
1192 | b.prototype.min = it,
1193 | b.prototype.max = st,
1194 | b.prototype.and = ot,
1195 | b.prototype.or = ct,
1196 | b.prototype.xor = ut,
1197 | b.prototype.andNot = pt,
1198 | b.prototype.not = ht,
1199 | b.prototype.shiftLeft = ft,
1200 | b.prototype.shiftRight = gt,
1201 | b.prototype.getLowestSetBit = vt,
1202 | b.prototype.bitCount = bt,
1203 | b.prototype.testBit = yt,
1204 | b.prototype.setBit = kt,
1205 | b.prototype.clearBit = xt,
1206 | b.prototype.flipBit = Dt,
1207 | b.prototype.add = Ct,
1208 | b.prototype.subtract = Tt,
1209 | b.prototype.multiply = It,
1210 | b.prototype.divide = Pt,
1211 | b.prototype.remainder = Rt,
1212 | b.prototype.divideAndRemainder = At,
1213 | b.prototype.modPow = Gt,
1214 | b.prototype.modInverse = Zt,
1215 | b.prototype.pow = Lt,
1216 | b.prototype.gcd = Yt,
1217 | b.prototype.isProbablePrime = Qt,
1218 | b.prototype.square = $t,
1219 | te.prototype.init = ee,
1220 | te.prototype.next = ie;
1221 | var Re,
1222 | Ae,
1223 | Ee,
1224 | Me = 256;
1225 | if (null == Ae) {
1226 | Ae = new Array,
1227 | Ee = 0;
1228 | var Ne;
1229 | var Be = function (t) {
1230 | if (this.count = this.count || 0, this.count >= 256 || Ee >= Me)
1231 | try {
1232 | var e = t.x + t.y;
1233 | Ae[Ee++] = 255 & e,
1234 | this.count += 1
1235 | } catch (y) {}
1236 | };
1237 | window.addEventListener ? window.addEventListener("mousemove", Be, !1) : window.attachEvent && window.attachEvent("onmousemove", Be)
1238 | }
1239 | oe.prototype.nextBytes = re,
1240 | le.prototype.doPublic = de,
1241 | le.prototype.setPublic = ue,
1242 | le.prototype.encrypt = pe,
1243 | le.prototype.doPrivate = ve,
1244 | le.prototype.setPrivate = fe,
1245 | le.prototype.setPrivateEx = ge,
1246 | le.prototype.generate = me,
1247 | le.prototype.decrypt = _e,
1248 | function () {
1249 | var t = function (t, e, n) {
1250 | var r = new oe,
1251 | o = t >> 1;
1252 | this.e = parseInt(e, 16);
1253 | var a = new b(e, 16),
1254 | c = this,
1255 | l = function () {
1256 | var e = function () {
1257 | if (c.p.compareTo(c.q) <= 0) {
1258 | var t = c.p;
1259 | c.p = c.q,
1260 | c.q = t
1261 | }
1262 | var e = c.p.subtract(b.ONE),
1263 | i = c.q.subtract(b.ONE),
1264 | s = e.multiply(i);
1265 | 0 == s.gcd(a).compareTo(b.ONE) ? (c.n = c.p.multiply(c.q), c.d = a.modInverse(s), c.dmp1 = c.d.mod(e), c.dmq1 = c.d.mod(i), c.coeff = c.q.modInverse(c.p), setTimeout(function () {
1266 | n()
1267 | },
1268 | 0)) : setTimeout(l, 0)
1269 | },
1270 | i = function () {
1271 | c.q = y(),
1272 | c.q.fromNumberAsync(o, 1, r,
1273 | function () {
1274 | c.q.subtract(b.ONE).gcda(a,
1275 | function (t) {
1276 | 0 == t.compareTo(b.ONE) && c.q.isProbablePrime(10) ? setTimeout(e, 0) : setTimeout(i, 0)
1277 | })
1278 | })
1279 | },
1280 | s = function () {
1281 | c.p = y(),
1282 | c.p.fromNumberAsync(t - o, 1, r,
1283 | function () {
1284 | c.p.subtract(b.ONE).gcda(a,
1285 | function (t) {
1286 | 0 == t.compareTo(b.ONE) && c.p.isProbablePrime(10) ? setTimeout(i, 0) : setTimeout(s, 0)
1287 | })
1288 | })
1289 | };
1290 | setTimeout(s, 0)
1291 | };
1292 | setTimeout(l, 0)
1293 | };
1294 | le.prototype.generateAsync = t;
1295 | var e = function (t, e) {
1296 | var i = this.s < 0 ? this.negate() : this.clone(),
1297 | s = t.s < 0 ? t.negate() : t.clone();
1298 | if (i.compareTo(s) < 0) {
1299 | var n = i;
1300 | i = s,
1301 | s = n
1302 | }
1303 | var r = i.getLowestSetBit(),
1304 | o = s.getLowestSetBit();
1305 | if (0 > o)
1306 | return void e(i);
1307 | o > r && (o = r),
1308 | o > 0 && (i.rShiftTo(o, i), s.rShiftTo(o, s));
1309 | var a = function () {
1310 | (r = i.getLowestSetBit()) > 0 && i.rShiftTo(r, i),
1311 | (r = s.getLowestSetBit()) > 0 && s.rShiftTo(r, s),
1312 | i.compareTo(s) >= 0 ? (i.subTo(s, i), i.rShiftTo(1, i)) : (s.subTo(i, s), s.rShiftTo(1, s)),
1313 | i.signum() > 0 ? setTimeout(a, 0) : (o > 0 && s.lShiftTo(o, s), setTimeout(function () {
1314 | e(s)
1315 | },
1316 | 0))
1317 | };
1318 | setTimeout(a, 10)
1319 | };
1320 | b.prototype.gcda = e;
1321 | var i = function (t, e, i, s) {
1322 | if ("number" == typeof e)
1323 | if (2 > t)
1324 | this.fromInt(1);
1325 | else {
1326 | this.fromNumber(t, i),
1327 | this.testBit(t - 1) || this.bitwiseTo(b.ONE.shiftLeft(t - 1), at, this),
1328 | this.isEven() && this.dAddOffset(1, 0);
1329 | var n = this,
1330 | r = function () {
1331 | n.dAddOffset(2, 0),
1332 | n.bitLength() > t && n.subTo(b.ONE.shiftLeft(t - 1), n),
1333 | n.isProbablePrime(e) ? setTimeout(function () {
1334 | s()
1335 | },
1336 | 0) : setTimeout(r, 0)
1337 | };
1338 | setTimeout(r, 0)
1339 | }
1340 | else {
1341 | var o = new Array,
1342 | a = 7 & t;
1343 | o.length = (t >> 3) + 1,
1344 | e.nextBytes(o),
1345 | a > 0 ? o[0] &= (1 << a) - 1 : o[0] = 0,
1346 | this.fromString(o, 256)
1347 | }
1348 | };
1349 | b.prototype.fromNumberAsync = i
1350 | }
1351 | ();
1352 | var je = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
1353 | Le = "=",
1354 | Fe = Fe || {};
1355 | Fe.env = Fe.env || {};
1356 | var Ke = Fe,
1357 | Ue = Object.prototype,
1358 | Ve = "[object Function]",
1359 | ze = ["toString", "valueOf"];
1360 | Fe.env.parseUA = function (t) {
1361 | var e,
1362 | i = function (t) {
1363 | var e = 0;
1364 | return parseFloat(t.replace(/\./g,
1365 | function () {
1366 | return 1 == e++ ? "" : "."
1367 | }))
1368 | },
1369 | s = navigator,
1370 | n = {
1371 | ie: 0,
1372 | opera: 0,
1373 | gecko: 0,
1374 | webkit: 0,
1375 | chrome: 0,
1376 | mobile: null,
1377 | air: 0,
1378 | ipad: 0,
1379 | iphone: 0,
1380 | ipod: 0,
1381 | ios: null,
1382 | android: 0,
1383 | webos: 0,
1384 | caja: s && s.cajaVersion,
1385 | secure: !1,
1386 | os: null
1387 | };
1388 | try {
1389 | r = t || navigator && navigator.userAgent,
1390 | o = window && window,
1391 | a = o && o.href;
1392 | } catch (e) {}
1393 | return n.secure = a && 0 === a.toLowerCase().indexOf("https"),
1394 | r && (/windows|win32/i.test(r) ? n.os = "windows" : /macintosh/i.test(r) ? n.os = "macintosh" : /rhino/i.test(r) && (n.os = "rhino"), /KHTML/.test(r) && (n.webkit = 1), e = r.match(/AppleWebKit\/([^\s]*)/), e && e[1] && (n.webkit = i(e[1]), / Mobile\//.test(r) ? (n.mobile = "Apple", e = r.match(/OS ([^\s]*)/), e && e[1] && (e = i(e[1].replace("_", "."))), n.ios = e, n.ipad = n.ipod = n.iphone = 0, e = r.match(/iPad|iPod|iPhone/), e && e[0] && (n[e[0].toLowerCase()] = n.ios)) : (e = r.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/), e && (n.mobile = e[0]), /webOS/.test(r) && (n.mobile = "WebOS", e = r.match(/webOS\/([^\s]*);/), e && e[1] && (n.webos = i(e[1]))), / Android/.test(r) && (n.mobile = "Android", e = r.match(/Android ([^\s]*);/), e && e[1] && (n.android = i(e[1])))), e = r.match(/Chrome\/([^\s]*)/), e && e[1] ? n.chrome = i(e[1]) : (e = r.match(/AdobeAIR\/([^\s]*)/), e && (n.air = e[0]))), n.webkit || (e = r.match(/Opera[\s\/]([^\s]*)/), e && e[1] ? (n.opera = i(e[1]), e = r.match(/Version\/([^\s]*)/), e && e[1] && (n.opera = i(e[1])), e = r.match(/Opera Mini[^;]*/), e && (n.mobile = e[0])) : (e = r.match(/MSIE\s([^;]*)/), e && e[1] ? n.ie = i(e[1]) : (e = r.match(/Gecko\/([^\s]*)/), e && (n.gecko = 1, e = r.match(/rv:([^\s\)]*)/), e && e[1] && (n.gecko = i(e[1]))))))),
1395 | n
1396 | },
1397 | Fe.env.ua = Fe.env.parseUA(),
1398 | Fe.isFunction = function (t) {
1399 | return "function" == typeof t || Ue.toString.apply(t) === Ve
1400 | },
1401 | Fe._IEEnumFix = Fe.env.ua.ie ?
1402 | function (t, e) {
1403 | var i,
1404 | s,
1405 | n;
1406 | for (i = 0; i < ze.length; i += 1)
1407 | s = ze[i],
1408 | n = e[s],
1409 | Ke.isFunction(n) && n != Ue[s] && (t[s] = n)
1410 | }
1411 | : function () {},
1412 | Fe.extend = function (t, e, i) {
1413 | if (!e || !t)
1414 | throw new Error("extend failed, please check that all dependencies are included.");
1415 | var s,
1416 | n = function () {};
1417 | if (n.prototype = e.prototype, t.prototype = new n, t.prototype.constructor = t, t.superclass = e.prototype, e.prototype.constructor == Ue.constructor && (e.prototype.constructor = e), i) {
1418 | for (s in i)
1419 | Ke.hasOwnProperty(i, s) && (t.prototype[s] = i[s]);
1420 | Ke._IEEnumFix(t.prototype, i)
1421 | }
1422 | },
1423 | "undefined" != typeof KJUR && KJUR || (KJUR = {}),
1424 | "undefined" != typeof KJUR.asn1 && KJUR.asn1 || (KJUR.asn1 = {}),
1425 | KJUR.asn1.ASN1Util = new
1426 | function () {
1427 | this.integerToByteHex = function (t) {
1428 | var e = t.toString(16);
1429 | return e.length % 2 == 1 && (e = "0" + e),
1430 | e
1431 | },
1432 | this.bigIntToMinTwosComplementsHex = function (t) {
1433 | var e = t.toString(16);
1434 | if ("-" != e.substr(0, 1))
1435 | e.length % 2 == 1 ? e = "0" + e : e.match(/^[0-7]/) || (e = "00" + e);
1436 | else {
1437 | var i = e.substr(1),
1438 | s = i.length;
1439 | s % 2 == 1 ? s += 1 : e.match(/^[0-7]/) || (s += 2);
1440 | for (var n = "",
1441 | r = 0; s > r; r++)
1442 | n += "f";
1443 | var o = new b(n, 16),
1444 | a = o.xor(t).add(b.ONE);
1445 | e = a.toString(16).replace(/^-/, "")
1446 | }
1447 | return e
1448 | },
1449 | this.getPEMStringFromHex = function (t, e) {
1450 | var i = CryptoJS.enc.Hex.parse(t),
1451 | s = CryptoJS.enc.Base64.stringify(i),
1452 | n = s.replace(/(.{64})/g, "$1\r\n");
1453 | return n = n.replace(/\r\n$/, ""),
1454 | "-----BEGIN " + e + "-----\r\n" + n + "\r\n-----END " + e + "-----\r\n"
1455 | }
1456 | },
1457 | KJUR.asn1.ASN1Object = function () {
1458 | var n = "";
1459 | this.getLengthHexFromValue = function () {
1460 | if ("undefined" == typeof this.hV || null == this.hV)
1461 | throw "this.hV is null or undefined.";
1462 | if (this.hV.length % 2 == 1)
1463 | throw "value hex must be even length: n=" + n.length + ",v=" + this.hV;
1464 | var t = this.hV.length / 2,
1465 | e = t.toString(16);
1466 | if (e.length % 2 == 1 && (e = "0" + e), 128 > t)
1467 | return e;
1468 | var i = e.length / 2;
1469 | if (i > 15)
1470 | throw "ASN.1 length too long to represent by 8x: n = " + t.toString(16);
1471 | var s = 128 + i;
1472 | return s.toString(16) + e
1473 | },
1474 | this.getEncodedHex = function () {
1475 | return (null == this.hTLV || this.isModified) && (this.hV = this.getFreshValueHex(), this.hL = this.getLengthHexFromValue(), this.hTLV = this.hT + this.hL + this.hV, this.isModified = !1),
1476 | this.hTLV
1477 | },
1478 | this.getValueHex = function () {
1479 | return this.getEncodedHex(),
1480 | this.hV
1481 | },
1482 | this.getFreshValueHex = function () {
1483 | return ""
1484 | }
1485 | },
1486 | KJUR.asn1.DERAbstractString = function (t) {
1487 | KJUR.asn1.DERAbstractString.superclass.constructor.call(this);
1488 | this.getString = function () {
1489 | return this.s
1490 | },
1491 | this.setString = function (t) {
1492 | this.hTLV = null,
1493 | this.isModified = !0,
1494 | this.s = t,
1495 | this.hV = stohex(this.s)
1496 | },
1497 | this.setStringHex = function (t) {
1498 | this.hTLV = null,
1499 | this.isModified = !0,
1500 | this.s = null,
1501 | this.hV = t
1502 | },
1503 | this.getFreshValueHex = function () {
1504 | return this.hV
1505 | },
1506 | "undefined" != typeof t && ("undefined" != typeof t.str ? this.setString(t.str) : "undefined" != typeof t.hex && this.setStringHex(t.hex))
1507 | },
1508 | Fe.extend(KJUR.asn1.DERAbstractString, KJUR.asn1.ASN1Object),
1509 | KJUR.asn1.DERAbstractTime = function (t) {
1510 | KJUR.asn1.DERAbstractTime.superclass.constructor.call(this);
1511 | this.localDateToUTC = function (t) {
1512 | utc = t.getTime() + 6e4 * t.getTimezoneOffset();
1513 | var e = new Date(utc);
1514 | return e
1515 | },
1516 | this.formatDate = function (t, e) {
1517 | var i = this.zeroPadding,
1518 | s = this.localDateToUTC(t),
1519 | n = String(s.getFullYear());
1520 | "utc" == e && (n = n.substr(2, 2));
1521 | var r = i(String(s.getMonth() + 1), 2),
1522 | o = i(String(s.getDate()), 2),
1523 | a = i(String(s.getHours()), 2),
1524 | c = i(String(s.getMinutes()), 2),
1525 | l = i(String(s.getSeconds()), 2);
1526 | return n + r + o + a + c + l + "Z"
1527 | },
1528 | this.zeroPadding = function (t, e) {
1529 | return t.length >= e ? t : new Array(e - t.length + 1).join("0") + t
1530 | },
1531 | this.getString = function () {
1532 | return this.s
1533 | },
1534 | this.setString = function (t) {
1535 | this.hTLV = null,
1536 | this.isModified = !0,
1537 | this.s = t,
1538 | this.hV = stohex(this.s)
1539 | },
1540 | this.setByDateValue = function (t, e, i, s, n, r) {
1541 | var o = new Date(Date.UTC(t, e - 1, i, s, n, r, 0));
1542 | this.setByDate(o)
1543 | },
1544 | this.getFreshValueHex = function () {
1545 | return this.hV
1546 | }
1547 | },
1548 | Fe.extend(KJUR.asn1.DERAbstractTime, KJUR.asn1.ASN1Object),
1549 | KJUR.asn1.DERAbstractStructured = function (t) {
1550 | KJUR.asn1.DERAbstractString.superclass.constructor.call(this);
1551 | this.setByASN1ObjectArray = function (t) {
1552 | this.hTLV = null,
1553 | this.isModified = !0,
1554 | this.asn1Array = t
1555 | },
1556 | this.appendASN1Object = function (t) {
1557 | this.hTLV = null,
1558 | this.isModified = !0,
1559 | this.asn1Array.push(t)
1560 | },
1561 | this.asn1Array = new Array,
1562 | "undefined" != typeof t && "undefined" != typeof t.array && (this.asn1Array = t.array)
1563 | },
1564 | Fe.extend(KJUR.asn1.DERAbstractStructured, KJUR.asn1.ASN1Object),
1565 | KJUR.asn1.DERBoolean = function () {
1566 | KJUR.asn1.DERBoolean.superclass.constructor.call(this),
1567 | this.hT = "01",
1568 | this.hTLV = "0101ff"
1569 | },
1570 | Fe.extend(KJUR.asn1.DERBoolean, KJUR.asn1.ASN1Object),
1571 | KJUR.asn1.DERInteger = function (t) {
1572 | KJUR.asn1.DERInteger.superclass.constructor.call(this),
1573 | this.hT = "02",
1574 | this.setByBigInteger = function (t) {
1575 | this.hTLV = null,
1576 | this.isModified = !0,
1577 | this.hV = KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)
1578 | },
1579 | this.setByInteger = function (t) {
1580 | var e = new b(String(t), 10);
1581 | this.setByBigInteger(e)
1582 | },
1583 | this.setValueHex = function (t) {
1584 | this.hV = t
1585 | },
1586 | this.getFreshValueHex = function () {
1587 | return this.hV
1588 | },
1589 | "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))
1590 | },
1591 | Fe.extend(KJUR.asn1.DERInteger, KJUR.asn1.ASN1Object),
1592 | KJUR.asn1.DERBitString = function (t) {
1593 | KJUR.asn1.DERBitString.superclass.constructor.call(this),
1594 | this.hT = "03",
1595 | this.setHexValueIncludingUnusedBits = function (t) {
1596 | this.hTLV = null,
1597 | this.isModified = !0,
1598 | this.hV = t
1599 | },
1600 | this.setUnusedBitsAndHexValue = function (t, e) {
1601 | if (0 > t || t > 7)
1602 | throw "unused bits shall be from 0 to 7: u = " + t;
1603 | var i = "0" + t;
1604 | this.hTLV = null,
1605 | this.isModified = !0,
1606 | this.hV = i + e
1607 | },
1608 | this.setByBinaryString = function (t) {
1609 | t = t.replace(/0+$/, "");
1610 | var e = 8 - t.length % 8;
1611 | 8 == e && (e = 0);
1612 | for (var i = 0; e >= i; i++)
1613 | t += "0";
1614 | for (var s = "",
1615 | i = 0; i < t.length - 1; i += 8) {
1616 | var n = t.substr(i, 8),
1617 | r = parseInt(n, 2).toString(16);
1618 | 1 == r.length && (r = "0" + r),
1619 | s += r
1620 | }
1621 | this.hTLV = null,
1622 | this.isModified = !0,
1623 | this.hV = "0" + e + s
1624 | },
1625 | this.setByBooleanArray = function (t) {
1626 | for (var e = "",
1627 | i = 0; i < t.length; i++)
1628 | e += 1 == t[i] ? "1" : "0";
1629 | this.setByBinaryString(e)
1630 | },
1631 | this.newFalseArray = function (t) {
1632 | for (var e = new Array(t), i = 0; t > i; i++)
1633 | e[i] = !1;
1634 | return e
1635 | },
1636 | this.getFreshValueHex = function () {
1637 | return this.hV
1638 | },
1639 | "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))
1640 | },
1641 | Fe.extend(KJUR.asn1.DERBitString, KJUR.asn1.ASN1Object),
1642 | KJUR.asn1.DEROctetString = function (t) {
1643 | KJUR.asn1.DEROctetString.superclass.constructor.call(this, t),
1644 | this.hT = "04"
1645 | },
1646 | Fe.extend(KJUR.asn1.DEROctetString, KJUR.asn1.DERAbstractString),
1647 | KJUR.asn1.DERNull = function () {
1648 | KJUR.asn1.DERNull.superclass.constructor.call(this),
1649 | this.hT = "05",
1650 | this.hTLV = "0500"
1651 | },
1652 | Fe.extend(KJUR.asn1.DERNull, KJUR.asn1.ASN1Object),
1653 | KJUR.asn1.DERObjectIdentifier = function (t) {
1654 | var c = function (t) {
1655 | var e = t.toString(16);
1656 | return 1 == e.length && (e = "0" + e),
1657 | e
1658 | },
1659 | r = function (t) {
1660 | var e = "",
1661 | i = new b(t, 10),
1662 | s = i.toString(2),
1663 | n = 7 - s.length % 7;
1664 | 7 == n && (n = 0);
1665 | for (var r = "",
1666 | o = 0; n > o; o++)
1667 | r += "0";
1668 | s = r + s;
1669 | for (var o = 0; o < s.length - 1; o += 7) {
1670 | var a = s.substr(o, 7);
1671 | o != s.length - 7 && (a = "1" + a),
1672 | e += c(parseInt(a, 2))
1673 | }
1674 | return e
1675 | };
1676 | KJUR.asn1.DERObjectIdentifier.superclass.constructor.call(this),
1677 | this.hT = "06",
1678 | this.setValueHex = function (t) {
1679 | this.hTLV = null,
1680 | this.isModified = !0,
1681 | this.s = null,
1682 | this.hV = t
1683 | },
1684 | this.setValueOidString = function (t) {
1685 | if (!t.match(/^[0-9.]+$/))
1686 | throw "malformed oid string: " + t;
1687 | var e = "",
1688 | i = t.split("."),
1689 | s = 40 * parseInt(i[0]) + parseInt(i[1]);
1690 | e += c(s),
1691 | i.splice(0, 2);
1692 | for (var n = 0; n < i.length; n++)
1693 | e += r(i[n]);
1694 | this.hTLV = null,
1695 | this.isModified = !0,
1696 | this.s = null,
1697 | this.hV = e
1698 | },
1699 | this.setValueName = function (t) {
1700 | if ("undefined" == typeof KJUR.asn1.x509.OID.name2oidList[t])
1701 | throw "DERObjectIdentifier oidName undefined: " + t;
1702 | var e = KJUR.asn1.x509.OID.name2oidList[t];
1703 | this.setValueOidString(e)
1704 | },
1705 | this.getFreshValueHex = function () {
1706 | return this.hV
1707 | },
1708 | "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))
1709 | },
1710 | Fe.extend(KJUR.asn1.DERObjectIdentifier, KJUR.asn1.ASN1Object),
1711 | KJUR.asn1.DERUTF8String = function (t) {
1712 | KJUR.asn1.DERUTF8String.superclass.constructor.call(this, t),
1713 | this.hT = "0c"
1714 | },
1715 | Fe.extend(KJUR.asn1.DERUTF8String, KJUR.asn1.DERAbstractString),
1716 | KJUR.asn1.DERNumericString = function (t) {
1717 | KJUR.asn1.DERNumericString.superclass.constructor.call(this, t),
1718 | this.hT = "12"
1719 | },
1720 | Fe.extend(KJUR.asn1.DERNumericString, KJUR.asn1.DERAbstractString),
1721 | KJUR.asn1.DERPrintableString = function (t) {
1722 | KJUR.asn1.DERPrintableString.superclass.constructor.call(this, t),
1723 | this.hT = "13"
1724 | },
1725 | Fe.extend(KJUR.asn1.DERPrintableString, KJUR.asn1.DERAbstractString),
1726 | KJUR.asn1.DERTeletexString = function (t) {
1727 | KJUR.asn1.DERTeletexString.superclass.constructor.call(this, t),
1728 | this.hT = "14"
1729 | },
1730 | Fe.extend(KJUR.asn1.DERTeletexString, KJUR.asn1.DERAbstractString),
1731 | KJUR.asn1.DERIA5String = function (t) {
1732 | KJUR.asn1.DERIA5String.superclass.constructor.call(this, t),
1733 | this.hT = "16"
1734 | },
1735 | Fe.extend(KJUR.asn1.DERIA5String, KJUR.asn1.DERAbstractString),
1736 | KJUR.asn1.DERUTCTime = function (t) {
1737 | KJUR.asn1.DERUTCTime.superclass.constructor.call(this, t),
1738 | this.hT = "17",
1739 | this.setByDate = function (t) {
1740 | this.hTLV = null,
1741 | this.isModified = !0,
1742 | this.date = t,
1743 | this.s = this.formatDate(this.date, "utc"),
1744 | this.hV = stohex(this.s)
1745 | },
1746 | "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))
1747 | },
1748 | Fe.extend(KJUR.asn1.DERUTCTime, KJUR.asn1.DERAbstractTime),
1749 | KJUR.asn1.DERGeneralizedTime = function (t) {
1750 | KJUR.asn1.DERGeneralizedTime.superclass.constructor.call(this, t),
1751 | this.hT = "18",
1752 | this.setByDate = function (t) {
1753 | this.hTLV = null,
1754 | this.isModified = !0,
1755 | this.date = t,
1756 | this.s = this.formatDate(this.date, "gen"),
1757 | this.hV = stohex(this.s)
1758 | },
1759 | "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))
1760 | },
1761 | Fe.extend(KJUR.asn1.DERGeneralizedTime, KJUR.asn1.DERAbstractTime),
1762 | KJUR.asn1.DERSequence = function (t) {
1763 | KJUR.asn1.DERSequence.superclass.constructor.call(this, t),
1764 | this.hT = "30",
1765 | this.getFreshValueHex = function () {
1766 | for (var t = "",
1767 | e = 0; e < this.asn1Array.length; e++) {
1768 | var i = this.asn1Array[e];
1769 | t += i.getEncodedHex()
1770 | }
1771 | return this.hV = t,
1772 | this.hV
1773 | }
1774 | },
1775 | Fe.extend(KJUR.asn1.DERSequence, KJUR.asn1.DERAbstractStructured),
1776 | KJUR.asn1.DERSet = function (t) {
1777 | KJUR.asn1.DERSet.superclass.constructor.call(this, t),
1778 | this.hT = "31",
1779 | this.getFreshValueHex = function () {
1780 | for (var t = new Array,
1781 | e = 0; e < this.asn1Array.length; e++) {
1782 | var i = this.asn1Array[e];
1783 | t.push(i.getEncodedHex())
1784 | }
1785 | return t.sort(),
1786 | this.hV = t.join(""),
1787 | this.hV
1788 | }
1789 | },
1790 | Fe.extend(KJUR.asn1.DERSet, KJUR.asn1.DERAbstractStructured),
1791 | KJUR.asn1.DERTaggedObject = function (t) {
1792 | KJUR.asn1.DERTaggedObject.superclass.constructor.call(this),
1793 | this.hT = "a0",
1794 | this.hV = "",
1795 | this.isExplicit = !0,
1796 | this.asn1Object = null,
1797 | this.setASN1Object = function (t, e, i) {
1798 | this.hT = e,
1799 | this.isExplicit = t,
1800 | this.asn1Object = i,
1801 | this.isExplicit ? (this.hV = this.asn1Object.getEncodedHex(), this.hTLV = null, this.isModified = !0) : (this.hV = null, this.hTLV = i.getEncodedHex(), this.hTLV = this.hTLV.replace(/^../, e), this.isModified = !1)
1802 | },
1803 | this.getFreshValueHex = function () {
1804 | return this.hV
1805 | },
1806 | "undefined" != typeof t && ("undefined" != typeof t.tag && (this.hT = t.tag), "undefined" != typeof t.explicit && (this.isExplicit = t.explicit), "undefined" != typeof t.obj && (this.asn1Object = t.obj, this.setASN1Object(this.isExplicit, this.hT, this.asn1Object)))
1807 | },
1808 | Fe.extend(KJUR.asn1.DERTaggedObject, KJUR.asn1.ASN1Object),
1809 | function (c) {
1810 | "use strict";
1811 | var l,
1812 | t = {};
1813 | t.decode = function (t) {
1814 | var e;
1815 | if (l === c) {
1816 | var i = "0123456789ABCDEF",
1817 | s = " \f\n\r ?\u2028\u2029";
1818 | for (l = [], e = 0; 16 > e; ++e)
1819 | l[i.charAt(e)] = e;
1820 | for (i = i.toLowerCase(), e = 10; 16 > e; ++e)
1821 | l[i.charAt(e)] = e;
1822 | for (e = 0; e < s.length; ++e)
1823 | l[s.charAt(e)] = -1
1824 | }
1825 | var n = [],
1826 | r = 0,
1827 | o = 0;
1828 | for (e = 0; e < t.length; ++e) {
1829 | var a = t.charAt(e);
1830 | if ("=" == a)
1831 | break;
1832 | if (a = l[a], -1 != a) {
1833 | if (a === c)
1834 | throw "Illegal character at offset " + e;
1835 | r |= a,
1836 | ++o >= 2 ? (n[n.length] = r, r = 0, o = 0) : r <<= 4
1837 | }
1838 | }
1839 | if (o)
1840 | throw "Hex encoding incomplete: 4 bits missing";
1841 | return n
1842 | },
1843 | window.Hex = t
1844 | }
1845 | (),
1846 | function (c) {
1847 | "use strict";
1848 | var l,
1849 | i = {};
1850 | i.decode = function (t) {
1851 | var e;
1852 | if (l === c) {
1853 | var i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
1854 | s = "= \f\n\r ?\u2028\u2029";
1855 | for (l = [], e = 0; 64 > e; ++e)
1856 | l[i.charAt(e)] = e;
1857 | for (e = 0; e < s.length; ++e)
1858 | l[s.charAt(e)] = -1
1859 | }
1860 | var n = [],
1861 | r = 0,
1862 | o = 0;
1863 | for (e = 0; e < t.length; ++e) {
1864 | var a = t.charAt(e);
1865 | if ("=" == a)
1866 | break;
1867 | if (a = l[a], -1 != a) {
1868 | if (a === c)
1869 | throw "Illegal character at offset " + e;
1870 | r |= a,
1871 | ++o >= 4 ? (n[n.length] = r >> 16, n[n.length] = r >> 8 & 255, n[n.length] = 255 & r, r = 0, o = 0) : r <<= 6
1872 | }
1873 | }
1874 | switch (o) {
1875 | case 1:
1876 | throw "Base64 encoding incomplete: at least 2 bits missing";
1877 | case 2:
1878 | n[n.length] = r >> 10;
1879 | break;
1880 | case 3:
1881 | n[n.length] = r >> 16,
1882 | n[n.length] = r >> 8 & 255
1883 | }
1884 | return n
1885 | },
1886 | i.re = /-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,
1887 | i.unarmor = function (t) {
1888 | var e = i.re.exec(t);
1889 | if (e)
1890 | if (e[1])
1891 | t = e[1];
1892 | else {
1893 | if (!e[2])
1894 | throw "RegExp out of sync";
1895 | t = e[2]
1896 | }
1897 | return i.decode(t)
1898 | },
1899 | window.Base64 = i
1900 | }
1901 | (),
1902 | function (o) {
1903 | "use strict";
1904 | function l(t, e) {
1905 | t instanceof l ? (this.enc = t.enc, this.pos = t.pos) : (this.enc = t, this.pos = e)
1906 | }
1907 | function u(t, e, i, s, n) {
1908 | this.stream = t,
1909 | this.header = e,
1910 | this.length = i,
1911 | this.tag = s,
1912 | this.sub = n
1913 | }
1914 | var r = 100,
1915 | a = "…",
1916 | d = {
1917 | tag: function (t, e) {},
1918 | text: function (t) {}
1919 | };
1920 | l.prototype.get = function (t) {
1921 | if (t === o && (t = this.pos++), t >= this.enc.length)
1922 | throw "Requesting byte offset " + t + " on a stream of length " + this.enc.length;
1923 | return this.enc[t]
1924 | },
1925 | l.prototype.hexDigits = "0123456789ABCDEF",
1926 | l.prototype.hexByte = function (t) {
1927 | return this.hexDigits.charAt(t >> 4 & 15) + this.hexDigits.charAt(15 & t)
1928 | },
1929 | l.prototype.hexDump = function (t, e, i) {
1930 | for (var s = "",
1931 | n = t; e > n; ++n)
1932 | if (s += this.hexByte(this.get(n)), i !== !0)
1933 | switch (15 & n) {
1934 | case 7:
1935 | s += " ";
1936 | break;
1937 | case 15:
1938 | s += "\n";
1939 | break;
1940 | default:
1941 | s += " "
1942 | }
1943 | return s
1944 | },
1945 | l.prototype.parseStringISO = function (t, e) {
1946 | for (var i = "",
1947 | s = t; e > s; ++s)
1948 | i += String.fromCharCode(this.get(s));
1949 | return i
1950 | },
1951 | l.prototype.parseStringUTF = function (t, e) {
1952 | for (var i = "",
1953 | s = t; e > s; ) {
1954 | var n = this.get(s++);
1955 | 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++))
1956 | }
1957 | return i
1958 | },
1959 | l.prototype.parseStringBMP = function (t, e) {
1960 | for (var i = "",
1961 | s = t; e > s; s += 2) {
1962 | var n = this.get(s),
1963 | r = this.get(s + 1);
1964 | i += String.fromCharCode((n << 8) + r)
1965 | }
1966 | return i
1967 | },
1968 | l.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)?)?$/,
1969 | l.prototype.parseTime = function (t, e) {
1970 | var i = this.parseStringISO(t, e),
1971 | s = this.reTime.exec(i);
1972 | return s ? (i = s[1] + "-" + s[2] + "-" + s[3] + " " + s[4], s[5] && (i += ":" + s[5], s[6] && (i += ":" + s[6], s[7] && (i += "." + s[7]))), s[8] && (i += " UTC", "Z" != s[8] && (i += s[8], s[9] && (i += ":" + s[9]))), i) : "Unrecognized time: " + i
1973 | },
1974 | l.prototype.parseInteger = function (t, e) {
1975 | var i = e - t;
1976 | if (i > 4) {
1977 | i <<= 3;
1978 | var s = this.get(t);
1979 | if (0 === s)
1980 | i -= 8;
1981 | else
1982 | for (; 128 > s; )
1983 | s <<= 1,
1984 | --i;
1985 | return "(" + i + " bit)"
1986 | }
1987 | for (var n = 0,
1988 | r = t; e > r; ++r)
1989 | n = n << 8 | this.get(r);
1990 | return n
1991 | },
1992 | l.prototype.parseBitString = function (t, e) {
1993 | var i = this.get(t),
1994 | s = (e - t - 1 << 3) - i,
1995 | n = "(" + s + " bit)";
1996 | if (20 >= s) {
1997 | var r = i;
1998 | n += " ";
1999 | for (var o = e - 1; o > t; --o) {
2000 | for (var a = this.get(o), c = r; 8 > c; ++c)
2001 | n += a >> c & 1 ? "1" : "0";
2002 | r = 0
2003 | }
2004 | }
2005 | return n
2006 | },
2007 | l.prototype.parseOctetString = function (t, e) {
2008 | var i = e - t,
2009 | s = "(" + i + " byte) ";
2010 | i > r && (e = t + r);
2011 | for (var n = t; e > n; ++n)
2012 | s += this.hexByte(this.get(n));
2013 | return i > r && (s += a),
2014 | s
2015 | },
2016 | l.prototype.parseOID = function (t, e) {
2017 | for (var i = "",
2018 | s = 0,
2019 | n = 0,
2020 | r = t; e > r; ++r) {
2021 | var o = this.get(r);
2022 | if (s = s << 7 | 127 & o, n += 7, !(128 & o)) {
2023 | if ("" === i) {
2024 | var a = 80 > s ? 40 > s ? 0 : 1 : 2;
2025 | i = a + "." + (s - 40 * a)
2026 | } else
2027 | i += "." + (n >= 31 ? "bigint" : s);
2028 | s = n = 0
2029 | }
2030 | }
2031 | return i
2032 | },
2033 | u.prototype.typeName = function () {
2034 | if (this.tag === o)
2035 | return "unknown";
2036 | var t = this.tag >> 6,
2037 | e = (this.tag >> 5 & 1, 31 & this.tag);
2038 | switch (t) {
2039 | case 0:
2040 | switch (e) {
2041 | case 0:
2042 | return "EOC";
2043 | case 1:
2044 | return "BOOLEAN";
2045 | case 2:
2046 | return "INTEGER";
2047 | case 3:
2048 | return "BIT_STRING";
2049 | case 4:
2050 | return "OCTET_STRING";
2051 | case 5:
2052 | return "NULL";
2053 | case 6:
2054 | return "OBJECT_IDENTIFIER";
2055 | case 7:
2056 | return "ObjectDescriptor";
2057 | case 8:
2058 | return "EXTERNAL";
2059 | case 9:
2060 | return "REAL";
2061 | case 10:
2062 | return "ENUMERATED";
2063 | case 11:
2064 | return "EMBEDDED_PDV";
2065 | case 12:
2066 | return "UTF8String";
2067 | case 16:
2068 | return "SEQUENCE";
2069 | case 17:
2070 | return "SET";
2071 | case 18:
2072 | return "NumericString";
2073 | case 19:
2074 | return "PrintableString";
2075 | case 20:
2076 | return "TeletexString";
2077 | case 21:
2078 | return "VideotexString";
2079 | case 22:
2080 | return "IA5String";
2081 | case 23:
2082 | return "UTCTime";
2083 | case 24:
2084 | return "GeneralizedTime";
2085 | case 25:
2086 | return "GraphicString";
2087 | case 26:
2088 | return "VisibleString";
2089 | case 27:
2090 | return "GeneralString";
2091 | case 28:
2092 | return "UniversalString";
2093 | case 30:
2094 | return "BMPString";
2095 | default:
2096 | return "Universal_" + e.toString(16)
2097 | }
2098 | case 1:
2099 | return "Application_" + e.toString(16);
2100 | case 2:
2101 | return "[" + e + "]";
2102 | case 3:
2103 | return "Private_" + e.toString(16)
2104 | }
2105 | },
2106 | u.prototype.reSeemsASCII = /^[ -~]+$/,
2107 | u.prototype.content = function () {
2108 | if (this.tag === o)
2109 | return null;
2110 | var t = this.tag >> 6,
2111 | e = 31 & this.tag,
2112 | i = this.posContent(),
2113 | s = Math.abs(this.length);
2114 | if (0 !== t) {
2115 | if (null !== this.sub)
2116 | return "(" + this.sub.length + " elem)";
2117 | var n = this.stream.parseStringISO(i, i + Math.min(s, r));
2118 | return this.reSeemsASCII.test(n) ? n.substring(0, 2 * r) + (n.length > 2 * r ? a : "") : this.stream.parseOctetString(i, i + s)
2119 | }
2120 | switch (e) {
2121 | case 1:
2122 | return 0 === this.stream.get(i) ? "false" : "true";
2123 | case 2:
2124 | return this.stream.parseInteger(i, i + s);
2125 | case 3:
2126 | return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseBitString(i, i + s);
2127 | case 4:
2128 | return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(i, i + s);
2129 | case 6:
2130 | return this.stream.parseOID(i, i + s);
2131 | case 16:
2132 | case 17:
2133 | return "(" + this.sub.length + " elem)";
2134 | case 12:
2135 | return this.stream.parseStringUTF(i, i + s);
2136 | case 18:
2137 | case 19:
2138 | case 20:
2139 | case 21:
2140 | case 22:
2141 | case 26:
2142 | return this.stream.parseStringISO(i, i + s);
2143 | case 30:
2144 | return this.stream.parseStringBMP(i, i + s);
2145 | case 23:
2146 | case 24:
2147 | return this.stream.parseTime(i, i + s)
2148 | }
2149 | return null
2150 | },
2151 | u.prototype.toString = function () {
2152 | return this.typeName() + "@" + this.stream.pos + "[header:" + this.header + ",length:" + this.length + ",sub:" + (null === this.sub ? "null" : this.sub.length) + "]"
2153 | },
2154 | u.prototype.print = function (t) {
2155 | if (t === o && (t = ""), null !== this.sub) {
2156 | t += " ";
2157 | for (var e = 0,
2158 | i = this.sub.length; i > e; ++e)
2159 | this.sub[e].print(t)
2160 | }
2161 | },
2162 | u.prototype.toPrettyString = function (t) {
2163 | t === o && (t = "");
2164 | var e = t + this.typeName() + " @" + this.stream.pos;
2165 | if (this.length >= 0 && (e += "+"), e += this.length, 32 & this.tag ? e += " (constructed)" : 3 != this.tag && 4 != this.tag || null === this.sub || (e += " (encapsulates)"), e += "\n", null !== this.sub) {
2166 | t += " ";
2167 | for (var i = 0,
2168 | s = this.sub.length; s > i; ++i)
2169 | e += this.sub[i].toPrettyString(t)
2170 | }
2171 | return e
2172 | },
2173 | u.prototype.toDOM = function () {
2174 | var t = d.tag("div", "node");
2175 | t.asn1 = this;
2176 | var e = d.tag("div", "head"),
2177 | i = this.typeName().replace(/_/g, " ");
2178 | e.innerHTML = i;
2179 | var s = this.content();
2180 | if (null !== s) {
2181 | s = String(s).replace(/", i += "Length: " + this.header + "+", i += this.length >= 0 ? this.length : -this.length + " (undefined)", 32 & this.tag ? i += "
(constructed)" : 3 != this.tag && 4 != this.tag || null === this.sub || (i += "
(encapsulates)"), null !== s && (i += "
Value:
" + s + "", "object" == typeof oids && 6 == this.tag)) {
2191 | var o = oids[s];
2192 | o && (o.d && (i += "
" + o.d), o.c && (i += "
" + o.c), o.w && (i += "
(warning!)"))
2193 | }
2194 | r.innerHTML = i,
2195 | t.appendChild(r);
2196 | var a = d.tag("div", "sub");
2197 | if (null !== this.sub)
2198 | for (var c = 0,
2199 | l = this.sub.length; l > c; ++c)
2200 | a.appendChild(this.sub[c].toDOM());
2201 | return t.appendChild(a),
2202 | e.onclick = function () {
2203 | t.className = "node collapsed" == t.className ? "node" : "node collapsed"
2204 | },
2205 | t
2206 | },
2207 | u.prototype.posStart = function () {
2208 | return this.stream.pos
2209 | },
2210 | u.prototype.posContent = function () {
2211 | return this.stream.pos + this.header
2212 | },
2213 | u.prototype.posEnd = function () {
2214 | return this.stream.pos + this.header + Math.abs(this.length)
2215 | },
2216 | u.prototype.fakeHover = function (t) {
2217 | this.node.className += " hover",
2218 | t && (this.head.className += " hover")
2219 | },
2220 | u.prototype.fakeOut = function (t) {
2221 | var e = / ?hover/;
2222 | this.node.className = this.node.className.replace(e, ""),
2223 | t && (this.head.className = this.head.className.replace(e, ""))
2224 | },
2225 | u.prototype.toHexDOM_sub = function (t, e, i, s, n) {
2226 | if (!(s >= n)) {
2227 | var r = d.tag("span", e);
2228 | r.appendChild(d.text(i.hexDump(s, n))),
2229 | t.appendChild(r)
2230 | }
2231 | },
2232 | u.prototype.toHexDOM = function (e) {
2233 | var t = d.tag("span", "hex");
2234 | if (e === o && (e = t), this.head.hexNode = t, this.head.onmouseover = function () {
2235 | this.hexNode.className = "hexCurrent"
2236 | },
2237 | this.head.onmouseout = function () {
2238 | this.hexNode.className = "hex"
2239 | },
2240 | t.asn1 = this, t.onmouseover = function () {
2241 | var t = !e.selected;
2242 | t && (e.selected = this.asn1, this.className = "hexCurrent"),
2243 | this.asn1.fakeHover(t)
2244 | },
2245 | t.onmouseout = function () {
2246 | var t = e.selected == this.asn1;
2247 | this.asn1.fakeOut(t),
2248 | t && (e.selected = null, this.className = "hex")
2249 | },
2250 | this.toHexDOM_sub(t, "tag", this.stream, this.posStart(), this.posStart() + 1), this.toHexDOM_sub(t, this.length >= 0 ? "dlen" : "ulen", this.stream, this.posStart() + 1, this.posContent()), null === this.sub)
2251 | t.appendChild(d.text(this.stream.hexDump(this.posContent(), this.posEnd())));
2252 | else if (this.sub.length > 0) {
2253 | var i = this.sub[0],
2254 | s = this.sub[this.sub.length - 1];
2255 | this.toHexDOM_sub(t, "intro", this.stream, this.posContent(), i.posStart());
2256 | for (var n = 0,
2257 | r = this.sub.length; r > n; ++n)
2258 | t.appendChild(this.sub[n].toHexDOM(e));
2259 | this.toHexDOM_sub(t, "outro", this.stream, s.posEnd(), this.posEnd())
2260 | }
2261 | return t
2262 | },
2263 | u.prototype.toHexString = function (t) {
2264 | return this.stream.hexDump(this.posStart(), this.posEnd(), !0)
2265 | },
2266 | u.decodeLength = function (t) {
2267 | var e = t.get(),
2268 | i = 127 & e;
2269 | if (i == e)
2270 | return i;
2271 | if (i > 3)
2272 | throw "Length over 24 bits not supported at position " + (t.pos - 1);
2273 | if (0 === i)
2274 | return - 1;
2275 | e = 0;
2276 | for (var s = 0; i > s; ++s)
2277 | e = e << 8 | t.get();
2278 | return e
2279 | },
2280 | u.hasContent = function (t, e, i) {
2281 | if (32 & t)
2282 | return !0;
2283 | if (3 > t || t > 4)
2284 | return !1;
2285 | var s = new l(i);
2286 | 3 == t && s.get();
2287 | var n = s.get();
2288 | if (n >> 6 & 1)
2289 | return !1;
2290 | try {
2291 | var r = u.decodeLength(s);
2292 | return s.pos - i.pos + r == e
2293 | } catch (p) {
2294 | return !1
2295 | }
2296 | },
2297 | u.decode = function (t) {
2298 | t instanceof l || (t = new l(t, 0));
2299 | var e = new l(t),
2300 | i = t.get(),
2301 | s = u.decodeLength(t),
2302 | n = t.pos - e.pos,
2303 | r = null;
2304 | if (u.hasContent(i, s, t)) {
2305 | var o = t.pos;
2306 | if (3 == i && t.get(), r = [], s >= 0) {
2307 | for (var a = o + s; t.pos < a; )
2308 | r[r.length] = u.decode(t);
2309 | if (t.pos != a)
2310 | throw "Content size is not correct for container starting at offset " + o
2311 | } else
2312 | try {
2313 | for (; ; ) {
2314 | var c = u.decode(t);
2315 | if (0 === c.tag)
2316 | break;
2317 | r[r.length] = c
2318 | }
2319 | s = o - t.pos
2320 | } catch (h) {
2321 | throw "Exception while decoding undefined length content: " + h
2322 | }
2323 | } else
2324 | t.pos += s;
2325 | return new u(e, n, s, i, r)
2326 | },
2327 | u.test = function () {
2328 | for (var t = [{
2329 | value: [39],
2330 | expected: 39
2331 | }, {
2332 | value: [129, 201],
2333 | expected: 201
2334 | }, {
2335 | value: [131, 254, 220, 186],
2336 | expected: 16702650
2337 | }
2338 | ], e = 0, i = t.length; i > e; ++e) {
2339 | var s = new l(t[e].value, 0),
2340 | n = u.decodeLength(s);
2341 | }
2342 | },
2343 | window.ASN1 = u
2344 | }
2345 | (),
2346 | ASN1.prototype.getHexStringValue = function () {
2347 | var t = this.toHexString(),
2348 | e = 2 * this.header,
2349 | i = 2 * this.length;
2350 | return t.substr(e, i)
2351 | },
2352 | le.prototype.parseKey = function (t) {
2353 | try {
2354 | var e = 0,
2355 | i = 0,
2356 | s = /^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/,
2357 | n = s.test(t) ? Hex.decode(t) : Base64.unarmor(t),
2358 | r = ASN1.decode(n);
2359 | if (3 === r.sub.length && (r = r.sub[2].sub[0]), 9 === r.sub.length) {
2360 | e = r.sub[1].getHexStringValue(),
2361 | this.n = ae(e, 16),
2362 | i = r.sub[2].getHexStringValue(),
2363 | this.e = parseInt(i, 16);
2364 | var o = r.sub[3].getHexStringValue();
2365 | this.d = ae(o, 16);
2366 | var a = r.sub[4].getHexStringValue();
2367 | this.p = ae(a, 16);
2368 | var c = r.sub[5].getHexStringValue();
2369 | this.q = ae(c, 16);
2370 | var l = r.sub[6].getHexStringValue();
2371 | this.dmp1 = ae(l, 16);
2372 | var u = r.sub[7].getHexStringValue();
2373 | this.dmq1 = ae(u, 16);
2374 | var d = r.sub[8].getHexStringValue();
2375 | this.coeff = ae(d, 16)
2376 | } else {
2377 | if (2 !== r.sub.length)
2378 | return !1;
2379 | var p = r.sub[1],
2380 | h = p.sub[0];
2381 | e = h.sub[0].getHexStringValue(),
2382 | this.n = ae(e, 16),
2383 | i = h.sub[1].getHexStringValue(),
2384 | this.e = parseInt(i, 16)
2385 | }
2386 | return !0
2387 | } catch (f) {
2388 | return !1
2389 | }
2390 | },
2391 | le.prototype.getPrivateBaseKey = function () {
2392 | var t = {
2393 | array: [new KJUR.asn1.DERInteger({
2394 | "int": 0
2395 | }), new KJUR.asn1.DERInteger({
2396 | bigint: this.n
2397 | }), new KJUR.asn1.DERInteger({
2398 | "int": this.e
2399 | }), new KJUR.asn1.DERInteger({
2400 | bigint: this.d
2401 | }), new KJUR.asn1.DERInteger({
2402 | bigint: this.p
2403 | }), new KJUR.asn1.DERInteger({
2404 | bigint: this.q
2405 | }), new KJUR.asn1.DERInteger({
2406 | bigint: this.dmp1
2407 | }), new KJUR.asn1.DERInteger({
2408 | bigint: this.dmq1
2409 | }), new KJUR.asn1.DERInteger({
2410 | bigint: this.coeff
2411 | })]
2412 | },
2413 | e = new KJUR.asn1.DERSequence(t);
2414 | return e.getEncodedHex()
2415 | },
2416 | le.prototype.getPrivateBaseKeyB64 = function () {
2417 | return be(this.getPrivateBaseKey())
2418 | },
2419 | le.prototype.getPublicBaseKey = function () {
2420 | var t = {
2421 | array: [new KJUR.asn1.DERObjectIdentifier({
2422 | oid: "1.2.840.113549.1.1.1"
2423 | }), new KJUR.asn1.DERNull]
2424 | },
2425 | e = new KJUR.asn1.DERSequence(t);
2426 | t = {
2427 | array: [new KJUR.asn1.DERInteger({
2428 | bigint: this.n
2429 | }), new KJUR.asn1.DERInteger({
2430 | "int": this.e
2431 | })]
2432 | };
2433 | var i = new KJUR.asn1.DERSequence(t);
2434 | t = {
2435 | hex: "00" + i.getEncodedHex()
2436 | };
2437 | var s = new KJUR.asn1.DERBitString(t);
2438 | t = {
2439 | array: [e, s]
2440 | };
2441 | var n = new KJUR.asn1.DERSequence(t);
2442 | return n.getEncodedHex()
2443 | },
2444 | le.prototype.getPublicBaseKeyB64 = function () {
2445 | return be(this.getPublicBaseKey())
2446 | },
2447 | le.prototype.wordwrap = function (t, e) {
2448 | if (e = e || 64, !t)
2449 | return t;
2450 | var i = "(.{1," + e + "})( +|$\n?)|(.{1," + e + "})";
2451 | return t.match(RegExp(i, "g")).join("\n")
2452 | },
2453 | le.prototype.getPrivateKey = function () {
2454 | var t = "-----BEGIN RSA PRIVATE KEY-----\n";
2455 | return t += this.wordwrap(this.getPrivateBaseKeyB64()) + "\n",
2456 | t += "-----END RSA PRIVATE KEY-----"
2457 | },
2458 | le.prototype.getPublicKey = function () {
2459 | var t = "-----BEGIN PUBLIC KEY-----\n";
2460 | return t += this.wordwrap(this.getPublicBaseKeyB64()) + "\n",
2461 | t += "-----END PUBLIC KEY-----"
2462 | },
2463 | le.prototype.hasPublicKeyProperty = function (t) {
2464 | return t = t || {},
2465 | t.hasOwnProperty("n") && t.hasOwnProperty("e")
2466 | },
2467 | le.prototype.hasPrivateKeyProperty = function (t) {
2468 | return t = t || {},
2469 | t.hasOwnProperty("n") && t.hasOwnProperty("e") && t.hasOwnProperty("d") && t.hasOwnProperty("p") && t.hasOwnProperty("q") && t.hasOwnProperty("dmp1") && t.hasOwnProperty("dmq1") && t.hasOwnProperty("coeff")
2470 | },
2471 | le.prototype.parsePropertiesFrom = function (t) {
2472 | this.n = t.n,
2473 | this.e = t.e,
2474 | t.hasOwnProperty("d") && (this.d = t.d, this.p = t.p, this.q = t.q, this.dmp1 = t.dmp1, this.dmq1 = t.dmq1, this.coeff = t.coeff)
2475 | };
2476 | var qe = function (t) {
2477 | le.call(this),
2478 | t && ("string" == typeof t ? this.parseKey(t) : (this.hasPrivateKeyProperty(t) || this.hasPublicKeyProperty(t)) && this.parsePropertiesFrom(t))
2479 | };
2480 | (qe.prototype = new le).constructor = qe;
2481 | var He = function (t) {
2482 | t = t || {},
2483 | this.default_key_size = parseInt(t.default_key_size) || 1024,
2484 | this.default_public_exponent = t.default_public_exponent || "010001",
2485 | this.log = t.log || !1,
2486 | this.key = null
2487 | };
2488 | He.prototype.setKey = function (t) {
2489 | this.log && this.key && console.warn("A key was already set, overriding existing."),
2490 | this.key = new qe(t)
2491 | },
2492 | He.prototype.setPrivateKey = function (t) {
2493 | this.setKey(t)
2494 | },
2495 | He.prototype.setPublicKey = function (t) {
2496 | this.setKey(t)
2497 | },
2498 | He.prototype.decrypt = function (t) {
2499 | try {
2500 | return this.getKey().decrypt(ye(t))
2501 | } catch (b) {
2502 | return !1
2503 | }
2504 | },
2505 | He.prototype.encrypt = function (t) {
2506 | try {
2507 | return be(this.getKey().encrypt(t))
2508 | } catch (b) {
2509 | return !1
2510 | }
2511 | },
2512 | He.prototype.getKey = function (t) {
2513 | if (!this.key) {
2514 | if (this.key = new qe, t && "[object Function]" === {}
2515 | .toString.call(t))
2516 | return void this.key.generateAsync(this.default_key_size, this.default_public_exponent, t);
2517 | this.key.generate(this.default_key_size, this.default_public_exponent)
2518 | }
2519 | return this.key
2520 | },
2521 | He.prototype.getPrivateKey = function () {
2522 | return this.getKey().getPrivateKey()
2523 | },
2524 | He.prototype.getPrivateKeyB64 = function () {
2525 | return this.getKey().getPrivateBaseKeyB64()
2526 | },
2527 | He.prototype.getPublicKey = function () {
2528 | return this.getKey().getPublicKey()
2529 | },
2530 | He.prototype.getPublicKeyB64 = function () {
2531 | return this.getKey().getPublicBaseKeyB64()
2532 | },
2533 | He.version = "2.3.1",
2534 | t.JSEncrypt = He
2535 | }) ? s.apply(e, n) : s) === undefined || (i.exports = r)
2536 | }
2537 | .call(e, i, e, t)) === undefined || (t.exports = r)
2538 | },
2539 | jsencrypt: function (t, e, r) {
2540 | var i;
2541 | (i = function (t, e, i) {
2542 | var s = r("encrypt");
2543 | function n() {
2544 | void 0 !== s && (this.jsencrypt = new s.JSEncrypt, this.jsencrypt.setPublicKey("-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDq04c6My441Gj0UFKgrqUhAUg+kQZeUeWSPlAU9fr4HBPDldAeqzx1UR92KJHuQh/zs1HOamE2dgX9z/2oXcJaqoRIA/FXysx+z2YlJkSk8XQLcQ8EBOkp//MZrixam7lCYpNOjadQBb2Ot0U/Ky+jF2p+Ie8gSZ7/u+Wnr5grywIDAQAB-----END PUBLIC KEY-----"))
2545 | }
2546 | n.prototype.encode = function (t, e) {
2547 | var i = e ? e + "|" + t : t;
2548 | return encodeURIComponent(this.jsencrypt.encrypt(i))
2549 | },
2550 | i.exports = n
2551 | }
2552 | .call(e, r, e, t)) === undefined || (t.exports = i)
2553 | }
2554 | });
2555 | function z(pwd, time) {
2556 | var n = _n("jsencrypt");
2557 | var g = (new n);
2558 | var r = g.encode(pwd, time);
2559 | var answer_arr = [r,pwd]
2560 | return answer_arr;
2561 | }
2562 | function get_cipher(timestamp, window_o) {
2563 | return z(timestamp, window_o);
2564 | }
--------------------------------------------------------------------------------