爬虫逆向实战(36)-某建设监管平台(RSA,魔改)
const JSEncrypt = require('jsencrypt');
const G_e = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC29miF1Wp9XlhCECo+FYpCHad1ipEMgXf4IdgYjMIQwczzo9GXdcZ4eeV+9lkh6+aTqzzU843rdkMt0vrSnujU+GOuDPLfa5LZ6SfanAoysi6xxTX02Xizb3k+Z1USIzm9QAwE+SR1AQ78rGTRFHWFu7OGPkVNeF+vrX3inQTiawIDAQAB";
function Jbe(e) {
var t = n7(e)
, n = t[0]
, o = t[1];
return (n + o) * 3 / 4 - o
}
function exe(e) {
var t, n = n7(e), o = n[0], r = n[1], s = new Xbe(Qbe(e, o, r)), a = 0, l = r > 0 ? o - 4 : o, i;
for (i = 0; i < l; i += 4)
t = oo[e.charCodeAt(i)] << 18 | oo[e.charCodeAt(i + 1)] << 12 | oo[e.charCodeAt(i + 2)] << 6 | oo[e.charCodeAt(i + 3)],
s[a++] = t >> 16 & 255,
s[a++] = t >> 8 & 255,
s[a++] = t & 255;
return r === 2 && (t = oo[e.charCodeAt(i)] << 2 | oo[e.charCodeAt(i + 1)] >> 4,
s[a++] = t & 255),
r === 1 && (t = oo[e.charCodeAt(i)] << 10 | oo[e.charCodeAt(i + 1)] << 4 | oo[e.charCodeAt(i + 2)] >> 2,
s[a++] = t >> 8 & 255,
s[a++] = t & 255),
s
}
function txe(e) {
return Vo[e >> 18 & 63] + Vo[e >> 12 & 63] + Vo[e >> 6 & 63] + Vo[e & 63]
}
function nxe(e, t, n) {
for (var o, r = [], s = t; s < n; s += 3)
o = (e[s] << 16 & 16711680) + (e[s + 1] << 8 & 65280) + (e[s + 2] & 255),
r.push(txe(o));
return r.join("")
}
function oxe(e) {
for (var t, n = e.length, o = n % 3, r = [], s = 16383, a = 0, l = n - o; a < l; a += s)
r.push(nxe(e, a, a + s > l ? l : a + s));
return o === 1 ? (t = e[n - 1],
r.push(Vo[t >> 2] + Vo[t << 4 & 63] + "==")) : o === 2 && (t = (e[n - 2] << 8) + e[n - 1],
r.push(Vo[t >> 10] + Vo[t >> 4 & 63] + Vo[t << 2 & 63] + "=")),
r.join("")
}
var jc = {};
jc.byteLength = Jbe;
jc.toByteArray = exe;
jc.fromByteArray = oxe;
const O6 = jc;
var Vo = []
, oo = []
, Xbe = typeof Uint8Array != "undefined" ? Uint8Array : Array
, Lu = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
for (var js = 0, Zbe = Lu.length; js < Zbe; ++js)
Vo[js] = Lu[js],
oo[Lu.charCodeAt(js)] = js;
class V_e {
static stringToArrayBufferInUtf8(t) {
const n = typeof window == "undefined" ? yd.TextEncoder : window.TextEncoder;
return new n().encode(t)
}
static utf8ArrayBufferToString(t) {
const n = typeof window == "undefined" ? yd.TextDecoder : window.TextDecoder;
return new n("utf-8").decode(t)
}
static arrayBufferToBase64(t) {
return O6.fromByteArray(t)
}
static base64ToArrayBuffer(t) {
return O6.toByteArray(t)
}
}
const Sr = V_e
, to = 16
, Di = Uint8Array.from([214, 144, 233, 254, 204, 225, 61, 183, 22, 182, 20, 194, 40, 251, 44, 5, 43, 103, 154, 118, 42, 190, 4, 195, 170, 68, 19, 38, 73, 134, 6, 153, 156, 66, 80, 244, 145, 239, 152, 122, 51, 84, 11, 67, 237, 207, 172, 98, 228, 179, 28, 169, 201, 8, 232, 149, 128, 223, 148, 250, 117, 143, 63, 166, 71, 7, 167, 252, 243, 115, 23, 186, 131, 89, 60, 25, 230, 133, 79, 168, 104, 107, 129, 178, 113, 100, 218, 139, 248, 235, 15, 75, 112, 86, 157, 53, 30, 36, 14, 94, 99, 88, 209, 162, 37, 34, 124, 59, 1, 33, 120, 135, 212, 0, 70, 87, 159, 211, 39, 82, 76, 54, 2, 231, 160, 196, 200, 158, 234, 191, 138, 210, 64, 199, 56, 181, 163, 247, 242, 206, 249, 97, 21, 161, 224, 174, 93, 164, 155, 52, 26, 85, 173, 147, 50, 48, 245, 140, 177, 227, 29, 246, 226, 46, 130, 102, 202, 96, 192, 41, 35, 171, 13, 83, 78, 111, 213, 219, 55, 69, 222, 253, 142, 47, 3, 255, 106, 114, 109, 108, 91, 81, 141, 27, 175, 146, 187, 221, 188, 127, 17, 217, 92, 65, 31, 16, 90, 216, 10, 193, 49, 136, 165, 205, 123, 189, 45, 116, 208, 18, 184, 229, 180, 176, 137, 105, 151, 74, 12, 150, 119, 126, 101, 185, 241, 9, 197, 110, 198, 132, 24, 240, 125, 236, 58, 220, 77, 32, 121, 238, 95, 62, 215, 203, 57, 72])
, L_e = Uint32Array.from([462357, 472066609, 943670861, 1415275113, 1886879365, 2358483617, 2830087869, 3301692121, 3773296373, 4228057617, 404694573, 876298825, 1347903077, 1819507329, 2291111581, 2762715833, 3234320085, 3705924337, 4177462797, 337322537, 808926789, 1280531041, 1752135293, 2223739545, 2695343797, 3166948049, 3638552301, 4110090761, 269950501, 741554753, 1213159005, 1684763257])
, Oi = Uint32Array.from([2746333894, 1453994832, 1736282519, 2993693404]);
class R_e {
constructor(t) {
let n = Sr.stringToArrayBufferInUtf8(t.key);
if (n.length !== 16)
throw new Error("key should be a 16 bytes string");
this.key = n;
let o = new Uint8Array(0);
if (t.iv !== void 0 && t.iv !== null && (o = Sr.stringToArrayBufferInUtf8(t.iv),
o.length !== 16))
throw new Error("iv should be a 16 bytes string");
this.iv = o,
this.mode = "cbc",
["cbc", "ecb"].indexOf(t.mode) >= 0 && (this.mode = t.mode),
this.cipherType = "base64",
["base64", "text"].indexOf(t.outType) >= 0 && (this.cipherType = t.outType),
this.encryptRoundKeys = new Uint32Array(32),
this.spawnEncryptRoundKeys(),
this.decryptRoundKeys = Uint32Array.from(this.encryptRoundKeys),
this.decryptRoundKeys.reverse()
}
doBlockCrypt(t, n) {
let o = new Uint32Array(36);
o.set(t, 0);
for (let s = 0; s < 32; s++)
o[s + 4] = o[s] ^ this.tTransform1(o[s + 1] ^ o[s + 2] ^ o[s + 3] ^ n[s]);
let r = new Uint32Array(4);
return r[0] = o[35],
r[1] = o[34],
r[2] = o[33],
r[3] = o[32],
r
}
spawnEncryptRoundKeys() {
let t = new Uint32Array(4);
t[0] = this.key[0] << 24 | this.key[1] << 16 | this.key[2] << 8 | this.key[3],
t[1] = this.key[4] << 24 | this.key[5] << 16 | this.key[6] << 8 | this.key[7],
t[2] = this.key[8] << 24 | this.key[9] << 16 | this