-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathysy.js
43 lines (38 loc) · 912 Bytes
/
ysy.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
let crypto = require('crypto-js')
function __getData(t) {
var e = t.data
, n = t.type
, a = t.param
, r = t.key
, o = JSON.parse(JSON.stringify(e));
return "Base64" === n ? a.forEach((function(t) {
o[t] = btoa(o[t])
}
)) : a.forEach((function(t) {
var e = o[t];
r = crypto.enc.Latin1.parse(r);
var n = r
, a = crypto.AES.encrypt(e, r, {
iv: n,
mode: crypto.mode.CBC,
padding: crypto.pad.ZeroPadding
});
o[t] = a.toString()
}
)),
o
}
function getData(account,pswd,redomStr){
return __getData({
"data": {
"username": account,
"password": pswd,
"redomStr": redomStr
},
"key": "password.yunjy.y",
"param": [
"password"
]
})
}
console.log(getData('15312341234','asda1348315135153'))