PageSourceSearch

https://doormaster.me/static/js/crypto/encryp.js

js doormaster.me collected 2026-09-24 11:06:21 UTC 1,905 bytes, 53 lines download raw bytes

1/**
2 * 工具类
3 */
4const CryptoUtil = {
5	// 加密
6	encrypt: (word, keyStr) => { 
7		// const keyStr = process.env.VUE_APP_OTHER_ENCRYPTED_KEY;
8		var key  = CryptoJS.enc.Utf8.parse(keyStr);//Latin1 w8m31+Yy/Nw6thPsMpO5fg==
9		var srcs = CryptoJS.enc.Utf8.parse(word);
10		var encrypted = CryptoJS.AES.encrypt(srcs, key, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7});
11		return encrypted.toString();
12	},
13	
14	// 解密
15	decrypt: (word, keyStr) => {
16		// const keyStr = process.env.VUE_APP_OTHER_ENCRYPTED_KEY;
17		var key  = CryptoJS.enc.Utf8.parse(keyStr);//Latin1 w8m31+Yy/Nw6thPsMpO5fg==
18		var decrypt = CryptoJS.AES.decrypt(word, key, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7});
19		return CryptoJS.enc.Utf8.stringify(decrypt).toString();
20	},
21	
22	// AES加密
23	aesEncrypt: (params, encryptKey, encryptIV) => {
24		const key = CryptoJS.enc.Utf8.parse(encryptKey);
25		const iv = CryptoJS.enc.Utf8.parse(encryptIV);
26		let encrypted = CryptoJS.AES.encrypt(params, key, {
27			iv: iv,
28			mode: CryptoJS.mode.CBC,  // ECB模式比较弱(弱加密),容易被破解,改成CBC
29			padding: CryptoJS.pad.Pkcs7
30		});
31		encrypted = encrypted.toString();
32		// encrypted = encrypted.toString().replaceAll(System.lineSeparator(), ""); //将换行符替换为空
33		// encrypted = encrypted.toString().replaceAll(System.lineSeparator(), ""); //将换行符替换为空
34		return encrypted;
35	},
36	
37	// AES解密
38	aesDecrypted: (params, encryptKey, encryptIV) => {
39		const key = CryptoJS.enc.Utf8.parse(encryptKey);
40		const iv = CryptoJS.enc.Utf8.parse(encryptIV);
41		let decrypted = CryptoJS.AES.decrypt(params, key, {
42			iv: iv,
43			mode: CryptoJS.mode.CBC,  // ECB模式比较弱(弱加密),容易被破解,改成CBC
44			padding: CryptoJS.pad.Pkcs7
45		});
46		decrypted = CryptoJS.enc.Utf8.stringify(decrypted);
47		return decrypted;
48	}
49};
50
51if (typeof module !== 'undefined'){
52	module.exports =  CryptoUtil;
53}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.