fhrons-mobile-next 2.0.4 → 2.0.6-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/js/crypto/config.js +5 -0
- package/assets/js/crypto/index.js +10 -0
- package/assets/js/crypto/legacy.cjs +558 -0
- package/assets/vantLang/locales/zh_CN.js +1 -1
- package/fhcommon/dist/fhcommon.min.js +2 -1
- package/fhcommon/upload.js +6 -10
- package/index.js +2 -0
- package/package.json +3 -1
- package/plugins/sensors/sensorsFun.js +2 -2
- package/tests/crypto-vectors.json +46 -0
- package/tests/crypto.cjs +90 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// 2026/10/27 gongml [需求 待补充] 导出本地加解密并在模块加载时兼容存量页面的全局调用
|
|
2
|
+
import FHEncrypt from './legacy.cjs';
|
|
3
|
+
|
|
4
|
+
if (typeof window !== 'undefined') {
|
|
5
|
+
window.FHENCYPT = FHEncrypt;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const encrypt = FHEncrypt.encrypt;
|
|
9
|
+
export const decrypt = FHEncrypt.decrypt;
|
|
10
|
+
export default FHEncrypt;
|
|
@@ -0,0 +1,558 @@
|
|
|
1
|
+
// 2026/10/27 gongml [需求 待补充] 使用.cjs保留原UMD的CommonJS语义,避免Babel注入ESM导致导出丢失
|
|
2
|
+
// 2026/10/27 gongml [需求 待补充] 保留生产与UAT一致的原始SM4协议,密钥统一读取本地配置
|
|
3
|
+
const cryptoConfig = require('./config');
|
|
4
|
+
!function(t, e) {
|
|
5
|
+
"object" == typeof exports && "object" == typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define("FHENCYPT", [], e) : "object" == typeof exports ? exports.FHENCYPT = e() : t.FHENCYPT = e()
|
|
6
|
+
}("undefined" != typeof self ? self : this, ( () => ( () => {
|
|
7
|
+
"use strict";
|
|
8
|
+
var t = {
|
|
9
|
+
287: (t, e, n) => {
|
|
10
|
+
function r() {
|
|
11
|
+
this.mode = 1,
|
|
12
|
+
this.isPadding = !0,
|
|
13
|
+
this.sk = new Array(32)
|
|
14
|
+
}
|
|
15
|
+
function s() {
|
|
16
|
+
this.SM4_ENCRYPT = 1,
|
|
17
|
+
this.SM4_DECRYPT = 0;
|
|
18
|
+
const t = [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]
|
|
19
|
+
, e = [2746333894, 1453994832, 1736282519, 2993693404]
|
|
20
|
+
, n = [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];
|
|
21
|
+
this.GET_ULONG_BE = function(t, e) {
|
|
22
|
+
return (255 & t[e]) << 24 | (255 & t[e + 1]) << 16 | (255 & t[e + 2]) << 8 | 255 & t[e + 3]
|
|
23
|
+
}
|
|
24
|
+
,
|
|
25
|
+
this.PUT_ULONG_BE = function(t, e, n) {
|
|
26
|
+
var r = 255 & t >> 24
|
|
27
|
+
, s = 255 & t >> 16
|
|
28
|
+
, i = 255 & t >> 8
|
|
29
|
+
, o = 255 & t;
|
|
30
|
+
e[n] = r > 128 ? r - 256 : r,
|
|
31
|
+
e[n + 1] = s > 128 ? s - 256 : s,
|
|
32
|
+
e[n + 2] = i > 128 ? i - 256 : i,
|
|
33
|
+
e[n + 3] = o > 128 ? o - 256 : o
|
|
34
|
+
}
|
|
35
|
+
,
|
|
36
|
+
this.SHL = function(t, e) {
|
|
37
|
+
return (4294967295 & t) << e
|
|
38
|
+
}
|
|
39
|
+
,
|
|
40
|
+
this.ROTL = function(t, e) {
|
|
41
|
+
return this.SHL(t, e) | t >> 32 - e
|
|
42
|
+
}
|
|
43
|
+
,
|
|
44
|
+
this.sm4Lt = function(t) {
|
|
45
|
+
let e, n;
|
|
46
|
+
const r = new Array(4)
|
|
47
|
+
, s = new Array(4);
|
|
48
|
+
return this.PUT_ULONG_BE(t, r, 0),
|
|
49
|
+
s[0] = this.sm4Sbox(r[0]),
|
|
50
|
+
s[1] = this.sm4Sbox(r[1]),
|
|
51
|
+
s[2] = this.sm4Sbox(r[2]),
|
|
52
|
+
s[3] = this.sm4Sbox(r[3]),
|
|
53
|
+
e = this.GET_ULONG_BE(s, 0),
|
|
54
|
+
n = e ^ this.ROTL(e, 2) ^ this.ROTL(e, 10) ^ this.ROTL(e, 18) ^ this.ROTL(e, 24),
|
|
55
|
+
n
|
|
56
|
+
}
|
|
57
|
+
,
|
|
58
|
+
this.sm4F = function(t, e, n, r, s) {
|
|
59
|
+
return t ^ this.sm4Lt(e ^ n ^ r ^ s)
|
|
60
|
+
}
|
|
61
|
+
,
|
|
62
|
+
this.sm4CalciRK = function(t) {
|
|
63
|
+
let e, n;
|
|
64
|
+
const r = new Array(4)
|
|
65
|
+
, s = new Array(4);
|
|
66
|
+
return this.PUT_ULONG_BE(t, r, 0),
|
|
67
|
+
s[0] = this.sm4Sbox(r[0]),
|
|
68
|
+
s[1] = this.sm4Sbox(r[1]),
|
|
69
|
+
s[2] = this.sm4Sbox(r[2]),
|
|
70
|
+
s[3] = this.sm4Sbox(r[3]),
|
|
71
|
+
e = this.GET_ULONG_BE(s, 0),
|
|
72
|
+
n = e ^ this.ROTL(e, 13) ^ this.ROTL(e, 23),
|
|
73
|
+
n
|
|
74
|
+
}
|
|
75
|
+
,
|
|
76
|
+
this.sm4Sbox = function(e) {
|
|
77
|
+
const n = t[255 & e];
|
|
78
|
+
return n > 128 ? n - 256 : n
|
|
79
|
+
}
|
|
80
|
+
,
|
|
81
|
+
this.sm4_setkey_enc = function(t, e) {
|
|
82
|
+
return null == t ? (alert("ctx is null!"),
|
|
83
|
+
!1) : null == e || 16 !== e.length ? (alert("key error!"),
|
|
84
|
+
!1) : (t.mode = this.SM4_ENCRYPT,
|
|
85
|
+
void this.sm4_setkey(t.sk, e))
|
|
86
|
+
}
|
|
87
|
+
,
|
|
88
|
+
this.sm4_setkey_dec = function(t, e) {
|
|
89
|
+
null == t && Error("ctx is null!"),
|
|
90
|
+
null != e && 16 === e.length || Error("2key error!"),
|
|
91
|
+
t.mode = 0,
|
|
92
|
+
this.sm4_setkey(t.sk, e),
|
|
93
|
+
t.sk = t.sk.reverse()
|
|
94
|
+
}
|
|
95
|
+
,
|
|
96
|
+
this.sm4_setkey = function(t, r) {
|
|
97
|
+
const s = new Array(4)
|
|
98
|
+
, i = new Array(36);
|
|
99
|
+
s[0] = this.GET_ULONG_BE(r, 0),
|
|
100
|
+
s[1] = this.GET_ULONG_BE(r, 4),
|
|
101
|
+
s[2] = this.GET_ULONG_BE(r, 8),
|
|
102
|
+
s[3] = this.GET_ULONG_BE(r, 12),
|
|
103
|
+
i[0] = s[0] ^ e[0],
|
|
104
|
+
i[1] = s[1] ^ e[1],
|
|
105
|
+
i[2] = s[2] ^ e[2],
|
|
106
|
+
i[3] = s[3] ^ e[3];
|
|
107
|
+
for (let e = 0; e < 32; e++)
|
|
108
|
+
i[e + 4] = i[e] ^ this.sm4CalciRK(i[e + 1] ^ i[e + 2] ^ i[e + 3] ^ n[e]),
|
|
109
|
+
t[e] = i[e + 4]
|
|
110
|
+
}
|
|
111
|
+
,
|
|
112
|
+
this.padding = function(t, e) {
|
|
113
|
+
let n;
|
|
114
|
+
if (null == t)
|
|
115
|
+
return null;
|
|
116
|
+
let r = null;
|
|
117
|
+
if (e === this.SM4_ENCRYPT) {
|
|
118
|
+
n = parseInt(16 - t.length % 16),
|
|
119
|
+
r = t.slice(0);
|
|
120
|
+
for (let e = 0; e < n; e++)
|
|
121
|
+
r[t.length + e] = n
|
|
122
|
+
} else
|
|
123
|
+
n = t[t.length - 1],
|
|
124
|
+
r = t.slice(0, t.length - n);
|
|
125
|
+
return r
|
|
126
|
+
}
|
|
127
|
+
,
|
|
128
|
+
this.sm4_one_round = function(t, e, n) {
|
|
129
|
+
let r = 0;
|
|
130
|
+
const s = new Array(36);
|
|
131
|
+
for (s[0] = this.GET_ULONG_BE(e, 0),
|
|
132
|
+
s[1] = this.GET_ULONG_BE(e, 4),
|
|
133
|
+
s[2] = this.GET_ULONG_BE(e, 8),
|
|
134
|
+
s[3] = this.GET_ULONG_BE(e, 12); r < 32; )
|
|
135
|
+
s[r + 4] = this.sm4F(s[r], s[r + 1], s[r + 2], s[r + 3], t[r]),
|
|
136
|
+
r++;
|
|
137
|
+
this.PUT_ULONG_BE(s[35], n, 0),
|
|
138
|
+
this.PUT_ULONG_BE(s[34], n, 4),
|
|
139
|
+
this.PUT_ULONG_BE(s[33], n, 8),
|
|
140
|
+
this.PUT_ULONG_BE(s[32], n, 12)
|
|
141
|
+
}
|
|
142
|
+
,
|
|
143
|
+
this.sm4_crypt_ecb = function(t, e) {
|
|
144
|
+
null == e && alert("input is null!"),
|
|
145
|
+
t.isPadding && t.mode === this.SM4_ENCRYPT && (e = this.padding(e, this.SM4_ENCRYPT));
|
|
146
|
+
let n = 0
|
|
147
|
+
, r = e.length
|
|
148
|
+
, s = [];
|
|
149
|
+
for (; r > 0; r -= 16) {
|
|
150
|
+
var i = new Array(16)
|
|
151
|
+
, o = e.slice(16 * n, 16 * (n + 1));
|
|
152
|
+
this.sm4_one_round(t.sk, o, i),
|
|
153
|
+
s = s.concat(i),
|
|
154
|
+
n++
|
|
155
|
+
}
|
|
156
|
+
let c = s;
|
|
157
|
+
for (t.isPadding && t.mode === this.SM4_DECRYPT && (c = this.padding(c, this.SM4_DECRYPT)),
|
|
158
|
+
n = 0; n < c.length; n++)
|
|
159
|
+
c[n] < 0 && (c[n] = c[n] + 256);
|
|
160
|
+
return c
|
|
161
|
+
}
|
|
162
|
+
,
|
|
163
|
+
this.sm4_crypt_cbc = function(t, e, n) {
|
|
164
|
+
let r, s, i, o;
|
|
165
|
+
null != e && 16 === e.length || alert("iv error!"),
|
|
166
|
+
null == n && alert("input is null!"),
|
|
167
|
+
t.isPadding && t.mode === this.SM4_ENCRYPT && (n = this.padding(n, this.SM4_ENCRYPT));
|
|
168
|
+
let c = 0
|
|
169
|
+
, h = n.length
|
|
170
|
+
, l = [];
|
|
171
|
+
if (t.mode === this.SM4_ENCRYPT)
|
|
172
|
+
for (o = 0; h > 0; h -= 16) {
|
|
173
|
+
for (r = new Array(16),
|
|
174
|
+
i = new Array(16),
|
|
175
|
+
s = n.slice(16 * o, 16 * (o + 1)),
|
|
176
|
+
c = 0; c < 16; c++)
|
|
177
|
+
r[c] = s[c] ^ e[c];
|
|
178
|
+
this.sm4_one_round(t.sk, r, i),
|
|
179
|
+
e = i.slice(0, 16),
|
|
180
|
+
l = l.concat(i),
|
|
181
|
+
o++
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
let u = [];
|
|
185
|
+
for (o = 0; h > 0; h -= 16) {
|
|
186
|
+
for (r = new Array(16),
|
|
187
|
+
i = new Array(16),
|
|
188
|
+
s = n.slice(16 * o, 16 * (o + 1)),
|
|
189
|
+
u = s.slice(0, 16),
|
|
190
|
+
this.sm4_one_round(t.sk, s, r),
|
|
191
|
+
c = 0; c < 16; c++)
|
|
192
|
+
i[c] = r[c] ^ e[c];
|
|
193
|
+
e = u.slice(0, 16),
|
|
194
|
+
l = l.concat(i),
|
|
195
|
+
o++
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
let u = l;
|
|
199
|
+
for (t.isPadding && t.mode === this.SM4_DECRYPT && (u = this.padding(u, this.SM4_DECRYPT)),
|
|
200
|
+
c = 0; c < u.length; c++)
|
|
201
|
+
u[c] < 0 && (u[c] = u[c] + 256);
|
|
202
|
+
return u
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
n.d(e, {
|
|
206
|
+
Z: () => i
|
|
207
|
+
});
|
|
208
|
+
// 2026/10/27 gongml [需求 待补充] Base64实现改为模块局部变量,兼容CommonJS打包并避免全局污染
|
|
209
|
+
const base64js = (function() {
|
|
210
|
+
return function t(e, n, r) {
|
|
211
|
+
function s(i, o) {
|
|
212
|
+
if (!n[i]) {
|
|
213
|
+
// 2026/10/27 gongml [需求 待补充] Base64内嵌模块缺失时明确报错,移除不可打包的动态require后备分支
|
|
214
|
+
if (!e[i])
|
|
215
|
+
throw new Error("Unknown internal Base64 module");
|
|
216
|
+
const o = n[i] = {
|
|
217
|
+
exports: {}
|
|
218
|
+
};
|
|
219
|
+
e[i][0].call(o.exports, (function(t) {
|
|
220
|
+
return s(e[i][1][t] || t)
|
|
221
|
+
}
|
|
222
|
+
), o, o.exports, t, e, n, r)
|
|
223
|
+
}
|
|
224
|
+
return n[i].exports
|
|
225
|
+
}
|
|
226
|
+
for (let t = 0; t < r.length; t++)
|
|
227
|
+
s(r[t]);
|
|
228
|
+
return s
|
|
229
|
+
}({
|
|
230
|
+
"/": [function(t, e, n) {
|
|
231
|
+
n.byteLength = function(t) {
|
|
232
|
+
return 3 * t.length / 4 - h(t)
|
|
233
|
+
}
|
|
234
|
+
,
|
|
235
|
+
n.toByteArray = function(t) {
|
|
236
|
+
let e, n, r, o, c;
|
|
237
|
+
const l = t.length;
|
|
238
|
+
o = h(t),
|
|
239
|
+
c = new i(3 * l / 4 - o),
|
|
240
|
+
n = o > 0 ? l - 4 : l;
|
|
241
|
+
let u = 0;
|
|
242
|
+
for (e = 0; e < n; e += 4)
|
|
243
|
+
r = s[t.charCodeAt(e)] << 18 | s[t.charCodeAt(e + 1)] << 12 | s[t.charCodeAt(e + 2)] << 6 | s[t.charCodeAt(e + 3)],
|
|
244
|
+
c[u++] = r >> 16 & 255,
|
|
245
|
+
c[u++] = r >> 8 & 255,
|
|
246
|
+
c[u++] = 255 & r;
|
|
247
|
+
return 2 === o ? (r = s[t.charCodeAt(e)] << 2 | s[t.charCodeAt(e + 1)] >> 4,
|
|
248
|
+
c[u++] = 255 & r) : 1 === o && (r = s[t.charCodeAt(e)] << 10 | s[t.charCodeAt(e + 1)] << 4 | s[t.charCodeAt(e + 2)] >> 2,
|
|
249
|
+
c[u++] = r >> 8 & 255,
|
|
250
|
+
c[u++] = 255 & r),
|
|
251
|
+
c
|
|
252
|
+
}
|
|
253
|
+
,
|
|
254
|
+
n.fromByteArray = function(t) {
|
|
255
|
+
let e;
|
|
256
|
+
const n = t.length
|
|
257
|
+
, s = n % 3;
|
|
258
|
+
let i = "";
|
|
259
|
+
const o = []
|
|
260
|
+
, c = 16383;
|
|
261
|
+
let h = 0;
|
|
262
|
+
const l = n - s;
|
|
263
|
+
for (; h < l; h += c)
|
|
264
|
+
o.push(u(t, h, h + c > l ? l : h + c));
|
|
265
|
+
return 1 === s ? (e = t[n - 1],
|
|
266
|
+
i += r[e >> 2],
|
|
267
|
+
i += r[e << 4 & 63],
|
|
268
|
+
i += "==") : 2 === s && (e = (t[n - 2] << 8) + t[n - 1],
|
|
269
|
+
i += r[e >> 10],
|
|
270
|
+
i += r[e >> 4 & 63],
|
|
271
|
+
i += r[e << 2 & 63],
|
|
272
|
+
i += "="),
|
|
273
|
+
o.push(i),
|
|
274
|
+
o.join("")
|
|
275
|
+
}
|
|
276
|
+
;
|
|
277
|
+
const r = []
|
|
278
|
+
, s = []
|
|
279
|
+
, i = "undefined" != typeof Uint8Array ? Uint8Array : Array
|
|
280
|
+
, o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
281
|
+
let c = 0;
|
|
282
|
+
for (; c < 64; ++c)
|
|
283
|
+
r[c] = o[c],
|
|
284
|
+
s[o.charCodeAt(c)] = c;
|
|
285
|
+
function h(t) {
|
|
286
|
+
const e = t.length;
|
|
287
|
+
if (e % 4 > 0)
|
|
288
|
+
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
289
|
+
return "=" === t[e - 2] ? 2 : "=" === t[e - 1] ? 1 : 0
|
|
290
|
+
}
|
|
291
|
+
function l(t) {
|
|
292
|
+
return r[t >> 18 & 63] + r[t >> 12 & 63] + r[t >> 6 & 63] + r[63 & t]
|
|
293
|
+
}
|
|
294
|
+
function u(t, e, n) {
|
|
295
|
+
let r;
|
|
296
|
+
const s = [];
|
|
297
|
+
for (let i = e; i < n; i += 3)
|
|
298
|
+
r = (t[i] << 16) + (t[i + 1] << 8) + t[i + 2],
|
|
299
|
+
s.push(l(r));
|
|
300
|
+
return s.join("")
|
|
301
|
+
}
|
|
302
|
+
s["-".charCodeAt(0)] = 62,
|
|
303
|
+
s["_".charCodeAt(0)] = 63
|
|
304
|
+
}
|
|
305
|
+
, {}]
|
|
306
|
+
}, {}, [])("/")
|
|
307
|
+
})();
|
|
308
|
+
const i = function() {
|
|
309
|
+
this.secretKey = cryptoConfig.secretKey,
|
|
310
|
+
this.iv = cryptoConfig.iv,
|
|
311
|
+
this.hexString = !1,
|
|
312
|
+
this.encryptData_ECB = function(t) {
|
|
313
|
+
try {
|
|
314
|
+
const e = new s
|
|
315
|
+
, n = new r;
|
|
316
|
+
n.isPadding = !0,
|
|
317
|
+
n.mode = e.SM4_ENCRYPT;
|
|
318
|
+
const i = this.stringToByte(this.secretKey);
|
|
319
|
+
if (e.sm4_setkey_enc(n, i),
|
|
320
|
+
t) {
|
|
321
|
+
const r = e.sm4_crypt_ecb(n, this.stringToByte(t))
|
|
322
|
+
, s = base64js.fromByteArray(r);
|
|
323
|
+
return null != s && s.trim().length > 0 && s.replace(/(\s*|\t|\r|\n)/g, ""),
|
|
324
|
+
s
|
|
325
|
+
}
|
|
326
|
+
return ""
|
|
327
|
+
} catch (t) {
|
|
328
|
+
return null
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
,
|
|
332
|
+
this.encryptData_ECB = function(t, e) {
|
|
333
|
+
try {
|
|
334
|
+
const n = new s
|
|
335
|
+
, i = new r;
|
|
336
|
+
i.isPadding = !0,
|
|
337
|
+
i.mode = n.SM4_ENCRYPT;
|
|
338
|
+
const o = this.stringToByte(e);
|
|
339
|
+
if (n.sm4_setkey_enc(i, o),
|
|
340
|
+
t) {
|
|
341
|
+
const e = n.sm4_crypt_ecb(i, this.stringToByte(t))
|
|
342
|
+
, r = base64js.fromByteArray(e);
|
|
343
|
+
return null != r && r.trim().length > 0 && r.replace(/(\s*|\t|\r|\n)/g, ""),
|
|
344
|
+
r
|
|
345
|
+
}
|
|
346
|
+
return ""
|
|
347
|
+
} catch (t) {
|
|
348
|
+
return null
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
,
|
|
352
|
+
this.decryptData_ECB = function(t) {
|
|
353
|
+
try {
|
|
354
|
+
const e = new s
|
|
355
|
+
, n = new r;
|
|
356
|
+
n.isPadding = !0,
|
|
357
|
+
n.mode = e.SM4_ENCRYPT;
|
|
358
|
+
const i = this.stringToByte(this.secretKey);
|
|
359
|
+
if (e.sm4_setkey_dec(n, i),
|
|
360
|
+
t) {
|
|
361
|
+
const r = e.sm4_crypt_ecb(n, base64js.toByteArray(t));
|
|
362
|
+
return this.byteToString(r)
|
|
363
|
+
}
|
|
364
|
+
return ""
|
|
365
|
+
} catch (t) {
|
|
366
|
+
return null
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
,
|
|
370
|
+
this.decryptData_ECB = function(t, e) {
|
|
371
|
+
try {
|
|
372
|
+
const n = new s
|
|
373
|
+
, i = new r;
|
|
374
|
+
i.isPadding = !0,
|
|
375
|
+
i.mode = n.SM4_ENCRYPT;
|
|
376
|
+
const o = this.stringToByte(e);
|
|
377
|
+
if (n.sm4_setkey_dec(i, o),
|
|
378
|
+
t) {
|
|
379
|
+
const e = n.sm4_crypt_ecb(i, base64js.toByteArray(t));
|
|
380
|
+
return this.byteToString(e)
|
|
381
|
+
}
|
|
382
|
+
return ""
|
|
383
|
+
} catch (t) {
|
|
384
|
+
return null
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
,
|
|
388
|
+
this.encryptData_CBC = function(t) {
|
|
389
|
+
try {
|
|
390
|
+
const e = new s
|
|
391
|
+
, n = new r;
|
|
392
|
+
n.isPadding = !0,
|
|
393
|
+
n.mode = e.SM4_ENCRYPT;
|
|
394
|
+
const i = this.stringToByte(this.secretKey)
|
|
395
|
+
, o = this.stringToByte(this.iv);
|
|
396
|
+
e.sm4_setkey_enc(n, i);
|
|
397
|
+
const c = e.sm4_crypt_cbc(n, o, this.stringToByte(t))
|
|
398
|
+
, h = base64js.fromByteArray(c);
|
|
399
|
+
return null != h && h.trim().length > 0 && h.replace(/(\s*|\t|\r|\n)/g, ""),
|
|
400
|
+
h
|
|
401
|
+
} catch (t) {
|
|
402
|
+
return null
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
,
|
|
406
|
+
this.encryptData_CBC = function(t, e, n) {
|
|
407
|
+
try {
|
|
408
|
+
const i = new s
|
|
409
|
+
, o = new r;
|
|
410
|
+
o.isPadding = !0,
|
|
411
|
+
o.mode = i.SM4_ENCRYPT;
|
|
412
|
+
const c = this.stringToByte(n)
|
|
413
|
+
, h = this.stringToByte(e);
|
|
414
|
+
i.sm4_setkey_enc(o, c);
|
|
415
|
+
const l = i.sm4_crypt_cbc(o, h, this.stringToByte(t))
|
|
416
|
+
, u = base64js.fromByteArray(l);
|
|
417
|
+
return null != u && u.trim().length > 0 && u.replace(/(\s*|\t|\r|\n)/g, ""),
|
|
418
|
+
u
|
|
419
|
+
} catch (t) {
|
|
420
|
+
return null
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
,
|
|
424
|
+
this.decryptData_CBC = function(t) {
|
|
425
|
+
try {
|
|
426
|
+
const e = new s
|
|
427
|
+
, n = new r;
|
|
428
|
+
n.isPadding = !0,
|
|
429
|
+
n.mode = e.SM4_ENCRYPT;
|
|
430
|
+
const i = this.stringToByte(this.secretKey)
|
|
431
|
+
, o = this.stringToByte(this.iv);
|
|
432
|
+
e.sm4_setkey_dec(n, i);
|
|
433
|
+
const c = e.sm4_crypt_cbc(n, o, base64js.toByteArray(t));
|
|
434
|
+
return this.byteToString(c)
|
|
435
|
+
} catch (t) {
|
|
436
|
+
return null
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
,
|
|
440
|
+
this.decryptData_CBC = function(t, e, n) {
|
|
441
|
+
try {
|
|
442
|
+
const i = new s
|
|
443
|
+
, o = new r;
|
|
444
|
+
o.isPadding = !0,
|
|
445
|
+
o.mode = i.SM4_ENCRYPT;
|
|
446
|
+
const c = this.stringToByte(n)
|
|
447
|
+
, h = this.stringToByte(e);
|
|
448
|
+
i.sm4_setkey_dec(o, c);
|
|
449
|
+
const l = i.sm4_crypt_cbc(o, h, base64js.toByteArray(t));
|
|
450
|
+
return this.byteToString(l)
|
|
451
|
+
} catch (t) {
|
|
452
|
+
return null
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
,
|
|
456
|
+
this.stringToByte = function(t) {
|
|
457
|
+
const e = [];
|
|
458
|
+
let n, r;
|
|
459
|
+
n = t.length;
|
|
460
|
+
for (let s = 0; s < n; s++)
|
|
461
|
+
r = t.charCodeAt(s),
|
|
462
|
+
r >= 65536 && r <= 1114111 ? (e.push(r >> 18 & 7 | 240),
|
|
463
|
+
e.push(r >> 12 & 63 | 128),
|
|
464
|
+
e.push(r >> 6 & 63 | 128),
|
|
465
|
+
e.push(63 & r | 128)) : r >= 2048 && r <= 65535 ? (e.push(r >> 12 & 15 | 224),
|
|
466
|
+
e.push(r >> 6 & 63 | 128),
|
|
467
|
+
e.push(63 & r | 128)) : r >= 128 && r <= 2047 ? (e.push(r >> 6 & 31 | 192),
|
|
468
|
+
e.push(63 & r | 128)) : e.push(255 & r);
|
|
469
|
+
return e
|
|
470
|
+
}
|
|
471
|
+
,
|
|
472
|
+
this.byteToString = function(t) {
|
|
473
|
+
if ("string" == typeof t)
|
|
474
|
+
return t;
|
|
475
|
+
let e = "";
|
|
476
|
+
const n = t;
|
|
477
|
+
for (let t = 0; t < n.length; t++) {
|
|
478
|
+
const r = n[t].toString(2)
|
|
479
|
+
, s = r.match(/^1+?(?=0)/);
|
|
480
|
+
if (s && 8 === r.length) {
|
|
481
|
+
const r = s[0].length;
|
|
482
|
+
let i = n[t].toString(2).slice(7 - r);
|
|
483
|
+
for (let e = 1; e < r; e++)
|
|
484
|
+
i += n[e + t].toString(2).slice(2);
|
|
485
|
+
e += String.fromCharCode(parseInt(i, 2)),
|
|
486
|
+
t += r - 1
|
|
487
|
+
} else
|
|
488
|
+
e += String.fromCharCode(n[t])
|
|
489
|
+
}
|
|
490
|
+
return e
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
, e = {};
|
|
496
|
+
function n(r) {
|
|
497
|
+
var s = e[r];
|
|
498
|
+
if (void 0 !== s)
|
|
499
|
+
return s.exports;
|
|
500
|
+
var i = e[r] = {
|
|
501
|
+
id: r,
|
|
502
|
+
loaded: !1,
|
|
503
|
+
exports: {}
|
|
504
|
+
};
|
|
505
|
+
return t[r](i, i.exports, n),
|
|
506
|
+
i.loaded = !0,
|
|
507
|
+
i.exports
|
|
508
|
+
}
|
|
509
|
+
n.d = (t, e) => {
|
|
510
|
+
for (var r in e)
|
|
511
|
+
n.o(e, r) && !n.o(t, r) && Object.defineProperty(t, r, {
|
|
512
|
+
enumerable: !0,
|
|
513
|
+
get: e[r]
|
|
514
|
+
})
|
|
515
|
+
}
|
|
516
|
+
,
|
|
517
|
+
n.g = function() {
|
|
518
|
+
if ("object" == typeof globalThis)
|
|
519
|
+
return globalThis;
|
|
520
|
+
try {
|
|
521
|
+
return this || new Function("return this")()
|
|
522
|
+
} catch (t) {
|
|
523
|
+
if ("object" == typeof window)
|
|
524
|
+
return window
|
|
525
|
+
}
|
|
526
|
+
}(),
|
|
527
|
+
n.hmd = t => ((t = Object.create(t)).children || (t.children = []),
|
|
528
|
+
Object.defineProperty(t, "exports", {
|
|
529
|
+
enumerable: !0,
|
|
530
|
+
set: () => {
|
|
531
|
+
throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: " + t.id)
|
|
532
|
+
}
|
|
533
|
+
}),
|
|
534
|
+
t),
|
|
535
|
+
n.o = (t, e) => Object.prototype.hasOwnProperty.call(t, e);
|
|
536
|
+
var r = {};
|
|
537
|
+
return ( () => {
|
|
538
|
+
n.d(r, {
|
|
539
|
+
default: () => e
|
|
540
|
+
});
|
|
541
|
+
var t = n(287);
|
|
542
|
+
const e = {
|
|
543
|
+
encrypt: function(e) {
|
|
544
|
+
const n = new t.Z;
|
|
545
|
+
return n.secretKey = cryptoConfig.secretKey,
|
|
546
|
+
n.encryptData_ECB(e, n.secretKey)
|
|
547
|
+
},
|
|
548
|
+
decrypt: function(e) {
|
|
549
|
+
const n = new t.Z;
|
|
550
|
+
return n.secretKey = cryptoConfig.secretKey,
|
|
551
|
+
n.decryptData_ECB(e, n.secretKey)
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
)(),
|
|
556
|
+
r.default
|
|
557
|
+
}
|
|
558
|
+
)()));
|
|
@@ -93,7 +93,7 @@ module.exports = {
|
|
|
93
93
|
"aqcomponents.videopage.2p4g36": "移动数据",
|
|
94
94
|
"aqcomponents.videopage.73c556": "无网络",
|
|
95
95
|
"aqcomponents.videopage.7ikbgu": "检测到您的设备当前连接非wifi网络环境,请注意流量消耗",
|
|
96
|
-
"aqcomponents.videopage.yhj38i": "
|
|
96
|
+
"aqcomponents.videopage.yhj38i": "星耀菁英会",
|
|
97
97
|
"autograph.index.2spt3x": "在此处签名",
|
|
98
98
|
"autograph.index.uc44d7": "请保持字迹大小一致",
|
|
99
99
|
"autograph.index.2lkog6": "上传错误",
|