This commit is contained in:
Jesse-Ma
2022-07-29 15:21:20 +08:00
parent deb1fbe49d
commit 732907c3b6
22 changed files with 592 additions and 415 deletions

View File

@@ -14,7 +14,7 @@ export function md5(word, keyWord = 'F1agn0te') {
}
//加密
export function aesEncrypt(word, keyWord = 'F1agn0te') {
export function aesEncrypt(word, keyWord) {
let key = CryptoJS.enc.Utf8.parse(keyWord);
let srcWords = CryptoJS.enc.Utf8.parse(word);
let encrypted = CryptoJS.AES.encrypt(srcWords, key, {mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7});
@@ -22,7 +22,7 @@ export function aesEncrypt(word, keyWord = 'F1agn0te') {
}
//解密
export function aesDecrypt(word, keyWord = 'F1agn0te') {
export function aesDecrypt(word, keyWord) {
let key = CryptoJS.enc.Utf8.parse(keyWord);
let decrypt = CryptoJS.AES.decrypt(word, key, {mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7});
return CryptoJS.enc.Utf8.stringify(decrypt).toString()