網址:http://www.aqistudy.cn/historydata/monthdata.php?city=北京

反爬手段

  1. F12檢測:用ctrl+shift+i,然後將開發者工具彈出 Untitled
  2. 無限Debugger:用油猴注入以下hook腳本
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    // ==UserScript==
    // @name debugger
    // @namespace http://www.aqistudy.cn/historydata/monthdata.php?city=%E5%8C%97%E4%BA%AC
    // @version 0.1
    // @description try to take over the world!
    // @author You
    // @match http://www.aqistudy.cn/historydata/monthdata.php?city=%E5%8C%97%E4%BA%AC
    // @icon https://www.google.com/s2/favicons?sz=64&domain=aqistudy.cn
    // @grant none
    // @run-at document-start
    // ==/UserScript==

    (function() {
    'use strict';

    var _constructor = constructor;

    Function.prototype.constructor=function(s) {
    if(s=="debugger")return function(){};
    return _constructor(s);
    }
    })();

分析過程

尋找關鍵點

  • 一開始在Network面板抓包時,沒有看到ajax請求( 但後來得知,只有在沒有網站緩存時會發送ajax請求來獲取數據 )
  • 之後查看Sources中的js代碼,也沒有找到想要的東西
  • 最後在網頁源代碼中,看到以下被加密的代碼 Untitled

hook eval函數

  • 接下來就要想辦法查看eval中的內容,我使用的辦法是hook eval這個函數
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    // ==UserScript==
    // @name test
    // @namespace https://ngiokweng.github.io/
    // @version 0.1
    // @description for test
    // @author You
    // @match http://www.aqistudy.cn/historydata/monthdata.php?city=%E5%8C%97%E4%BA%AC
    // @icon https://www.google.com/s2/favicons?sz=64&domain=google.com
    // @grant none
    // @run-at document-start
    // ==/UserScript==

    (function() {
    'use strict';
    // Your code here...
    function hook(object,attr){
    var func = object[attr];
    object[attr] = function(){
    console.log("hooked",object,attr);
    debugger; //在這斷下,方便在調試時通過調用棧找到是誰調用該函數
    var ret = func.apply(object,arguments); //調用原本的那個函數,獲取返回值
    return ret;
    }
    }
    hook(window,'eval');
    })();
  • 找到對應的那個eval函數,單步步入

Untitled

分析eval函數

  • 單步步入eval函數後,就能看到”解密”後的內容,分析後發現suhI9pzg8akH6是我的目標,繼續跟進去

Untitled

  • const dMqYT = gFEd9jX6phJLhqad(kQ8z, pw3c5ux)這句是從localStorageUtil中獲取數據,相當於從網站緩存中獲取,因此只有第1次訪問該網站或刪除網站緩存後,才會發送ajax請求來獲取數據

Untitled

  • 先刪除網站緩存:開發者工具→應該程式→儲存空間→清除
  • 然後刷新頁面,重新去到發送ajax的地方

Untitled

加密函數分析

  • 之後對加密函數進行分析,先看加密參數是怎樣來的

Untitled

  • 經多次測試後發現,下圖兩處地方是會改變的
  • 第1個地方:每次隨機生成不同的字符串
  • 第2個地方分3種情況:
    1. 只有BASE64
    2. BASE64+AES
    3. BASE64+DES
  • 因此寫腳本要注意分3種情況,並且每次AES、DES加密所用到key和iv都會變,所以要動態獲取

Untitled

解密函數分析

  • 請求成功後,用dobXiBdA52b函數對返回的結果進行解密,解密後的數據就是我想要的空氣質量數據

Untitled

  • 可以看到該函數就是簡單的BASE64、DES、AES解密,只需找到key和iv就能輕易地解密
  • 且經過多次測試發現該函數的形式不會改變,只有key和iv會變
  • 因此也需要動態地獲取key和iv

Untitled

腳本編寫

思路

  1. 因為所有的key和iv都會變,因此需要動態獲取js代碼
  2. 而js被加密,所以要對js代碼進行解密
  3. 獲取AES、DES的key和iv( 在解密後的js代碼最上方 )
  4. 為加密函數、解密函數匹配對應的key、iv ( 加密、解密所用到的key、iv不同,要進行匹配 )
  5. 模擬加密函數進行加密
  6. 模擬解密函數進行解密

完整代碼

  • 說明main.py是主要的python代碼,main.jsfunc.js是用來模擬加密、解密過程的代碼,myHttp.js提供了幾個api接口,讓main.py能執行main.js中的js代碼
  • 使用步驟:
    1
    2
    node myHttp.js
    python main.py

main.py

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
import requests
import execjs
import re

headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36',
}

# 獲取主頁
def getIndexPage(url):
resp = requests.get(url=url,headers=headers)
return resp.text

# 獲取js路徑,就在主頁源代碼中
def getJsUrl(page):
regx = re.compile(r'<script type="text/javascript" src="resource/js/(.*?)"></script>',re.S)
res = regx.findall(page)
# print(res[1])
return res[1]

# 請求js代碼
def getJsCode(base,url):
resp = requests.get(base+url,headers=headers)
jsCode = resp.text
resp.close()
return jsCode

def replaceEval(jsCode):
return jsCode.replace("eval","")

def decodeJsCode(jsCode):
# 因為js代碼被eval"加密",所以要先將eval的內容弄出來
# 具體方法:直接執行eval(XXX)中的XXX
jsCode = replaceEval(jsCode)
ctx = execjs.compile("function func(){return "+jsCode+"}")
ret = ctx.call('func')

# 返回的結果分3種情況
### 有時要用dweklxde再解密,有時唔洗 ###
if 'aes_local_key' in ret:
# 情況1:不用再解密
print("不用再解密")
return ret
else:
# 情況2:要用dweklxde函數進行解密
print("要再解密")
ciphertext = re.search(r"dweklxde\('(?P<content>.*?)'\)",ret).group('content')

# 再對之後的內容解密
resp = requests.post("http://127.0.0.1:3000/decode",{
"a":ciphertext,
})
ret = resp.text

# 情況3:有時需要進行兩次dweklxde解密,因此要判斷一下
if 'const' not in ret:
print("二次dweklxde解密")
resp = requests.post("http://127.0.0.1:3000/decode",{
"a":str(ret),
})
ret = resp.text

return ret

# 獲取AES、DES的key和iv
def getKeyAndIv(jsCode):
regx = re.compile(r'const[ ]+([A-z0-9]+)[ ]*=[ ]*"(.*?)"')
keys = regx.findall(jsCode)
dict = {}
for key in keys:
dict[key[0]] = key[1]
return dict

# 匹配解密時用到的key、iv
def matchDecodeKeyAndIv(jsCode,keyDict):
# print(jsCode)
regx = re.compile(r"data[ ]*=[ ]*BASE64.*?DES.decrypt\(data,(?P<des_key>.*?),(?P<des_iv>.*?)\).*?AES.decrypt\(data,(?P<aes_key>.*?),(?P<aes_iv>.*?)\).*?data[ ]*=[ ]*BASE64",re.S)
res = regx.search(jsCode)
des_key = res.group('des_key').strip()
des_iv = res.group('des_iv').strip()
aes_key = res.group('aes_key').strip()
aes_iv = res.group('aes_iv').strip()
decodeDict = {}
decodeDict["des_key"] = keyDict[des_key]
decodeDict["des_iv"] = keyDict[des_iv]
decodeDict["aes_key"] = keyDict[aes_key]
decodeDict["aes_iv"] = keyDict[aes_iv]
return decodeDict

# 匹配加密參數時用到的key、iv
# 順便獲取post請求的參數名(因為會變動)
def matchEncodeKeyAndIv(jsCode,keyDict):
# print(jsCode)
dict = {}

### 先獲取post取求的參數名
regx = re.compile(r"\$.ajax\(.*?data:.*?\{(?P<paramName>.*?):(.*?)\}.*?\)",re.S)
res = regx.search(jsCode)
paramName = res.group('paramName').strip()
dict["paramName"] = paramName

### 獲取key、iv要分3種情況來處理
# 1. 冇DES、AES加密,直接返回
regx = re.compile(r"return function.*?var .*?=.*?'(?P<k>.*?)'.*?'WEB'",re.S)
res = regx.search(jsCode)
dict['k'] = res.group('k').strip()

# 2.只有AES加密:獲取key、iv
regx = re.compile(r"return function.*?var .*?=.*?'(?P<k>.*?)'.*?'WEB'.*?AES.encrypt\(.*?,(?P<key>.*?),(?P<iv>.*?)\)",re.S)
res = regx.search(jsCode)
if res != None:
print("AES加密")
key = res.group('key').strip()
iv = res.group('iv').strip()
dict["aes_key"] = keyDict[key]
dict["aes_iv"] = keyDict[iv]
return dict

# 3.只有DES加密:獲取key、iv
regx = re.compile(r"return function.*?var .*?=.*?'(?P<k>.*?)'.*?'WEB'.*?DES.encrypt\(.*?,(?P<key>.*?),(?P<iv>.*?)\)",re.S)
res = regx.search(jsCode)
if res != None:
print("DES加密")
key = res.group('key').strip()
iv = res.group('iv').strip()
dict["des_key"] = keyDict[key]
dict["des_iv"] = keyDict[iv]
return dict

return dict

def getParam(encodeDict):
url = "http://127.0.0.1:3000/getParam"
mode = key = iv = ""
if 'aes_key' in encodeDict:
mode = 'AES'
key = encodeDict['aes_key']
iv = encodeDict['aes_iv']
elif 'des_key' in encodeDict:
mode = 'DES'
key = encodeDict['des_key']
iv = encodeDict['des_iv']
data = {
"p1":"GETMONTHDATA",
"p2":'{"city": "北京"}', # 直接傳dict會有問題(可能係js解析唔到?)
"k":encodeDict['k'],
"key":key,
"iv":iv,
"mode":mode
}

