@solar-taro/ui-sun 2.2.0 → 2.3.1
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/CHANGELOG.md +24 -0
- package/back-button/index.d.ts +1 -0
- package/back-button/index.scss +3 -0
- package/back-button/index.vue.d.ts +2 -0
- package/chip/index.vue.d.ts +1 -1
- package/index.d.ts +1 -0
- package/index.js +27 -25
- package/index12.js +1 -1
- package/index13.js +1 -1
- package/index14.js +1 -1
- package/index15.js +10 -10
- package/index18.js +1 -1
- package/index23.js +1 -1
- package/index24.js +14 -10
- package/index25.js +2 -2
- package/index26.js +9 -9
- package/index27.js +9 -9
- package/index28.js +10 -2
- package/index29.js +1 -1
- package/index30.js +1 -1
- package/index31.js +1 -1
- package/index32.js +7 -2
- package/index33.js +2 -7
- package/index34.js +1 -1
- package/index35.js +1 -1
- package/index36.js +1 -1
- package/index37.js +1 -1
- package/index38.js +1 -1
- package/index39.js +1 -1
- package/index4.js +11 -19
- package/index40.js +1 -1
- package/index41.js +1 -1
- package/index42.js +1 -1
- package/index43.js +1 -1
- package/index44.js +1 -1
- package/index45.js +1 -1
- package/index46.js +1 -1
- package/index47.js +1 -1
- package/index48.js +2 -66
- package/index49.js +2 -12
- package/index5.js +17 -19
- package/index50.js +2 -25
- package/index51.js +65 -13
- package/index52.js +12 -5
- package/index53.js +23 -524
- package/index54.js +14 -3
- package/index55.js +3 -2
- package/index56.js +524 -24
- package/index57.js +26 -2
- package/index58.js +2 -506
- package/index59.js +481 -54
- package/index6.js +19 -14
- package/index60.js +72 -63
- package/index61.js +64 -63
- package/index62.js +46 -520
- package/index63.js +543 -2
- package/index65.js +2 -2
- package/index66.js +2 -4
- package/index67.js +4 -2
- package/index68.js +2 -4
- package/index69.js +4 -2
- package/index7.js +15 -10
- package/index72.js +2 -48
- package/index73.js +2 -82
- package/index74.js +48 -2
- package/index75.js +82 -2
- package/index76.js +2 -2
- package/index78.js +4 -0
- package/index8.js +1 -1
- package/package.json +1 -1
package/index62.js
CHANGED
|
@@ -1,545 +1,71 @@
|
|
|
1
|
-
import { commonjsGlobal as
|
|
2
|
-
import { __module as
|
|
3
|
-
import { __require as
|
|
4
|
-
import { __require as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var C = x.Base64, g = c.algo, k = g.EvpKDF, f = s.Cipher = y.extend({
|
|
1
|
+
import { commonjsGlobal as k } from "./index57.js";
|
|
2
|
+
import { __module as f } from "./index73.js";
|
|
3
|
+
import { __require as y } from "./index59.js";
|
|
4
|
+
import { __require as D } from "./index74.js";
|
|
5
|
+
import { __require as E } from "./index75.js";
|
|
6
|
+
var m;
|
|
7
|
+
function S() {
|
|
8
|
+
return m ? f.exports : (m = 1, function(h, K) {
|
|
9
|
+
(function(o, e, n) {
|
|
10
|
+
h.exports = e(y(), D(), E());
|
|
11
|
+
})(k, function(o) {
|
|
12
|
+
return function() {
|
|
13
|
+
var e = o, n = e.lib, v = n.Base, l = n.WordArray, c = e.algo, _ = c.MD5, g = c.EvpKDF = v.extend({
|
|
15
14
|
/**
|
|
16
15
|
* Configuration options.
|
|
17
16
|
*
|
|
18
|
-
* @property {
|
|
17
|
+
* @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
|
|
18
|
+
* @property {Hasher} hasher The hash algorithm to use. Default: MD5
|
|
19
|
+
* @property {number} iterations The number of iterations to perform. Default: 1
|
|
19
20
|
*/
|
|
20
|
-
cfg:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* @param {WordArray} key The key.
|
|
25
|
-
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
26
|
-
*
|
|
27
|
-
* @return {Cipher} A cipher instance.
|
|
28
|
-
*
|
|
29
|
-
* @static
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
*
|
|
33
|
-
* var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });
|
|
34
|
-
*/
|
|
35
|
-
createEncryptor: function(e, t) {
|
|
36
|
-
return this.create(this._ENC_XFORM_MODE, e, t);
|
|
37
|
-
},
|
|
38
|
-
/**
|
|
39
|
-
* Creates this cipher in decryption mode.
|
|
40
|
-
*
|
|
41
|
-
* @param {WordArray} key The key.
|
|
42
|
-
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
43
|
-
*
|
|
44
|
-
* @return {Cipher} A cipher instance.
|
|
45
|
-
*
|
|
46
|
-
* @static
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
*
|
|
50
|
-
* var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });
|
|
51
|
-
*/
|
|
52
|
-
createDecryptor: function(e, t) {
|
|
53
|
-
return this.create(this._DEC_XFORM_MODE, e, t);
|
|
54
|
-
},
|
|
55
|
-
/**
|
|
56
|
-
* Initializes a newly created cipher.
|
|
57
|
-
*
|
|
58
|
-
* @param {number} xformMode Either the encryption or decryption transormation mode constant.
|
|
59
|
-
* @param {WordArray} key The key.
|
|
60
|
-
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
61
|
-
*
|
|
62
|
-
* @example
|
|
63
|
-
*
|
|
64
|
-
* var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });
|
|
65
|
-
*/
|
|
66
|
-
init: function(e, t, i) {
|
|
67
|
-
this.cfg = this.cfg.extend(i), this._xformMode = e, this._key = t, this.reset();
|
|
68
|
-
},
|
|
69
|
-
/**
|
|
70
|
-
* Resets this cipher to its initial state.
|
|
71
|
-
*
|
|
72
|
-
* @example
|
|
73
|
-
*
|
|
74
|
-
* cipher.reset();
|
|
75
|
-
*/
|
|
76
|
-
reset: function() {
|
|
77
|
-
y.reset.call(this), this._doReset();
|
|
78
|
-
},
|
|
79
|
-
/**
|
|
80
|
-
* Adds data to be encrypted or decrypted.
|
|
81
|
-
*
|
|
82
|
-
* @param {WordArray|string} dataUpdate The data to encrypt or decrypt.
|
|
83
|
-
*
|
|
84
|
-
* @return {WordArray} The data after processing.
|
|
85
|
-
*
|
|
86
|
-
* @example
|
|
87
|
-
*
|
|
88
|
-
* var encrypted = cipher.process('data');
|
|
89
|
-
* var encrypted = cipher.process(wordArray);
|
|
90
|
-
*/
|
|
91
|
-
process: function(e) {
|
|
92
|
-
return this._append(e), this._process();
|
|
93
|
-
},
|
|
94
|
-
/**
|
|
95
|
-
* Finalizes the encryption or decryption process.
|
|
96
|
-
* Note that the finalize operation is effectively a destructive, read-once operation.
|
|
97
|
-
*
|
|
98
|
-
* @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.
|
|
99
|
-
*
|
|
100
|
-
* @return {WordArray} The data after final processing.
|
|
101
|
-
*
|
|
102
|
-
* @example
|
|
103
|
-
*
|
|
104
|
-
* var encrypted = cipher.finalize();
|
|
105
|
-
* var encrypted = cipher.finalize('data');
|
|
106
|
-
* var encrypted = cipher.finalize(wordArray);
|
|
107
|
-
*/
|
|
108
|
-
finalize: function(e) {
|
|
109
|
-
e && this._append(e);
|
|
110
|
-
var t = this._doFinalize();
|
|
111
|
-
return t;
|
|
112
|
-
},
|
|
113
|
-
keySize: 128 / 32,
|
|
114
|
-
ivSize: 128 / 32,
|
|
115
|
-
_ENC_XFORM_MODE: 1,
|
|
116
|
-
_DEC_XFORM_MODE: 2,
|
|
117
|
-
/**
|
|
118
|
-
* Creates shortcut functions to a cipher's object interface.
|
|
119
|
-
*
|
|
120
|
-
* @param {Cipher} cipher The cipher to create a helper for.
|
|
121
|
-
*
|
|
122
|
-
* @return {Object} An object with encrypt and decrypt shortcut functions.
|
|
123
|
-
*
|
|
124
|
-
* @static
|
|
125
|
-
*
|
|
126
|
-
* @example
|
|
127
|
-
*
|
|
128
|
-
* var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);
|
|
129
|
-
*/
|
|
130
|
-
_createHelper: /* @__PURE__ */ function() {
|
|
131
|
-
function e(t) {
|
|
132
|
-
return typeof t == "string" ? q : l;
|
|
133
|
-
}
|
|
134
|
-
return function(t) {
|
|
135
|
-
return {
|
|
136
|
-
encrypt: function(i, r, n) {
|
|
137
|
-
return e(r).encrypt(t, i, r, n);
|
|
138
|
-
},
|
|
139
|
-
decrypt: function(i, r, n) {
|
|
140
|
-
return e(r).decrypt(t, i, r, n);
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
};
|
|
144
|
-
}()
|
|
145
|
-
});
|
|
146
|
-
s.StreamCipher = f.extend({
|
|
147
|
-
_doFinalize: function() {
|
|
148
|
-
var e = this._process(!0);
|
|
149
|
-
return e;
|
|
150
|
-
},
|
|
151
|
-
blockSize: 1
|
|
152
|
-
});
|
|
153
|
-
var z = c.mode = {}, E = s.BlockCipherMode = p.extend({
|
|
154
|
-
/**
|
|
155
|
-
* Creates this mode for encryption.
|
|
156
|
-
*
|
|
157
|
-
* @param {Cipher} cipher A block cipher instance.
|
|
158
|
-
* @param {Array} iv The IV words.
|
|
159
|
-
*
|
|
160
|
-
* @static
|
|
161
|
-
*
|
|
162
|
-
* @example
|
|
163
|
-
*
|
|
164
|
-
* var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);
|
|
165
|
-
*/
|
|
166
|
-
createEncryptor: function(e, t) {
|
|
167
|
-
return this.Encryptor.create(e, t);
|
|
168
|
-
},
|
|
169
|
-
/**
|
|
170
|
-
* Creates this mode for decryption.
|
|
171
|
-
*
|
|
172
|
-
* @param {Cipher} cipher A block cipher instance.
|
|
173
|
-
* @param {Array} iv The IV words.
|
|
174
|
-
*
|
|
175
|
-
* @static
|
|
176
|
-
*
|
|
177
|
-
* @example
|
|
178
|
-
*
|
|
179
|
-
* var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);
|
|
180
|
-
*/
|
|
181
|
-
createDecryptor: function(e, t) {
|
|
182
|
-
return this.Decryptor.create(e, t);
|
|
183
|
-
},
|
|
184
|
-
/**
|
|
185
|
-
* Initializes a newly created mode.
|
|
186
|
-
*
|
|
187
|
-
* @param {Cipher} cipher A block cipher instance.
|
|
188
|
-
* @param {Array} iv The IV words.
|
|
189
|
-
*
|
|
190
|
-
* @example
|
|
191
|
-
*
|
|
192
|
-
* var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);
|
|
193
|
-
*/
|
|
194
|
-
init: function(e, t) {
|
|
195
|
-
this._cipher = e, this._iv = t;
|
|
196
|
-
}
|
|
197
|
-
}), b = z.CBC = function() {
|
|
198
|
-
var e = E.extend();
|
|
199
|
-
e.Encryptor = e.extend({
|
|
200
|
-
/**
|
|
201
|
-
* Processes the data block at offset.
|
|
202
|
-
*
|
|
203
|
-
* @param {Array} words The data words to operate on.
|
|
204
|
-
* @param {number} offset The offset where the block starts.
|
|
205
|
-
*
|
|
206
|
-
* @example
|
|
207
|
-
*
|
|
208
|
-
* mode.processBlock(data.words, offset);
|
|
209
|
-
*/
|
|
210
|
-
processBlock: function(i, r) {
|
|
211
|
-
var n = this._cipher, a = n.blockSize;
|
|
212
|
-
t.call(this, i, r, a), n.encryptBlock(i, r), this._prevBlock = i.slice(r, r + a);
|
|
213
|
-
}
|
|
214
|
-
}), e.Decryptor = e.extend({
|
|
215
|
-
/**
|
|
216
|
-
* Processes the data block at offset.
|
|
217
|
-
*
|
|
218
|
-
* @param {Array} words The data words to operate on.
|
|
219
|
-
* @param {number} offset The offset where the block starts.
|
|
220
|
-
*
|
|
221
|
-
* @example
|
|
222
|
-
*
|
|
223
|
-
* mode.processBlock(data.words, offset);
|
|
224
|
-
*/
|
|
225
|
-
processBlock: function(i, r) {
|
|
226
|
-
var n = this._cipher, a = n.blockSize, o = i.slice(r, r + a);
|
|
227
|
-
n.decryptBlock(i, r), t.call(this, i, r, a), this._prevBlock = o;
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
function t(i, r, n) {
|
|
231
|
-
var a, o = this._iv;
|
|
232
|
-
o ? (a = o, this._iv = v) : a = this._prevBlock;
|
|
233
|
-
for (var d = 0; d < n; d++)
|
|
234
|
-
i[r + d] ^= a[d];
|
|
235
|
-
}
|
|
236
|
-
return e;
|
|
237
|
-
}(), D = c.pad = {}, M = D.Pkcs7 = {
|
|
238
|
-
/**
|
|
239
|
-
* Pads data using the algorithm defined in PKCS #5/7.
|
|
240
|
-
*
|
|
241
|
-
* @param {WordArray} data The data to pad.
|
|
242
|
-
* @param {number} blockSize The multiple that the data should be padded to.
|
|
243
|
-
*
|
|
244
|
-
* @static
|
|
245
|
-
*
|
|
246
|
-
* @example
|
|
247
|
-
*
|
|
248
|
-
* CryptoJS.pad.Pkcs7.pad(wordArray, 4);
|
|
249
|
-
*/
|
|
250
|
-
pad: function(e, t) {
|
|
251
|
-
for (var i = t * 4, r = i - e.sigBytes % i, n = r << 24 | r << 16 | r << 8 | r, a = [], o = 0; o < r; o += 4)
|
|
252
|
-
a.push(n);
|
|
253
|
-
var d = h.create(a, r);
|
|
254
|
-
e.concat(d);
|
|
255
|
-
},
|
|
256
|
-
/**
|
|
257
|
-
* Unpads data that had been padded using the algorithm defined in PKCS #5/7.
|
|
258
|
-
*
|
|
259
|
-
* @param {WordArray} data The data to unpad.
|
|
260
|
-
*
|
|
261
|
-
* @static
|
|
262
|
-
*
|
|
263
|
-
* @example
|
|
264
|
-
*
|
|
265
|
-
* CryptoJS.pad.Pkcs7.unpad(wordArray);
|
|
266
|
-
*/
|
|
267
|
-
unpad: function(e) {
|
|
268
|
-
var t = e.words[e.sigBytes - 1 >>> 2] & 255;
|
|
269
|
-
e.sigBytes -= t;
|
|
270
|
-
}
|
|
271
|
-
};
|
|
272
|
-
s.BlockCipher = f.extend({
|
|
273
|
-
/**
|
|
274
|
-
* Configuration options.
|
|
275
|
-
*
|
|
276
|
-
* @property {Mode} mode The block mode to use. Default: CBC
|
|
277
|
-
* @property {Padding} padding The padding strategy to use. Default: Pkcs7
|
|
278
|
-
*/
|
|
279
|
-
cfg: f.cfg.extend({
|
|
280
|
-
mode: b,
|
|
281
|
-
padding: M
|
|
21
|
+
cfg: v.extend({
|
|
22
|
+
keySize: 128 / 32,
|
|
23
|
+
hasher: _,
|
|
24
|
+
iterations: 1
|
|
282
25
|
}),
|
|
283
|
-
reset: function() {
|
|
284
|
-
var e;
|
|
285
|
-
f.reset.call(this);
|
|
286
|
-
var t = this.cfg, i = t.iv, r = t.mode;
|
|
287
|
-
this._xformMode == this._ENC_XFORM_MODE ? e = r.createEncryptor : (e = r.createDecryptor, this._minBufferSize = 1), this._mode && this._mode.__creator == e ? this._mode.init(this, i && i.words) : (this._mode = e.call(r, this, i && i.words), this._mode.__creator = e);
|
|
288
|
-
},
|
|
289
|
-
_doProcessBlock: function(e, t) {
|
|
290
|
-
this._mode.processBlock(e, t);
|
|
291
|
-
},
|
|
292
|
-
_doFinalize: function() {
|
|
293
|
-
var e, t = this.cfg.padding;
|
|
294
|
-
return this._xformMode == this._ENC_XFORM_MODE ? (t.pad(this._data, this.blockSize), e = this._process(!0)) : (e = this._process(!0), t.unpad(e)), e;
|
|
295
|
-
},
|
|
296
|
-
blockSize: 128 / 32
|
|
297
|
-
});
|
|
298
|
-
var _ = s.CipherParams = p.extend({
|
|
299
26
|
/**
|
|
300
|
-
* Initializes a newly created
|
|
27
|
+
* Initializes a newly created key derivation function.
|
|
301
28
|
*
|
|
302
|
-
* @param {Object}
|
|
29
|
+
* @param {Object} cfg (Optional) The configuration options to use for the derivation.
|
|
303
30
|
*
|
|
304
31
|
* @example
|
|
305
32
|
*
|
|
306
|
-
* var
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
* iv: ivWordArray,
|
|
310
|
-
* salt: saltWordArray,
|
|
311
|
-
* algorithm: CryptoJS.algo.AES,
|
|
312
|
-
* mode: CryptoJS.mode.CBC,
|
|
313
|
-
* padding: CryptoJS.pad.PKCS7,
|
|
314
|
-
* blockSize: 4,
|
|
315
|
-
* formatter: CryptoJS.format.OpenSSL
|
|
316
|
-
* });
|
|
33
|
+
* var kdf = CryptoJS.algo.EvpKDF.create();
|
|
34
|
+
* var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });
|
|
35
|
+
* var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });
|
|
317
36
|
*/
|
|
318
|
-
init: function(
|
|
319
|
-
this.
|
|
37
|
+
init: function(t) {
|
|
38
|
+
this.cfg = this.cfg.extend(t);
|
|
320
39
|
},
|
|
321
40
|
/**
|
|
322
|
-
*
|
|
323
|
-
*
|
|
324
|
-
* @param {Format} formatter (Optional) The formatting strategy to use.
|
|
41
|
+
* Derives a key from a password.
|
|
325
42
|
*
|
|
326
|
-
* @
|
|
43
|
+
* @param {WordArray|string} password The password.
|
|
44
|
+
* @param {WordArray|string} salt A salt.
|
|
327
45
|
*
|
|
328
|
-
* @
|
|
46
|
+
* @return {WordArray} The derived key.
|
|
329
47
|
*
|
|
330
48
|
* @example
|
|
331
49
|
*
|
|
332
|
-
* var
|
|
333
|
-
* var string = cipherParams.toString();
|
|
334
|
-
* var string = cipherParams.toString(CryptoJS.format.OpenSSL);
|
|
50
|
+
* var key = kdf.compute(password, salt);
|
|
335
51
|
*/
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
*
|
|
345
|
-
* @return {string} The OpenSSL-compatible string.
|
|
346
|
-
*
|
|
347
|
-
* @static
|
|
348
|
-
*
|
|
349
|
-
* @example
|
|
350
|
-
*
|
|
351
|
-
* var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);
|
|
352
|
-
*/
|
|
353
|
-
stringify: function(e) {
|
|
354
|
-
var t, i = e.ciphertext, r = e.salt;
|
|
355
|
-
return r ? t = h.create([1398893684, 1701076831]).concat(r).concat(i) : t = i, t.toString(C);
|
|
356
|
-
},
|
|
357
|
-
/**
|
|
358
|
-
* Converts an OpenSSL-compatible string to a cipher params object.
|
|
359
|
-
*
|
|
360
|
-
* @param {string} openSSLStr The OpenSSL-compatible string.
|
|
361
|
-
*
|
|
362
|
-
* @return {CipherParams} The cipher params object.
|
|
363
|
-
*
|
|
364
|
-
* @static
|
|
365
|
-
*
|
|
366
|
-
* @example
|
|
367
|
-
*
|
|
368
|
-
* var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);
|
|
369
|
-
*/
|
|
370
|
-
parse: function(e) {
|
|
371
|
-
var t, i = C.parse(e), r = i.words;
|
|
372
|
-
return r[0] == 1398893684 && r[1] == 1701076831 && (t = h.create(r.slice(2, 4)), r.splice(0, 4), i.sigBytes -= 16), _.create({ ciphertext: i, salt: t });
|
|
373
|
-
}
|
|
374
|
-
}, l = s.SerializableCipher = p.extend({
|
|
375
|
-
/**
|
|
376
|
-
* Configuration options.
|
|
377
|
-
*
|
|
378
|
-
* @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL
|
|
379
|
-
*/
|
|
380
|
-
cfg: p.extend({
|
|
381
|
-
format: P
|
|
382
|
-
}),
|
|
383
|
-
/**
|
|
384
|
-
* Encrypts a message.
|
|
385
|
-
*
|
|
386
|
-
* @param {Cipher} cipher The cipher algorithm to use.
|
|
387
|
-
* @param {WordArray|string} message The message to encrypt.
|
|
388
|
-
* @param {WordArray} key The key.
|
|
389
|
-
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
390
|
-
*
|
|
391
|
-
* @return {CipherParams} A cipher params object.
|
|
392
|
-
*
|
|
393
|
-
* @static
|
|
394
|
-
*
|
|
395
|
-
* @example
|
|
396
|
-
*
|
|
397
|
-
* var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);
|
|
398
|
-
* var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });
|
|
399
|
-
* var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });
|
|
400
|
-
*/
|
|
401
|
-
encrypt: function(e, t, i, r) {
|
|
402
|
-
r = this.cfg.extend(r);
|
|
403
|
-
var n = e.createEncryptor(i, r), a = n.finalize(t), o = n.cfg;
|
|
404
|
-
return _.create({
|
|
405
|
-
ciphertext: a,
|
|
406
|
-
key: i,
|
|
407
|
-
iv: o.iv,
|
|
408
|
-
algorithm: e,
|
|
409
|
-
mode: o.mode,
|
|
410
|
-
padding: o.padding,
|
|
411
|
-
blockSize: e.blockSize,
|
|
412
|
-
formatter: r.format
|
|
413
|
-
});
|
|
414
|
-
},
|
|
415
|
-
/**
|
|
416
|
-
* Decrypts serialized ciphertext.
|
|
417
|
-
*
|
|
418
|
-
* @param {Cipher} cipher The cipher algorithm to use.
|
|
419
|
-
* @param {CipherParams|string} ciphertext The ciphertext to decrypt.
|
|
420
|
-
* @param {WordArray} key The key.
|
|
421
|
-
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
422
|
-
*
|
|
423
|
-
* @return {WordArray} The plaintext.
|
|
424
|
-
*
|
|
425
|
-
* @static
|
|
426
|
-
*
|
|
427
|
-
* @example
|
|
428
|
-
*
|
|
429
|
-
* var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });
|
|
430
|
-
* var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });
|
|
431
|
-
*/
|
|
432
|
-
decrypt: function(e, t, i, r) {
|
|
433
|
-
r = this.cfg.extend(r), t = this._parse(t, r.format);
|
|
434
|
-
var n = e.createDecryptor(i, r).finalize(t.ciphertext);
|
|
435
|
-
return n;
|
|
436
|
-
},
|
|
437
|
-
/**
|
|
438
|
-
* Converts serialized ciphertext to CipherParams,
|
|
439
|
-
* else assumed CipherParams already and returns ciphertext unchanged.
|
|
440
|
-
*
|
|
441
|
-
* @param {CipherParams|string} ciphertext The ciphertext.
|
|
442
|
-
* @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.
|
|
443
|
-
*
|
|
444
|
-
* @return {CipherParams} The unserialized ciphertext.
|
|
445
|
-
*
|
|
446
|
-
* @static
|
|
447
|
-
*
|
|
448
|
-
* @example
|
|
449
|
-
*
|
|
450
|
-
* var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);
|
|
451
|
-
*/
|
|
452
|
-
_parse: function(e, t) {
|
|
453
|
-
return typeof e == "string" ? t.parse(e, this) : e;
|
|
454
|
-
}
|
|
455
|
-
}), F = c.kdf = {}, R = F.OpenSSL = {
|
|
456
|
-
/**
|
|
457
|
-
* Derives a key and IV from a password.
|
|
458
|
-
*
|
|
459
|
-
* @param {string} password The password to derive from.
|
|
460
|
-
* @param {number} keySize The size in words of the key to generate.
|
|
461
|
-
* @param {number} ivSize The size in words of the IV to generate.
|
|
462
|
-
* @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.
|
|
463
|
-
*
|
|
464
|
-
* @return {CipherParams} A cipher params object with the key, IV, and salt.
|
|
465
|
-
*
|
|
466
|
-
* @static
|
|
467
|
-
*
|
|
468
|
-
* @example
|
|
469
|
-
*
|
|
470
|
-
* var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);
|
|
471
|
-
* var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');
|
|
472
|
-
*/
|
|
473
|
-
execute: function(e, t, i, r, n) {
|
|
474
|
-
if (r || (r = h.random(64 / 8)), n)
|
|
475
|
-
var a = k.create({ keySize: t + i, hasher: n }).compute(e, r);
|
|
476
|
-
else
|
|
477
|
-
var a = k.create({ keySize: t + i }).compute(e, r);
|
|
478
|
-
var o = h.create(a.words.slice(t), i * 4);
|
|
479
|
-
return a.sigBytes = t * 4, _.create({ key: a, iv: o, salt: r });
|
|
480
|
-
}
|
|
481
|
-
}, q = s.PasswordBasedCipher = l.extend({
|
|
482
|
-
/**
|
|
483
|
-
* Configuration options.
|
|
484
|
-
*
|
|
485
|
-
* @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL
|
|
486
|
-
*/
|
|
487
|
-
cfg: l.cfg.extend({
|
|
488
|
-
kdf: R
|
|
489
|
-
}),
|
|
490
|
-
/**
|
|
491
|
-
* Encrypts a message using a password.
|
|
492
|
-
*
|
|
493
|
-
* @param {Cipher} cipher The cipher algorithm to use.
|
|
494
|
-
* @param {WordArray|string} message The message to encrypt.
|
|
495
|
-
* @param {string} password The password.
|
|
496
|
-
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
497
|
-
*
|
|
498
|
-
* @return {CipherParams} A cipher params object.
|
|
499
|
-
*
|
|
500
|
-
* @static
|
|
501
|
-
*
|
|
502
|
-
* @example
|
|
503
|
-
*
|
|
504
|
-
* var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');
|
|
505
|
-
* var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });
|
|
506
|
-
*/
|
|
507
|
-
encrypt: function(e, t, i, r) {
|
|
508
|
-
r = this.cfg.extend(r);
|
|
509
|
-
var n = r.kdf.execute(i, e.keySize, e.ivSize, r.salt, r.hasher);
|
|
510
|
-
r.iv = n.iv;
|
|
511
|
-
var a = l.encrypt.call(this, e, t, n.key, r);
|
|
512
|
-
return a.mixIn(n), a;
|
|
513
|
-
},
|
|
514
|
-
/**
|
|
515
|
-
* Decrypts serialized ciphertext using a password.
|
|
516
|
-
*
|
|
517
|
-
* @param {Cipher} cipher The cipher algorithm to use.
|
|
518
|
-
* @param {CipherParams|string} ciphertext The ciphertext to decrypt.
|
|
519
|
-
* @param {string} password The password.
|
|
520
|
-
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
521
|
-
*
|
|
522
|
-
* @return {WordArray} The plaintext.
|
|
523
|
-
*
|
|
524
|
-
* @static
|
|
525
|
-
*
|
|
526
|
-
* @example
|
|
527
|
-
*
|
|
528
|
-
* var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });
|
|
529
|
-
* var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });
|
|
530
|
-
*/
|
|
531
|
-
decrypt: function(e, t, i, r) {
|
|
532
|
-
r = this.cfg.extend(r), t = this._parse(t, r.format);
|
|
533
|
-
var n = r.kdf.execute(i, e.keySize, e.ivSize, t.salt, r.hasher);
|
|
534
|
-
r.iv = n.iv;
|
|
535
|
-
var a = l.decrypt.call(this, e, t, n.key, r);
|
|
536
|
-
return a;
|
|
52
|
+
compute: function(t, s) {
|
|
53
|
+
for (var r, u = this.cfg, i = u.hasher.create(), a = l.create(), q = a.words, p = u.keySize, x = u.iterations; q.length < p; ) {
|
|
54
|
+
r && i.update(r), r = i.update(t).finalize(s), i.reset();
|
|
55
|
+
for (var d = 1; d < x; d++)
|
|
56
|
+
r = i.finalize(r), i.reset();
|
|
57
|
+
a.concat(r);
|
|
58
|
+
}
|
|
59
|
+
return a.sigBytes = p * 4, a;
|
|
537
60
|
}
|
|
538
61
|
});
|
|
539
|
-
|
|
62
|
+
e.EvpKDF = function(t, s, r) {
|
|
63
|
+
return g.create(r).compute(t, s);
|
|
64
|
+
};
|
|
65
|
+
}(), o.EvpKDF;
|
|
540
66
|
});
|
|
541
|
-
}(
|
|
67
|
+
}(f), f.exports);
|
|
542
68
|
}
|
|
543
69
|
export {
|
|
544
|
-
|
|
70
|
+
S as __require
|
|
545
71
|
};
|