resp = requests.post(url,data)
# print(resp.text)
return resp.text

def requestData(data):
headers = {
'Accept': '*/*',
'Accept-Language': 'zh-TW,zh;q=0.9,en-US;q=0.8,en;q=0.7',
'Cache-Control': 'no-cache',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Origin': 'http://www.aqistudy.cn',
'Pragma': 'no-cache',
'Proxy-Connection': 'keep-alive',
'Referer': 'http://www.aqistudy.cn/historydata/monthdata.php?city=%E5%8C%97%E4%BA%AC',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36',
'X-Requested-With': 'XMLHttpRequest',
}
resp = requests.post(url='http://www.aqistudy.cn/historydata/api/historyapi.php',data=data,headers=headers,verify=False)
ret = resp.text
resp.close()
return ret

def dataDecode(data,decodeDict):
url = "http://127.0.0.1:3000/dataDecode"

data = {
"data":data,
"aes_key":decodeDict["aes_key"],
"aes_iv":decodeDict["aes_iv"],
"des_key":decodeDict["des_key"],
"des_iv":decodeDict["des_iv"],
}
resp = requests.post(url,data)
print(resp.text)
def test():
url = "http://127.0.0.1:3000/decode"

data = {
"a":"MTIzNA==",
}
resp = requests.post(url,data)
print(resp.text)

def main():
indexPage = getIndexPage("http://www.aqistudy.cn/historydata/monthdata.php?city=%E5%8C%97%E4%BA%AC")
jsUrl = getJsUrl(indexPage)
jsCode = getJsCode("http://www.aqistudy.cn/historydata/resource/js/",jsUrl)
decode_jsCode = decodeJsCode(jsCode)
keyDict = getKeyAndIv(decode_jsCode)
decodeDict = matchDecodeKeyAndIv(decode_jsCode,keyDict)
encodeDict = matchEncodeKeyAndIv(decode_jsCode,keyDict)
param = getParam(encodeDict)

print(param)

data = requestData({encodeDict["paramName"]:param})
dataDecode(data,decodeDict)

if __name__ == "__main__":
main()

main.js

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
// http://www.aqistudy.cn/historydata/monthdata.php?city=%E5%8C%97%E4%BA%AC

var CryptoJS = require("crypto-js")

function Base64() {
_keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
this.encode = function(a) {
var c, d, e, f, g, h, i, b = "", j = 0;
for (a = _utf8_encode(a); j < a.length; )
c = a.charCodeAt(j++),
d = a.charCodeAt(j++),
e = a.charCodeAt(j++),
f = c >> 2,
g = (3 & c) << 4 | d >> 4,
h = (15 & d) << 2 | e >> 6,
i = 63 & e,
isNaN(d) ? h = i = 64 : isNaN(e) && (i = 64),
b = b + _keyStr.charAt(f) + _keyStr.charAt(g) + _keyStr.charAt(h) + _keyStr.charAt(i);
return b
}
,
this.decode = function(a) {
var c, d, e, f, g, h, i, b = "", j = 0;
for (a = a.replace(/[^A-Za-z0-9\+\/\=]/g, ""); j < a.length; )
f = _keyStr.indexOf(a.charAt(j++)),
g = _keyStr.indexOf(a.charAt(j++)),
h = _keyStr.indexOf(a.charAt(j++)),
i = _keyStr.indexOf(a.charAt(j++)),
c = f << 2 | g >> 4,
d = (15 & g) << 4 | h >> 2,
e = (3 & h) << 6 | i,
b += String.fromCharCode(c),
64 != h && (b += String.fromCharCode(d)),
64 != i && (b += String.fromCharCode(e));
return b = _utf8_decode(b)
}
,
_utf8_encode = function(a) {
var b, c, d;
for (a = a.replace(/\r\n/g, "\n"),
b = "",
c = 0; c < a.length; c++)
d = a.charCodeAt(c),
128 > d ? b += String.fromCharCode(d) : d > 127 && 2048 > d ? (b += String.fromCharCode(192 | d >> 6),
b += String.fromCharCode(128 | 63 & d)) : (b += String.fromCharCode(224 | d >> 12),
b += String.fromCharCode(128 | 63 & d >> 6),
b += String.fromCharCode(128 | 63 & d));
return b
}
,
_utf8_decode = function(a) {
for (var b = "", c = 0, d = c1 = c2 = 0; c < a.length; )
d = a.charCodeAt(c),
128 > d ? (b += String.fromCharCode(d),
c++) : d > 191 && 224 > d ? (c2 = a.charCodeAt(c + 1),
b += String.fromCharCode((31 & d) << 6 | 63 & c2),
c += 2) : (c2 = a.charCodeAt(c + 1),
c3 = a.charCodeAt(c + 2),
b += String.fromCharCode((15 & d) << 12 | (63 & c2) << 6 | 63 & c3),
c += 3);
return b
}
}
var BASE64 = {
encrypt: function(text) {
var b = new Base64();
return b.encode(text);
},
decrypt: function(text) {
var b = new Base64();
return b.decode(text);
}
};
var DES = {
encrypt: function(text, key, iv){
var secretkey = (CryptoJS.MD5(key).toString()).substr(0, 16);
var secretiv = (CryptoJS.MD5(iv).toString()).substr(24, 8);
secretkey = CryptoJS.enc.Utf8.parse(secretkey);
secretiv = CryptoJS.enc.Utf8.parse(secretiv);
var result = CryptoJS.DES.encrypt(text, secretkey, {
iv: secretiv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
});
return result.toString();
},
decrypt: function(text, key, iv){
var secretkey = (CryptoJS.MD5(key).toString()).substr(0, 16);
var secretiv = (CryptoJS.MD5(iv).toString()).substr(24, 8);
secretkey = CryptoJS.enc.Utf8.parse(secretkey);
secretiv = CryptoJS.enc.Utf8.parse(secretiv);
var result = CryptoJS.DES.decrypt(text, secretkey, {
iv: secretiv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
});
return result.toString(CryptoJS.enc.Utf8);
}
};

var AES = {
encrypt: function(text, key, iv) {
var secretkey = (CryptoJS.MD5(key).toString()).substr(16, 16);
var secretiv = (CryptoJS.MD5(iv).toString()).substr(0, 16);
// console.log('real key:', secretkey);
// console.log('real iv:', secretiv);
secretkey = CryptoJS.enc.Utf8.parse(secretkey);
secretiv = CryptoJS.enc.Utf8.parse(secretiv);
var result = CryptoJS.AES.encrypt(text, secretkey, {
iv: secretiv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
});
return result.toString();
},
decrypt: function(text, key, iv) {
var secretkey = (CryptoJS.MD5(key).toString()).substr(16, 16);
var secretiv = (CryptoJS.MD5(iv).toString()).substr(0, 16);
secretkey = CryptoJS.enc.Utf8.parse(secretkey);
secretiv = CryptoJS.enc.Utf8.parse(secretiv);
var result = CryptoJS.AES.decrypt(text, secretkey, {
iv: secretiv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
});
return result.toString(CryptoJS.enc.Utf8);
}
};

function os1vRI9rHL(obj){
var newObject = {};
Object.keys(obj).sort().map(function(key){
newObject[key] = obj[key];
});
return newObject;
}

var myFunc = require("./func")

function getParam(p1, p2,k,key,iv,mode){
// 因為從python直接傳一個dict入黎會有問題,所以只好傳一個字符串形式的dict
// 然後再用JSON.parse來解析
p2 = JSON.parse(p2)

var aAAD = k; //'d587df3d01ccaaca6b3dec0706ba606a'

var codfg = 'WEB';
var tJJGBBk = new Date().getTime();

var pwDTRzW = {
appId: aAAD,
method: p1,
timestamp: tJJGBBk,
clienttype: codfg,
object: p2,
secret: myFunc.hex_md5(aAAD + p1 + tJJGBBk + codfg + JSON.stringify(os1vRI9rHL(p2))).toString()
};

pwDTRzW = BASE64.encrypt(JSON.stringify(pwDTRzW));

if(mode=="AES"){
pwDTRzW = AES.encrypt(pwDTRzW, key, iv);
}else if(mode=="DES"){
pwDTRzW = DES.encrypt(pwDTRzW, key, iv);
}

return pwDTRzW;
};

function dataDecode(data,aes_key,ase_iv,des_key,des_iv) {
data = BASE64.decrypt(data);
data = DES.decrypt(data, des_key, des_iv);
data = AES.decrypt(data, aes_key, ase_iv);
data = BASE64.decrypt(data);
return data;
}

function dweklxde(tsdx) {
var b = new Base64();
return b.decode(tsdx)
}

module.exports = {
dweklxde,
getParam,
dataDecode
}

myHttp.js

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const express = require('express')  // npm install express (-g全局安裝不行,不知為何)
const app = express()
const main = require('./main')
// var bodyParser = require('body-parser')
// app.use(bodyParser())

// 以下兩行是為了解決->https://stackoverflow.com/questions/19917401/error-request-entity-too-large
app.use(express.json({limit: '100mb'}));
app.use(express.urlencoded({limit: '100mb'}));

app.post("/decode",function(req,res){
let result = req.body
console.log("result",result)
let a = result.a
result = main.dweklxde(a)
res.send(result.toString())
})

app.post("/getParam",function(req,res){
let result = req.body
console.log("result",result)
result = main.getParam(result.p1,result.p2,result.k,result.key,result.iv,result.mode)
res.send(result.toString())
})
app.post("/dataDecode",function(req,res){
let result = req.body
console.log("result",result)
result = main.dataDecode(result.data,result.aes_key,result.aes_iv,result.des_key,result.des_iv)
res.send(result.toString())
})

app.listen(3000,()=>{
console.log("開始服務,端口3000")
})

func.js

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
function Base64() {
_keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
this.encode = function(a) {
var c, d, e, f, g, h, i, b = "", j = 0;
for (a = _utf8_encode(a); j < a.length; )
c = a.charCodeAt(j++),
d = a.charCodeAt(j++),
e = a.charCodeAt(j++),
f = c >> 2,
g = (3 & c) << 4 | d >> 4,
h = (15 & d) << 2 | e >> 6,
i = 63 & e,
isNaN(d) ? h = i = 64 : isNaN(e) && (i = 64),
b = b + _keyStr.charAt(f) + _keyStr.charAt(g) + _keyStr.charAt(h) + _keyStr.charAt(i);
return b
}
,
this.decode = function(a) {
var c, d, e, f, g, h, i, b = "", j = 0;
for (a = a.replace(/[^A-Za-z0-9\+\/\=]/g, ""); j < a.length; )
f = _keyStr.indexOf(a.charAt(j++)),
g = _keyStr.indexOf(a.charAt(j++)),
h = _keyStr.indexOf(a.charAt(j++)),
i = _keyStr.indexOf(a.charAt(j++)),
c = f << 2 | g >> 4,
d = (15 & g) << 4 | h >> 2,
e = (3 & h) << 6 | i,
b += String.fromCharCode(c),
64 != h && (b += String.fromCharCode(d)),
64 != i && (b += String.fromCharCode(e));
return b = _utf8_decode(b)
}
,
_utf8_encode = function(a) {
var b, c, d;
for (a = a.replace(/\r\n/g, "\n"),
b = "",
c = 0; c < a.length; c++)
d = a.charCodeAt(c),
128 > d ? b += String.fromCharCode(d) : d > 127 && 2048 > d ? (b += String.fromCharCode(192 | d >> 6),
b += String.fromCharCode(128 | 63 & d)) : (b += String.fromCharCode(224 | d >> 12),
b += String.fromCharCode(128 | 63 & d >> 6),
b += String.fromCharCode(128 | 63 & d));
return b
}
,
_utf8_decode = function(a) {
for (var b = "", c = 0, d = c1 = c2 = 0; c < a.length; )
d = a.charCodeAt(c),
128 > d ? (b += String.fromCharCode(d),
c++) : d > 191 && 224 > d ? (c2 = a.charCodeAt(c + 1),
b += String.fromCharCode((31 & d) << 6 | 63 & c2),
c += 2) : (c2 = a.charCodeAt(c + 1),
c3 = a.charCodeAt(c + 2),
b += String.fromCharCode((15 & d) << 12 | (63 & c2) << 6 | 63 & c3),
c += 3);
return b
}
}
function hex_md5(a) {
return binl2hex(core_md5(str2binl(a), a.length * chrsz))
}
function b64_md5(a) {
return binl2b64(core_md5(str2binl(a), a.length * chrsz))
}
function str_md5(a) {
return binl2str(core_md5(str2binl(a), a.length * chrsz))
}
function hex_hmac_md5(a, b) {
return binl2hex(core_hmac_md5(a, b))
}
function b64_hmac_md5(a, b) {
return binl2b64(core_hmac_md5(a, b))
}
function str_hmac_md5(a, b) {
return binl2str(core_hmac_md5(a, b))
}
function md5_vm_test() {
return "900150983cd24fb0d6963f7d28e17f72" == hex_md5("abc")
}
function core_md5(a, b) {
var c, d, e, f, g, h, i, j, k;
for (a[b >> 5] |= 128 << b % 32,
a[(b + 64 >>> 9 << 4) + 14] = b,
c = 1732584193,
d = -271733879,
e = -1732584194,
f = 271733878,
g = 0; g < a.length; g += 16)
h = c,
i = d,
j = e,
k = f,
c = md5_ff(c, d, e, f, a[g + 0], 7, -680876936),
f = md5_ff(f, c, d, e, a[g + 1], 12, -389564586),
e = md5_ff(e, f, c, d, a[g + 2], 17, 606105819),
d = md5_ff(d, e, f, c, a[g + 3], 22, -1044525330),
c = md5_ff(c, d, e, f, a[g + 4], 7, -176418897),
f = md5_ff(f, c, d, e, a[g + 5], 12, 1200080426),
e = md5_ff(e, f, c, d, a[g + 6], 17, -1473231341),
d = md5_ff(d, e, f, c, a[g + 7], 22, -45705983),
c = md5_ff(c, d, e, f, a[g + 8], 7, 1770035416),
f = md5_ff(f, c, d, e, a[g + 9], 12, -1958414417),
e = md5_ff(e, f, c, d, a[g + 10], 17, -42063),
d = md5_ff(d, e, f, c, a[g + 11], 22, -1990404162),
c = md5_ff(c, d, e, f, a[g + 12], 7, 1804603682),
f = md5_ff(f, c, d, e, a[g + 13], 12, -40341101),
e = md5_ff(e, f, c, d, a[g + 14], 17, -1502002290),
d = md5_ff(d, e, f, c, a[g + 15], 22, 1236535329),
c = md5_gg(c, d, e, f, a[g + 1], 5, -165796510),
f = md5_gg(f, c, d, e, a[g + 6], 9, -1069501632),
e = md5_gg(e, f, c, d, a[g + 11], 14, 643717713),
d = md5_gg(d, e, f, c, a[g + 0], 20, -373897302),
c = md5_gg(c, d, e, f, a[g + 5], 5, -701558691),
f = md5_gg(f, c, d, e, a[g + 10], 9, 38016083),
e = md5_gg(e, f, c, d, a[g + 15], 14, -660478335),
d = md5_gg(d, e, f, c, a[g + 4], 20, -405537848),
c = md5_gg(c, d, e, f, a[g + 9], 5, 568446438),
f = md5_gg(f, c, d, e, a[g + 14], 9, -1019803690),
e = md5_gg(e, f, c, d, a[g + 3], 14, -187363961),
d = md5_gg(d, e, f, c, a[g + 8], 20, 1163531501),
c = md5_gg(c, d, e, f, a[g + 13], 5, -1444681467),
f = md5_gg(f, c, d, e, a[g + 2], 9, -51403784),
e = md5_gg(e, f, c, d, a[g + 7], 14, 1735328473),
d = md5_gg(d, e, f, c, a[g + 12], 20, -1926607734),
c = md5_hh(c, d, e, f, a[g + 5], 4, -378558),
f = md5_hh(f, c, d, e, a[g + 8], 11, -2022574463),
e = md5_hh(e, f, c, d, a[g + 11], 16, 1839030562),
d = md5_hh(d, e, f, c, a[g + 14], 23, -35309556),
c = md5_hh(c, d, e, f, a[g + 1], 4, -1530992060),
f = md5_hh(f, c, d, e, a[g + 4], 11, 1272893353),
e = md5_hh(e, f, c, d, a[g + 7], 16, -155497632),
d = md5_hh(d, e, f, c, a[g + 10], 23, -1094730640),
c = md5_hh(c, d, e, f, a[g + 13], 4, 681279174),
f = md5_hh(f, c, d, e, a[g + 0], 11, -358537222),
e = md5_hh(e, f, c, d, a[g + 3], 16, -722521979),
d = md5_hh(d, e, f, c, a[g + 6], 23, 76029189),
c = md5_hh(c, d, e, f, a[g + 9], 4, -640364487),
f = md5_hh(f, c, d, e, a[g + 12], 11, -421815835),
e = md5_hh(e, f, c, d, a[g + 15], 16, 530742520),
d = md5_hh(d, e, f, c, a[g + 2], 23, -995338651),
c = md5_ii(c, d, e, f, a[g + 0], 6, -198630844),
f = md5_ii(f, c, d, e, a[g + 7], 10, 1126891415),
e = md5_ii(e, f, c, d, a[g + 14], 15, -1416354905),
d = md5_ii(d, e, f, c, a[g + 5], 21, -57434055),
c = md5_ii(c, d, e, f, a[g + 12], 6, 1700485571),
f = md5_ii(f, c, d, e, a[g + 3], 10, -1894986606),
e = md5_ii(e, f, c, d, a[g + 10], 15, -1051523),
d = md5_ii(d, e, f, c, a[g + 1], 21, -2054922799),
c = md5_ii(c, d, e, f, a[g + 8], 6, 1873313359),
f = md5_ii(f, c, d, e, a[g + 15], 10, -30611744),
e = md5_ii(e, f, c, d, a[g + 6], 15, -1560198380),
d = md5_ii(d, e, f, c, a[g + 13], 21, 1309151649),
c = md5_ii(c, d, e, f, a[g + 4], 6, -145523070),
f = md5_ii(f, c, d, e, a[g + 11], 10, -1120210379),
e = md5_ii(e, f, c, d, a[g + 2], 15, 718787259),
d = md5_ii(d, e, f, c, a[g + 9], 21, -343485551),
c = safe_add(c, h),
d = safe_add(d, i),
e = safe_add(e, j),
f = safe_add(f, k);
return Array(c, d, e, f)
}
function md5_cmn(a, b, c, d, e, f) {
return safe_add(bit_rol(safe_add(safe_add(b, a), safe_add(d, f)), e), c)
}
function md5_ff(a, b, c, d, e, f, g) {
return md5_cmn(b & c | ~b & d, a, b, e, f, g)
}
function md5_gg(a, b, c, d, e, f, g) {
return md5_cmn(b & d | c & ~d, a, b, e, f, g)
}
function md5_hh(a, b, c, d, e, f, g) {
return md5_cmn(b ^ c ^ d, a, b, e, f, g)
}
function md5_ii(a, b, c, d, e, f, g) {
return md5_cmn(c ^ (b | ~d), a, b, e, f, g)
}
function core_hmac_md5(a, b) {
var d, e, f, g, c = str2binl(a);
for (c.length > 16 && (c = core_md5(c, a.length * chrsz)),
d = Array(16),
e = Array(16),
f = 0; 16 > f; f++)
d[f] = 909522486 ^ c[f],
e[f] = 1549556828 ^ c[f];
return g = core_md5(d.concat(str2binl(b)), 512 + b.length * chrsz),
core_md5(e.concat(g), 640)
}
function safe_add(a, b) {
var c = (65535 & a) + (65535 & b)
, d = (a >> 16) + (b >> 16) + (c >> 16);
return d << 16 | 65535 & c
}
function bit_rol(a, b) {
return a << b | a >>> 32 - b
}
function str2binl(a) {
var d, b = Array(), c = (1 << chrsz) - 1;
for (d = 0; d < a.length * chrsz; d += chrsz)
b[d >> 5] |= (a.charCodeAt(d / chrsz) & c) << d % 32;
return b
}
function binl2str(a) {
var d, b = "", c = (1 << chrsz) - 1;
for (d = 0; d < 32 * a.length; d += chrsz)
b += String.fromCharCode(a[d >> 5] >>> d % 32 & c);
return b
}
function binl2hex(a) {
var d, b = hexcase ? "0123456789ABCDEF" : "0123456789abcdef", c = "";
for (d = 0; d < 4 * a.length; d++)
c += b.charAt(15 & a[d >> 2] >> 8 * (d % 4) + 4) + b.charAt(15 & a[d >> 2] >> 8 * (d % 4));
return c
}
function binl2b64(a) {
var d, e, f, b = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", c = "";
for (d = 0; d < 4 * a.length; d += 3)
for (e = (255 & a[d >> 2] >> 8 * (d % 4)) << 16 | (255 & a[d + 1 >> 2] >> 8 * ((d + 1) % 4)) << 8 | 255 & a[d + 2 >> 2] >> 8 * ((d + 2) % 4),
f = 0; 4 > f; f++)
c += 8 * d + 6 * f > 32 * a.length ? b64pad : b.charAt(63 & e >> 6 * (3 - f));
return c
}
function encode_param(a) {
var b = new Base64;
return b.encode(a)
}
function encode_secret() {
var b, a = appId;
for (b = 0; b < arguments.length; b++)
a += arguments[b];
return a = a.replace(/\s/g, ""),
hex_md5(a)
}
function decode_result(a) {
var b = new Base64;
return b.decode(b.decode(b.decode(a)))
}
var hexcase = 0
, b64pad = ""
, chrsz = 8
, appId = "b73a4aaa989f54997ef7b9c42b6b4b29";
var hexcase = 0;
var b64pad = "";
function hex_md5(s) {
return rstr2hex(rstr_md5(str2rstr_utf8(s)))
}
function b64_md5(s) {
return rstr2b64(rstr_md5(str2rstr_utf8(s)))
}
function any_md5(s, e) {
return rstr2any(rstr_md5(str2rstr_utf8(s)), e)
}
function hex_hmac_md5(k, d) {
return rstr2hex(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d)))
}
function b64_hmac_md5(k, d) {
return rstr2b64(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d)))
}
function any_hmac_md5(k, d, e) {
return rstr2any(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d)), e)
}
function md5_vm_test() {
return hex_md5("abc").toLowerCase() == "900150983cd24fb0d6963f7d28e17f72"
}
function rstr_md5(s) {
return binl2rstr(binl_md5(rstr2binl(s), s.length * 8))
}
function rstr_hmac_md5(key, data) {
var bkey = rstr2binl(key);
if (bkey.length > 16)
bkey = binl_md5(bkey, key.length * 8);
var ipad = Array(16)
, opad = Array(16);
for (var i = 0; i < 16; i++) {
ipad[i] = bkey[i] ^ 0x36363636;
opad[i] = bkey[i] ^ 0x5C5C5C5C
}
var hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);
return binl2rstr(binl_md5(opad.concat(hash), 512 + 128))
}
function rstr2hex(input) {
try {
hexcase
} catch (e) {
hexcase = 0
}
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
var output = "";
var x;
for (var i = 0; i < input.length; i++) {
x = input.charCodeAt(i);
output += hex_tab.charAt((x >>> 4) & 0x0F) + hex_tab.charAt(x & 0x0F)
}
return output
}
function rstr2b64(input) {
try {
b64pad
} catch (e) {
b64pad = ''
}
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var output = "";
var len = input.length;
for (var i = 0; i < len; i += 3) {
var triplet = (input.charCodeAt(i) << 16) | (i + 1 < len ? input.charCodeAt(i + 1) << 8 : 0) | (i + 2 < len ? input.charCodeAt(i + 2) : 0);
for (var j = 0; j < 4; j++) {
if (i * 8 + j * 6 > input.length * 8)
output += b64pad;
else
output += tab.charAt((triplet >>> 6 * (3 - j)) & 0x3F)
}
}
return output
}
function rstr2any(input, encoding) {
var divisor = encoding.length;
var i, j, q, x, quotient;
var dividend = Array(Math.ceil(input.length / 2));
for (i = 0; i < dividend.length; i++) {
dividend[i] = (input.charCodeAt(i * 2) << 8) | input.charCodeAt(i * 2 + 1)
}
var full_length = Math.ceil(input.length * 8 / (Math.log(encoding.length) / Math.log(2)));
var remainders = Array(full_length);
for (j = 0; j < full_length; j++) {
quotient = Array();
x = 0;
for (i = 0; i < dividend.length; i++) {
x = (x << 16) + dividend[i];
q = Math.floor(x / divisor);
x -= q * divisor;
if (quotient.length > 0 || q > 0)
quotient[quotient.length] = q
}
remainders[j] = x;
dividend = quotient
}
var output = "";
for (i = remainders.length - 1; i >= 0; i--)
output += encoding.charAt(remainders[i]);
return output
}
function str2rstr_utf8(input) {
var output = "";
var i = -1;
var x, y;
while (++i < input.length) {
x = input.charCodeAt(i);
y = i + 1 < input.length ? input.charCodeAt(i + 1) : 0;
if (0xD800 <= x && x <= 0xDBFF && 0xDC00 <= y && y <= 0xDFFF) {
x = 0x10000 + ((x & 0x03FF) << 10) + (y & 0x03FF);
i++
}
if (x <= 0x7F)
output += String.fromCharCode(x);
else if (x <= 0x7FF)
output += String.fromCharCode(0xC0 | ((x >>> 6) & 0x1F), 0x80 | (x & 0x3F));
else if (x <= 0xFFFF)
output += String.fromCharCode(0xE0 | ((x >>> 12) & 0x0F), 0x80 | ((x >>> 6) & 0x3F), 0x80 | (x & 0x3F));
else if (x <= 0x1FFFFF)
output += String.fromCharCode(0xF0 | ((x >>> 18) & 0x07), 0x80 | ((x >>> 12) & 0x3F), 0x80 | ((x >>> 6) & 0x3F), 0x80 | (x & 0x3F))
}
return output
}
function str2rstr_utf16le(input) {
var output = "";
for (var i = 0; i < input.length; i++)
output += String.fromCharCode(input.charCodeAt(i) & 0xFF, (input.charCodeAt(i) >>> 8) & 0xFF);
return output
}
function str2rstr_utf16be(input) {
var output = "";
for (var i = 0; i < input.length; i++)
output += String.fromCharCode((input.charCodeAt(i) >>> 8) & 0xFF, input.charCodeAt(i) & 0xFF);
return output
}
function rstr2binl(input) {
var output = Array(input.length >> 2);
for (var i = 0; i < output.length; i++)
output[i] = 0;
for (var i = 0; i < input.length * 8; i += 8)
output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);
return output
}
function binl2rstr(input) {
var output = "";
for (var i = 0; i < input.length * 32; i += 8)
output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);
return output
}
function binl_md5(x, len) {
x[len >> 5] |= 0x80 << ((len) % 32);
x[(((len + 64) >>> 9) << 4) + 14] = len;
var a = 1732584193;
var b = -271733879;
var c = -1732584194;
var d = 271733878;
for (var i = 0; i < x.length; i += 16) {
var olda = a;
var oldb = b;
var oldc = c;
var oldd = d;
a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936);
d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586);
c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819);
b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330);
a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897);
d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426);
c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341);
b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983);
a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416);
d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417);
c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);
b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);
a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682);
d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);
c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);
b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329);
a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510);
d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632);
c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713);
b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302);
a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691);
d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083);
c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);
b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848);
a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438);
d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690);
c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961);
b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501);
a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467);
d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784);
c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473);
b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);
a = md5_hh(a, b, c, d, x[i + 5], 4, -378558);
d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463);
c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562);
b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);
a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060);
d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353);
c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632);
b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);
a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174);
d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222);
c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979);
b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189);
a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487);
d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);
c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520);
b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651);
a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844);
d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415);
c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);
b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055);
a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571);
d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606);
c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);
b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799);
a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359);
d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);
c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380);
b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649);
a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070);
d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);
c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259);
b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551);
a = safe_add(a, olda);
b = safe_add(b, oldb);
c = safe_add(c, oldc);
d = safe_add(d, oldd)
}
return Array(a, b, c, d)
}
function md5_cmn(q, a, b, x, s, t) {
return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b)
}
function md5_ff(a, b, c, d, x, s, t) {
return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t)
}
function md5_gg(a, b, c, d, x, s, t) {
return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t)
}
function md5_hh(a, b, c, d, x, s, t) {
return md5_cmn(b ^ c ^ d, a, b, x, s, t)
}
function md5_ii(a, b, c, d, x, s, t) {
return md5_cmn(c ^ (b | (~d)), a, b, x, s, t)
}
function safe_add(x, y) {
var lsw = (x & 0xFFFF) + (y & 0xFFFF);
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
return (msw << 16) | (lsw & 0xFFFF)
}
function bit_rol(num, cnt) {
return (num << cnt) | (num >>> (32 - cnt))
}
var CryptoJS = CryptoJS || function(h, r) {
var k = {}
, l = k.lib = {}
, n = function() {}
, f = l.Base = {
extend: function(a) {
n.prototype = this;
var b = new n;
a && b.mixIn(a);
b.hasOwnProperty("init") || (b.init = function() {
b.$super.init.apply(this, arguments)
}
);
b.init.prototype = b;
b.$super = this;
return b
},
create: function() {
var a = this.extend();
a.init.apply(a, arguments);
return a
},
init: function() {},
mixIn: function(a) {
for (var b in a)
a.hasOwnProperty(b) && (this[b] = a[b]);
a.hasOwnProperty("toString") && (this.toString = a.toString)
},
clone: function() {
return this.init.prototype.extend(this)
}
}
, j = l.WordArray = f.extend({
init: function(a, b) {
a = this.words = a || [];
this.sigBytes = b != r ? b : 4 * a.length
},
toString: function(a) {
return (a || s).stringify(this)
},
concat: function(a) {
var b = this.words
, d = a.words
, c = this.sigBytes;
a = a.sigBytes;
this.clamp();
if (c % 4)
for (var e = 0; e < a; e++)
b[c + e >>> 2] |= (d[e >>> 2] >>> 24 - 8 * (e % 4) & 255) << 24 - 8 * ((c + e) % 4);
else if (65535 < d.length)
for (e = 0; e < a; e += 4)
b[c + e >>> 2] = d[e >>> 2];
else
b.push.apply(b, d);
this.sigBytes += a;
return this
},
clamp: function() {
var a = this.words
, b = this.sigBytes;
a[b >>> 2] &= 4294967295 << 32 - 8 * (b % 4);
a.length = h.ceil(b / 4)
},
clone: function() {
var a = f.clone.call(this);
a.words = this.words.slice(0);
return a
},
random: function(a) {
for (var b = [], d = 0; d < a; d += 4)
b.push(4294967296 * h.random() | 0);
return new j.init(b,a)
}
})
, m = k.enc = {}
, s = m.Hex = {
stringify: function(a) {
var b = a.words;
a = a.sigBytes;
for (var d = [], c = 0; c < a; c++) {
var e = b[c >>> 2] >>> 24 - 8 * (c % 4) & 255;
d.push((e >>> 4).toString(16));
d.push((e & 15).toString(16))
}
return d.join("")
},
parse: function(a) {
for (var b = a.length, d = [], c = 0; c < b; c += 2)
d[c >>> 3] |= parseInt(a.substr(c, 2), 16) << 24 - 4 * (c % 8);
return new j.init(d,b / 2)
}
}
, p = m.Latin1 = {
stringify: function(a) {
var b = a.words;
a = a.sigBytes;
for (var d = [], c = 0; c < a; c++)
d.push(String.fromCharCode(b[c >>> 2] >>> 24 - 8 * (c % 4) & 255));
return d.join("")
},
parse: function(a) {
for (var b = a.length, d = [], c = 0; c < b; c++)
d[c >>> 2] |= (a.charCodeAt(c) & 255) << 24 - 8 * (c % 4);
return new j.init(d,b)
}
}
, t = m.Utf8 = {
stringify: function(a) {
try {
return decodeURIComponent(escape(p.stringify(a)))
} catch (b) {
throw Error("Malformed UTF-8 data")
}
},
parse: function(a) {
return p.parse(unescape(encodeURIComponent(a)))
}
}
, q = l.BufferedBlockAlgorithm = f.extend({
reset: function() {
this._data = new j.init;
this._nDataBytes = 0
},
_append: function(a) {
"string" == typeof a && (a = t.parse(a));
this._data.concat(a);
this._nDataBytes += a.sigBytes
},
_process: function(a) {
var b = this._data
, d = b.words
, c = b.sigBytes
, e = this.blockSize
, f = c / (4 * e)
, f = a ? h.ceil(f) : h.max((f | 0) - this._minBufferSize, 0);
a = f * e;
c = h.min(4 * a, c);
if (a) {
for (var g = 0; g < a; g += e)
this._doProcessBlock(d, g);
g = d.splice(0, a);
b.sigBytes -= c
}
return new j.init(g,c)
},
clone: function() {
var a = f.clone.call(this);
a._data = this._data.clone();
return a
},
_minBufferSize: 0
});
l.Hasher = q.extend({
cfg: f.extend(),
init: function(a) {
this.cfg = this.cfg.extend(a);
this.reset()
},
reset: function() {
q.reset.call(this);
this._doReset()
},
update: function(a) {
this._append(a);
this._process();
return this
},
finalize: function(a) {
a && this._append(a);
return this._doFinalize()
},
blockSize: 16,
_createHelper: function(a) {
return function(b, d) {
return (new a.init(d)).finalize(b)
}
},
_createHmacHelper: function(a) {
return function(b, d) {
return (new u.HMAC.init(a,d)).finalize(b)
}
}
});
var u = k.algo = {};
return k
}(Math);
(function() {
var h = CryptoJS
, j = h.lib.WordArray;
h.enc.Base64 = {
stringify: function(b) {
var e = b.words
, f = b.sigBytes
, c = this._map;
b.clamp();
b = [];
for (var a = 0; a < f; a += 3)
for (var d = (e[a >>> 2] >>> 24 - 8 * (a % 4) & 255) << 16 | (e[a + 1 >>> 2] >>> 24 - 8 * ((a + 1) % 4) & 255) << 8 | e[a + 2 >>> 2] >>> 24 - 8 * ((a + 2) % 4) & 255, g = 0; 4 > g && a + 0.75 * g < f; g++)
b.push(c.charAt(d >>> 6 * (3 - g) & 63));
if (e = c.charAt(64))
for (; b.length % 4; )
b.push(e);
return b.join("")
},
parse: function(b) {
var e = b.length
, f = this._map
, c = f.charAt(64);
c && (c = b.indexOf(c),
-1 != c && (e = c));
for (var c = [], a = 0, d = 0; d < e; d++)
if (d % 4) {
var g = f.indexOf(b.charAt(d - 1)) << 2 * (d % 4)
, h = f.indexOf(b.charAt(d)) >>> 6 - 2 * (d % 4);
c[a >>> 2] |= (g | h) << 24 - 8 * (a % 4);
a++
}
return j.create(c, a)
},
_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
}
}
)();
CryptoJS.lib.Cipher || function(u) {
var g = CryptoJS
, f = g.lib
, k = f.Base
, l = f.WordArray
, q = f.BufferedBlockAlgorithm
, r = g.enc.Base64
, v = g.algo.EvpKDF
, n = f.Cipher = q.extend({
cfg: k.extend(),
createEncryptor: function(a, b) {
return this.create(this._ENC_XFORM_MODE, a, b)
},
createDecryptor: function(a, b) {
return this.create(this._DEC_XFORM_MODE, a, b)
},
init: function(a, b, c) {
this.cfg = this.cfg.extend(c);
this._xformMode = a;
this._key = b;
this.reset()
},
reset: function() {
q.reset.call(this);
this._doReset()
},
process: function(a) {
this._append(a);
return this._process()
},
finalize: function(a) {
a && this._append(a);
return this._doFinalize()
},
keySize: 4,
ivSize: 4,
_ENC_XFORM_MODE: 1,
_DEC_XFORM_MODE: 2,
_createHelper: function(a) {
return {
encrypt: function(b, c, d) {
return ("string" == typeof c ? s : j).encrypt(a, b, c, d)
},
decrypt: function(b, c, d) {
return ("string" == typeof c ? s : j).decrypt(a, b, c, d)
}
}
}
});
f.StreamCipher = n.extend({
_doFinalize: function() {
return this._process(!0)
},
blockSize: 1
});
var m = g.mode = {}
, t = function(a, b, c) {
var d = this._iv;
d ? this._iv = u : d = this._prevBlock;
for (var e = 0; e < c; e++)
a[b + e] ^= d[e]
}
, h = (f.BlockCipherMode = k.extend({
createEncryptor: function(a, b) {
return this.Encryptor.create(a, b)
},
createDecryptor: function(a, b) {
return this.Decryptor.create(a, b)
},
init: function(a, b) {
this._cipher = a;
this._iv = b
}
})).extend();
h.Encryptor = h.extend({
processBlock: function(a, b) {
var c = this._cipher
, d = c.blockSize;
t.call(this, a, b, d);
c.encryptBlock(a, b);
this._prevBlock = a.slice(b, b + d)
}
});
h.Decryptor = h.extend({
processBlock: function(a, b) {
var c = this._cipher
, d = c.blockSize
, e = a.slice(b, b + d);
c.decryptBlock(a, b);
t.call(this, a, b, d);
this._prevBlock = e
}
});
m = m.CBC = h;
h = (g.pad = {}).Pkcs7 = {
pad: function(a, b) {
for (var c = 4 * b, c = c - a.sigBytes % c, d = c << 24 | c << 16 | c << 8 | c, e = [], f = 0; f < c; f += 4)
e.push(d);
c = l.create(e, c);
a.concat(c)
},
unpad: function(a) {
a.sigBytes -= a.words[a.sigBytes - 1 >>> 2] & 255
}
};
f.BlockCipher = n.extend({
cfg: n.cfg.extend({
mode: m,
padding: h
}),
reset: function() {
n.reset.call(this);
var a = this.cfg
, b = a.iv
, a = a.mode;
if (this._xformMode == this._ENC_XFORM_MODE)
var c = a.createEncryptor;
else
c = a.createDecryptor,
this._minBufferSize = 1;
this._mode = c.call(a, this, b && b.words)
},
_doProcessBlock: function(a, b) {
this._mode.processBlock(a, b)
},
_doFinalize: function() {
var a = this.cfg.padding;
if (this._xformMode == this._ENC_XFORM_MODE) {
a.pad(this._data, this.blockSize);
var b = this._process(!0)
} else
b = this._process(!0),
a.unpad(b);
return b
},
blockSize: 4
});
var p = f.CipherParams = k.extend({
init: function(a) {
this.mixIn(a)
},
toString: function(a) {
return (a || this.formatter).stringify(this)
}
})
, m = (g.format = {}).OpenSSL = {
stringify: function(a) {
var b = a.ciphertext;
a = a.salt;
return (a ? l.create([1398893684, 1701076831]).concat(a).concat(b) : b).toString(r)
},
parse: function(a) {
a = r.parse(a);
var b = a.words;
if (1398893684 == b[0] && 1701076831 == b[1]) {
var c = l.create(b.slice(2, 4));
b.splice(0, 4);
a.sigBytes -= 16
}
return p.create({
ciphertext: a,
salt: c
})
}
}
, j = f.SerializableCipher = k.extend({
cfg: k.extend({
format: m
}),
encrypt: function(a, b, c, d) {
d = this.cfg.extend(d);
var e = a.createEncryptor(c, d);
b = e.finalize(b);
e = e.cfg;
return p.create({
ciphertext: b,
key: c,
iv: e.iv,
algorithm: a,
mode: e.mode,
padding: e.padding,
blockSize: a.blockSize,
formatter: d.format
})
},
decrypt: function(a, b, c, d) {
d = this.cfg.extend(d);
b = this._parse(b, d.format);
return a.createDecryptor(c, d).finalize(b.ciphertext)
},
_parse: function(a, b) {
return "string" == typeof a ? b.parse(a, this) : a
}
})
, g = (g.kdf = {}).OpenSSL = {
execute: function(a, b, c, d) {
d || (d = l.random(8));
a = v.create({
keySize: b + c
}).compute(a, d);
c = l.create(a.words.slice(b), 4 * c);
a.sigBytes = 4 * b;
return p.create({
key: a,
iv: c,
salt: d
})
}
}
, s = f.PasswordBasedCipher = j.extend({
cfg: j.cfg.extend({
kdf: g
}),
encrypt: function(a, b, c, d) {
d = this.cfg.extend(d);
c = d.kdf.execute(c, a.keySize, a.ivSize);
d.iv = c.iv;
a = j.encrypt.call(this, a, b, c.key, d);
a.mixIn(c);
return a
},
decrypt: function(a, b, c, d) {
d = this.cfg.extend(d);
b = this._parse(b, d.format);
c = d.kdf.execute(c, a.keySize, a.ivSize, b.salt);
d.iv = c.iv;
return j.decrypt.call(this, a, b, c.key, d)
}
})
}();
CryptoJS.mode.ECB = function() {
var a = CryptoJS.lib.BlockCipherMode.extend();
a.Encryptor = a.extend({
processBlock: function(a, b) {
this._cipher.encryptBlock(a, b)
}
});
a.Decryptor = a.extend({
processBlock: function(a, b) {
this._cipher.decryptBlock(a, b)
}
});
return a
}();
(function(E) {
function h(a, f, g, j, p, h, k) {
a = a + (f & g | ~f & j) + p + k;
return (a << h | a >>> 32 - h) + f
}
function k(a, f, g, j, p, h, k) {
a = a + (f & j | g & ~j) + p + k;
return (a << h | a >>> 32 - h) + f
}
function l(a, f, g, j, h, k, l) {
a = a + (f ^ g ^ j) + h + l;
return (a << k | a >>> 32 - k) + f
}
function n(a, f, g, j, h, k, l) {
a = a + (g ^ (f | ~j)) + h + l;
return (a << k | a >>> 32 - k) + f
}
for (var r = CryptoJS, q = r.lib, F = q.WordArray, s = q.Hasher, q = r.algo, a = [], t = 0; 64 > t; t++)
a[t] = 4294967296 * E.abs(E.sin(t + 1)) | 0;
q = q.MD5 = s.extend({
_doReset: function() {
this._hash = new F.init([1732584193, 4023233417, 2562383102, 271733878])
},
_doProcessBlock: function(m, f) {
for (var g = 0; 16 > g; g++) {
var j = f + g
, p = m[j];
m[j] = (p << 8 | p >>> 24) & 16711935 | (p << 24 | p >>> 8) & 4278255360
}
var g = this._hash.words
, j = m[f + 0]
, p = m[f + 1]
, q = m[f + 2]
, r = m[f + 3]
, s = m[f + 4]
, t = m[f + 5]
, u = m[f + 6]
, v = m[f + 7]
, w = m[f + 8]
, x = m[f + 9]
, y = m[f + 10]
, z = m[f + 11]
, A = m[f + 12]
, B = m[f + 13]
, C = m[f + 14]
, D = m[f + 15]
, b = g[0]
, c = g[1]
, d = g[2]
, e = g[3]
, b = h(b, c, d, e, j, 7, a[0])
, e = h(e, b, c, d, p, 12, a[1])
, d = h(d, e, b, c, q, 17, a[2])
, c = h(c, d, e, b, r, 22, a[3])
, b = h(b, c, d, e, s, 7, a[4])
, e = h(e, b, c, d, t, 12, a[5])
, d = h(d, e, b, c, u, 17, a[6])
, c = h(c, d, e, b, v, 22, a[7])
, b = h(b, c, d, e, w, 7, a[8])
, e = h(e, b, c, d, x, 12, a[9])
, d = h(d, e, b, c, y, 17, a[10])
, c = h(c, d, e, b, z, 22, a[11])
, b = h(b, c, d, e, A, 7, a[12])
, e = h(e, b, c, d, B, 12, a[13])
, d = h(d, e, b, c, C, 17, a[14])
, c = h(c, d, e, b, D, 22, a[15])
, b = k(b, c, d, e, p, 5, a[16])
, e = k(e, b, c, d, u, 9, a[17])
, d = k(d, e, b, c, z, 14, a[18])
, c = k(c, d, e, b, j, 20, a[19])
, b = k(b, c, d, e, t, 5, a[20])
, e = k(e, b, c, d, y, 9, a[21])
, d = k(d, e, b, c, D, 14, a[22])
, c = k(c, d, e, b, s, 20, a[23])
, b = k(b, c, d, e, x, 5, a[24])
, e = k(e, b, c, d, C, 9, a[25])
, d = k(d, e, b, c, r, 14, a[26])
, c = k(c, d, e, b, w, 20, a[27])
, b = k(b, c, d, e, B, 5, a[28])
, e = k(e, b, c, d, q, 9, a[29])
, d = k(d, e, b, c, v, 14, a[30])
, c = k(c, d, e, b, A, 20, a[31])
, b = l(b, c, d, e, t, 4, a[32])
, e = l(e, b, c, d, w, 11, a[33])
, d = l(d, e, b, c, z, 16, a[34])
, c = l(c, d, e, b, C, 23, a[35])
, b = l(b, c, d, e, p, 4, a[36])
, e = l(e, b, c, d, s, 11, a[37])
, d = l(d, e, b, c, v, 16, a[38])
, c = l(c, d, e, b, y, 23, a[39])
, b = l(b, c, d, e, B, 4, a[40])
, e = l(e, b, c, d, j, 11, a[41])
, d = l(d, e, b, c, r, 16, a[42])
, c = l(c, d, e, b, u, 23, a[43])
, b = l(b, c, d, e, x, 4, a[44])
, e = l(e, b, c, d, A, 11, a[45])
, d = l(d, e, b, c, D, 16, a[46])
, c = l(c, d, e, b, q, 23, a[47])
, b = n(b, c, d, e, j, 6, a[48])
, e = n(e, b, c, d, v, 10, a[49])
, d = n(d, e, b, c, C, 15, a[50])
, c = n(c, d, e, b, t, 21, a[51])
, b = n(b, c, d, e, A, 6, a[52])
, e = n(e, b, c, d, r, 10, a[53])
, d = n(d, e, b, c, y, 15, a[54])
, c = n(c, d, e, b, p, 21, a[55])
, b = n(b, c, d, e, w, 6, a[56])
, e = n(e, b, c, d, D, 10, a[57])
, d = n(d, e, b, c, u, 15, a[58])
, c = n(c, d, e, b, B, 21, a[59])
, b = n(b, c, d, e, s, 6, a[60])
, e = n(e, b, c, d, z, 10, a[61])
, d = n(d, e, b, c, q, 15, a[62])
, c = n(c, d, e, b, x, 21, a[63]);
g[0] = g[0] + b | 0;
g[1] = g[1] + c | 0;
g[2] = g[2] + d | 0;
g[3] = g[3] + e | 0
},
_doFinalize: function() {
var a = this._data
, f = a.words
, g = 8 * this._nDataBytes
, j = 8 * a.sigBytes;
f[j >>> 5] |= 128 << 24 - j % 32;
var h = E.floor(g / 4294967296);
f[(j + 64 >>> 9 << 4) + 15] = (h << 8 | h >>> 24) & 16711935 | (h << 24 | h >>> 8) & 4278255360;
f[(j + 64 >>> 9 << 4) + 14] = (g << 8 | g >>> 24) & 16711935 | (g << 24 | g >>> 8) & 4278255360;
a.sigBytes = 4 * (f.length + 1);
this._process();
a = this._hash;
f = a.words;
for (g = 0; 4 > g; g++)
j = f[g],
f[g] = (j << 8 | j >>> 24) & 16711935 | (j << 24 | j >>> 8) & 4278255360;
return a
},
clone: function() {
var a = s.clone.call(this);
a._hash = this._hash.clone();
return a
}
});
r.MD5 = s._createHelper(q);
r.HmacMD5 = s._createHmacHelper(q)
}
)(Math);
(function() {
for (var q = CryptoJS, x = q.lib.BlockCipher, r = q.algo, j = [], y = [], z = [], A = [], B = [], C = [], s = [], u = [], v = [], w = [], g = [], k = 0; 256 > k; k++)
g[k] = 128 > k ? k << 1 : k << 1 ^ 283;
for (var n = 0, l = 0, k = 0; 256 > k; k++) {
var f = l ^ l << 1 ^ l << 2 ^ l << 3 ^ l << 4
, f = f >>> 8 ^ f & 255 ^ 99;
j[n] = f;
y[f] = n;
var t = g[n]
, D = g[t]
, E = g[D]
, b = 257 * g[f] ^ 16843008 * f;
z[n] = b << 24 | b >>> 8;
A[n] = b << 16 | b >>> 16;
B[n] = b << 8 | b >>> 24;
C[n] = b;
b = 16843009 * E ^ 65537 * D ^ 257 * t ^ 16843008 * n;
s[f] = b << 24 | b >>> 8;
u[f] = b << 16 | b >>> 16;
v[f] = b << 8 | b >>> 24;
w[f] = b;
n ? (n = t ^ g[g[g[E ^ t]]],
l ^= g[g[l]]) : n = l = 1
}
var F = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54]
, r = r.AES = x.extend({
_doReset: function() {
for (var c = this._key, e = c.words, a = c.sigBytes / 4, c = 4 * ((this._nRounds = a + 6) + 1), b = this._keySchedule = [], h = 0; h < c; h++)
if (h < a)
b[h] = e[h];
else {
var d = b[h - 1];
h % a ? 6 < a && 4 == h % a && (d = j[d >>> 24] << 24 | j[d >>> 16 & 255] << 16 | j[d >>> 8 & 255] << 8 | j[d & 255]) : (d = d << 8 | d >>> 24,
d = j[d >>> 24] << 24 | j[d >>> 16 & 255] << 16 | j[d >>> 8 & 255] << 8 | j[d & 255],
d ^= F[h / a | 0] << 24);
b[h] = b[h - a] ^ d
}
e = this._invKeySchedule = [];
for (a = 0; a < c; a++)
h = c - a,
d = a % 4 ? b[h] : b[h - 4],
e[a] = 4 > a || 4 >= h ? d : s[j[d >>> 24]] ^ u[j[d >>> 16 & 255]] ^ v[j[d >>> 8 & 255]] ^ w[j[d & 255]]
},
encryptBlock: function(c, e) {
this._doCryptBlock(c, e, this._keySchedule, z, A, B, C, j)
},
decryptBlock: function(c, e) {
var a = c[e + 1];
c[e + 1] = c[e + 3];
c[e + 3] = a;
this._doCryptBlock(c, e, this._invKeySchedule, s, u, v, w, y);
a = c[e + 1];
c[e + 1] = c[e + 3];
c[e + 3] = a
},
_doCryptBlock: function(c, e, a, b, h, d, j, m) {
for (var n = this._nRounds, f = c[e] ^ a[0], g = c[e + 1] ^ a[1], k = c[e + 2] ^ a[2], p = c[e + 3] ^ a[3], l = 4, t = 1; t < n; t++)
var q = b[f >>> 24] ^ h[g >>> 16 & 255] ^ d[k >>> 8 & 255] ^ j[p & 255] ^ a[l++]
, r = b[g >>> 24] ^ h[k >>> 16 & 255] ^ d[p >>> 8 & 255] ^ j[f & 255] ^ a[l++]
, s = b[k >>> 24] ^ h[p >>> 16 & 255] ^ d[f >>> 8 & 255] ^ j[g & 255] ^ a[l++]
, p = b[p >>> 24] ^ h[f >>> 16 & 255] ^ d[g >>> 8 & 255] ^ j[k & 255] ^ a[l++]
, f = q
, g = r
, k = s;
q = (m[f >>> 24] << 24 | m[g >>> 16 & 255] << 16 | m[k >>> 8 & 255] << 8 | m[p & 255]) ^ a[l++];
r = (m[g >>> 24] << 24 | m[k >>> 16 & 255] << 16 | m[p >>> 8 & 255] << 8 | m[f & 255]) ^ a[l++];
s = (m[k >>> 24] << 24 | m[p >>> 16 & 255] << 16 | m[f >>> 8 & 255] << 8 | m[g & 255]) ^ a[l++];
p = (m[p >>> 24] << 24 | m[f >>> 16 & 255] << 16 | m[g >>> 8 & 255] << 8 | m[k & 255]) ^ a[l++];
c[e] = q;
c[e + 1] = r;
c[e + 2] = s;
c[e + 3] = p
},
keySize: 8
});
q.AES = x._createHelper(r)
}
)();
(function() {
function j(b, c) {
var a = (this._lBlock >>> b ^ this._rBlock) & c;
this._rBlock ^= a;
this._lBlock ^= a << b
}
function l(b, c) {
var a = (this._rBlock >>> b ^ this._lBlock) & c;
this._lBlock ^= a;
this._rBlock ^= a << b
}
var h = CryptoJS
, e = h.lib
, n = e.WordArray
, e = e.BlockCipher
, g = h.algo
, q = [57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4]
, p = [14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32]
, r = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28]
, s = [{
"0": 8421888,
268435456: 32768,
536870912: 8421378,
805306368: 2,
1073741824: 512,
1342177280: 8421890,
1610612736: 8389122,
1879048192: 8388608,
2147483648: 514,
2415919104: 8389120,
2684354560: 33280,
2952790016: 8421376,
3221225472: 32770,
3489660928: 8388610,
3758096384: 0,
4026531840: 33282,
134217728: 0,
402653184: 8421890,
671088640: 33282,
939524096: 32768,
1207959552: 8421888,
1476395008: 512,
1744830464: 8421378,
2013265920: 2,
2281701376: 8389120,
2550136832: 33280,
2818572288: 8421376,
3087007744: 8389122,
3355443200: 8388610,
3623878656: 32770,
3892314112: 514,
4160749568: 8388608,
1: 32768,
268435457: 2,
536870913: 8421888,
805306369: 8388608,
1073741825: 8421378,
1342177281: 33280,
1610612737: 512,
1879048193: 8389122,
2147483649: 8421890,
2415919105: 8421376,
2684354561: 8388610,
2952790017: 33282,
3221225473: 514,
3489660929: 8389120,
3758096385: 32770,
4026531841: 0,
134217729: 8421890,
402653185: 8421376,
671088641: 8388608,
939524097: 512,
1207959553: 32768,
1476395009: 8388610,
1744830465: 2,
2013265921: 33282,
2281701377: 32770,
2550136833: 8389122,
2818572289: 514,
3087007745: 8421888,
3355443201: 8389120,
3623878657: 0,
3892314113: 33280,
4160749569: 8421378
}, {
"0": 1074282512,
16777216: 16384,
33554432: 524288,
50331648: 1074266128,
67108864: 1073741840,
83886080: 1074282496,
100663296: 1073758208,
117440512: 16,
134217728: 540672,
150994944: 1073758224,
167772160: 1073741824,
184549376: 540688,
201326592: 524304,
218103808: 0,
234881024: 16400,
251658240: 1074266112,
8388608: 1073758208,
25165824: 540688,
41943040: 16,
58720256: 1073758224,
75497472: 1074282512,
92274688: 1073741824,
109051904: 524288,
125829120: 1074266128,
142606336: 524304,
159383552: 0,
176160768: 16384,
192937984: 1074266112,
209715200: 1073741840,
226492416: 540672,
243269632: 1074282496,
260046848: 16400,
268435456: 0,
285212672: 1074266128,
301989888: 1073758224,
318767104: 1074282496,
335544320: 1074266112,
352321536: 16,
369098752: 540688,
385875968: 16384,
402653184: 16400,
419430400: 524288,
436207616: 524304,
452984832: 1073741840,
469762048: 540672,
486539264: 1073758208,
503316480: 1073741824,
520093696: 1074282512,
276824064: 540688,
293601280: 524288,
310378496: 1074266112,
327155712: 16384,
343932928: 1073758208,
360710144: 1074282512,
377487360: 16,
394264576: 1073741824,
411041792: 1074282496,
427819008: 1073741840,
444596224: 1073758224,
461373440: 524304,
478150656: 0,
494927872: 16400,
511705088: 1074266128,
528482304: 540672
}, {
"0": 260,
1048576: 0,
2097152: 67109120,
3145728: 65796,
4194304: 65540,
5242880: 67108868,
6291456: 67174660,
7340032: 67174400,
8388608: 67108864,
9437184: 67174656,
10485760: 65792,
11534336: 67174404,
12582912: 67109124,
13631488: 65536,
14680064: 4,
15728640: 256,
524288: 67174656,
1572864: 67174404,
2621440: 0,
3670016: 67109120,
4718592: 67108868,
5767168: 65536,
6815744: 65540,
7864320: 260,
8912896: 4,
9961472: 256,
11010048: 67174400,
12058624: 65796,
13107200: 65792,
14155776: 67109124,
15204352: 67174660,
16252928: 67108864,
16777216: 67174656,
17825792: 65540,
18874368: 65536,
19922944: 67109120,
20971520: 256,
22020096: 67174660,
23068672: 67108868,
24117248: 0,
25165824: 67109124,
26214400: 67108864,
27262976: 4,
28311552: 65792,
29360128: 67174400,
30408704: 260,
31457280: 65796,
32505856: 67174404,
17301504: 67108864,
18350080: 260,
19398656: 67174656,
20447232: 0,
21495808: 65540,
22544384: 67109120,
23592960: 256,
24641536: 67174404,
25690112: 65536,
26738688: 67174660,
27787264: 65796,
28835840: 67108868,
29884416: 67109124,
30932992: 67174400,
31981568: 4,
33030144: 65792
}, {
"0": 2151682048,
65536: 2147487808,
131072: 4198464,
196608: 2151677952,
262144: 0,
327680: 4198400,
393216: 2147483712,
458752: 4194368,
524288: 2147483648,
589824: 4194304,
655360: 64,
720896: 2147487744,
786432: 2151678016,
851968: 4160,
917504: 4096,
983040: 2151682112,
32768: 2147487808,
98304: 64,
163840: 2151678016,
229376: 2147487744,
294912: 4198400,
360448: 2151682112,
425984: 0,
491520: 2151677952,
557056: 4096,
622592: 2151682048,
688128: 4194304,
753664: 4160,
819200: 2147483648,
884736: 4194368,
950272: 4198464,
1015808: 2147483712,
1048576: 4194368,
1114112: 4198400,
1179648: 2147483712,
1245184: 0,
1310720: 4160,
1376256: 2151678016,
1441792: 2151682048,
1507328: 2147487808,
1572864: 2151682112,
1638400: 2147483648,
1703936: 2151677952,
1769472: 4198464,
1835008: 2147487744,
1900544: 4194304,
1966080: 64,
2031616: 4096,
1081344: 2151677952,
1146880: 2151682112,
1212416: 0,
1277952: 4198400,
1343488: 4194368,
1409024: 2147483648,
1474560: 2147487808,
1540096: 64,
1605632: 2147483712,
1671168: 4096,
1736704: 2147487744,
1802240: 2151678016,
1867776: 4160,
1933312: 2151682048,
1998848: 4194304,
2064384: 4198464
}, {
"0": 128,
4096: 17039360,
8192: 262144,
12288: 536870912,
16384: 537133184,
20480: 16777344,
24576: 553648256,
28672: 262272,
32768: 16777216,
36864: 537133056,
40960: 536871040,
45056: 553910400,
49152: 553910272,
53248: 0,
57344: 17039488,
61440: 553648128,
2048: 17039488,
6144: 553648256,
10240: 128,
14336: 17039360,
18432: 262144,
22528: 537133184,
26624: 553910272,
30720: 536870912,
34816: 537133056,
38912: 0,
43008: 553910400,
47104: 16777344,
51200: 536871040,
55296: 553648128,
59392: 16777216,
63488: 262272,
65536: 262144,
69632: 128,
73728: 536870912,
77824: 553648256,
81920: 16777344,
86016: 553910272,
90112: 537133184,
94208: 16777216,
98304: 553910400,
102400: 553648128,
106496: 17039360,
110592: 537133056,
114688: 262272,
118784: 536871040,
122880: 0,
126976: 17039488,
67584: 553648256,
71680: 16777216,
75776: 17039360,
79872: 537133184,
83968: 536870912,
88064: 17039488,
92160: 128,
96256: 553910272,
100352: 262272,
104448: 553910400,
108544: 0,
112640: 553648128,
116736: 16777344,
120832: 262144,
124928: 537133056,
129024: 536871040
}, {
"0": 268435464,
256: 8192,
512: 270532608,
768: 270540808,
1024: 268443648,
1280: 2097152,
1536: 2097160,
1792: 268435456,
2048: 0,
2304: 268443656,
2560: 2105344,
2816: 8,
3072: 270532616,
3328: 2105352,
3584: 8200,
3840: 270540800,
128: 270532608,
384: 270540808,
640: 8,
896: 2097152,
1152: 2105352,
1408: 268435464,
1664: 268443648,
1920: 8200,
2176: 2097160,
2432: 8192,
2688: 268443656,
2944: 270532616,
3200: 0,
3456: 270540800,
3712: 2105344,
3968: 268435456,
4096: 268443648,
4352: 270532616,
4608: 270540808,
4864: 8200,
5120: 2097152,
5376: 268435456,
5632: 268435464,
5888: 2105344,
6144: 2105352,
6400: 0,
6656: 8,
6912: 270532608,
7168: 8192,
7424: 268443656,
7680: 270540800,
7936: 2097160,
4224: 8,
4480: 2105344,
4736: 2097152,
4992: 268435464,
5248: 268443648,
5504: 8200,
5760: 270540808,
6016: 270532608,
6272: 270540800,
6528: 270532616,
6784: 8192,
7040: 2105352,
7296: 2097160,
7552: 0,
7808: 268435456,
8064: 268443656
}, {
"0": 1048576,
16: 33555457,
32: 1024,
48: 1049601,
64: 34604033,
80: 0,
96: 1,
112: 34603009,
128: 33555456,
144: 1048577,
160: 33554433,
176: 34604032,
192: 34603008,
208: 1025,
224: 1049600,
240: 33554432,
8: 34603009,
24: 0,
40: 33555457,
56: 34604032,
72: 1048576,
88: 33554433,
104: 33554432,
120: 1025,
136: 1049601,
152: 33555456,
168: 34603008,
184: 1048577,
200: 1024,
216: 34604033,
232: 1,
248: 1049600,
256: 33554432,
272: 1048576,
288: 33555457,
304: 34603009,
320: 1048577,
336: 33555456,
352: 34604032,
368: 1049601,
384: 1025,
400: 34604033,
416: 1049600,
432: 1,
448: 0,
464: 34603008,
480: 33554433,
496: 1024,
264: 1049600,
280: 33555457,
296: 34603009,
312: 1,
328: 33554432,
344: 1048576,
360: 1025,
376: 34604032,
392: 33554433,
408: 34603008,
424: 0,
440: 34604033,
456: 1049601,
472: 1024,
488: 33555456,
504: 1048577
}, {
"0": 134219808,
1: 131072,
2: 134217728,
3: 32,
4: 131104,
5: 134350880,
6: 134350848,
7: 2048,
8: 134348800,
9: 134219776,
10: 133120,
11: 134348832,
12: 2080,
13: 0,
14: 134217760,
15: 133152,
2147483648: 2048,
2147483649: 134350880,
2147483650: 134219808,
2147483651: 134217728,
2147483652: 134348800,
2147483653: 133120,
2147483654: 133152,
2147483655: 32,
2147483656: 134217760,
2147483657: 2080,
2147483658: 131104,
2147483659: 134350848,
2147483660: 0,
2147483661: 134348832,
2147483662: 134219776,
2147483663: 131072,
16: 133152,
17: 134350848,
18: 32,
19: 2048,
20: 134219776,
21: 134217760,
22: 134348832,
23: 131072,
24: 0,
25: 131104,
26: 134348800,
27: 134219808,
28: 134350880,
29: 133120,
30: 2080,
31: 134217728,
2147483664: 131072,
2147483665: 2048,
2147483666: 134348832,
2147483667: 133152,
2147483668: 32,
2147483669: 134348800,
2147483670: 134217728,
2147483671: 134219808,
2147483672: 134350880,
2147483673: 134217760,
2147483674: 134219776,
2147483675: 0,
2147483676: 133120,
2147483677: 2080,
2147483678: 131104,
2147483679: 134350848
}]
, t = [4160749569, 528482304, 33030144, 2064384, 129024, 8064, 504, 2147483679]
, m = g.DES = e.extend({
_doReset: function() {
for (var b = this._key.words, c = [], a = 0; 56 > a; a++) {
var f = q[a] - 1;
c[a] = b[f >>> 5] >>> 31 - f % 32 & 1
}
b = this._subKeys = [];
for (f = 0; 16 > f; f++) {
for (var d = b[f] = [], e = r[f], a = 0; 24 > a; a++)
d[a / 6 | 0] |= c[(p[a] - 1 + e) % 28] << 31 - a % 6,
d[4 + (a / 6 | 0)] |= c[28 + (p[a + 24] - 1 + e) % 28] << 31 - a % 6;
d[0] = d[0] << 1 | d[0] >>> 31;
for (a = 1; 7 > a; a++)
d[a] >>>= 4 * (a - 1) + 3;
d[7] = d[7] << 5 | d[7] >>> 27
}
c = this._invSubKeys = [];
for (a = 0; 16 > a; a++)
c[a] = b[15 - a]
},
encryptBlock: function(b, c) {
this._doCryptBlock(b, c, this._subKeys)
},
decryptBlock: function(b, c) {
this._doCryptBlock(b, c, this._invSubKeys)
},
_doCryptBlock: function(b, c, a) {
this._lBlock = b[c];
this._rBlock = b[c + 1];
j.call(this, 4, 252645135);
j.call(this, 16, 65535);
l.call(this, 2, 858993459);
l.call(this, 8, 16711935);
j.call(this, 1, 1431655765);
for (var f = 0; 16 > f; f++) {
for (var d = a[f], e = this._lBlock, h = this._rBlock, g = 0, k = 0; 8 > k; k++)
g |= s[k][((h ^ d[k]) & t[k]) >>> 0];
this._lBlock = h;
this._rBlock = e ^ g
}
a = this._lBlock;
this._lBlock = this._rBlock;
this._rBlock = a;
j.call(this, 1, 1431655765);
l.call(this, 8, 16711935);
l.call(this, 2, 858993459);
j.call(this, 16, 65535);
j.call(this, 4, 252645135);
b[c] = this._lBlock;
b[c + 1] = this._rBlock
},
keySize: 2,
ivSize: 2,
blockSize: 2
});
h.DES = e._createHelper(m);
g = g.TripleDES = e.extend({
_doReset: function() {
var b = this._key.words;
this._des1 = m.createEncryptor(n.create(b.slice(0, 2)));
this._des2 = m.createEncryptor(n.create(b.slice(2, 4)));
this._des3 = m.createEncryptor(n.create(b.slice(4, 6)))
},
encryptBlock: function(b, c) {
this._des1.encryptBlock(b, c);
this._des2.decryptBlock(b, c);
this._des3.encryptBlock(b, c)
},
decryptBlock: function(b, c) {
this._des3.decryptBlock(b, c);
this._des2.encryptBlock(b, c);
this._des1.decryptBlock(b, c)
},
keySize: 6,
ivSize: 2,
blockSize: 2
});
h.TripleDES = e._createHelper(g)
}
)();

module.exports = {
hex_md5
}