mirror of
https://github.com/iLay1678/i-tools.git
synced 2025-07-05 19:49:00 +08:00
fix
This commit is contained in:
parent
694dff0df2
commit
ba12f72d1d
@ -198,7 +198,6 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
watch()
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
@ -1,15 +1,14 @@
|
|||||||
import { md5 } from "js-md5";
|
import { md5 } from "js-md5";
|
||||||
import pkg from "crypto-js";
|
import CryptoJS from "crypto-js";
|
||||||
const crypto = pkg;
|
|
||||||
const decrypt = function (ciphertext: string, iv: string, t: number): string {
|
const decrypt = function (ciphertext: string, iv: string, t: number): string {
|
||||||
try {
|
try {
|
||||||
const key = generateKey(t);
|
const key = generateKey(t);
|
||||||
const decrypted = crypto.AES.decrypt(ciphertext, crypto.enc.Utf8.parse(key), {
|
const decrypted = CryptoJS.AES.decrypt(ciphertext, CryptoJS.enc.Utf8.parse(key), {
|
||||||
iv: crypto.enc.Hex.parse(iv),
|
iv: CryptoJS.enc.Hex.parse(iv),
|
||||||
mode: crypto.mode.CBC,
|
mode: CryptoJS.mode.CBC,
|
||||||
padding: crypto.pad.Pkcs7
|
padding: CryptoJS.pad.Pkcs7
|
||||||
});
|
});
|
||||||
const dec = crypto.enc.Utf8.stringify(decrypted).toString();
|
const dec = CryptoJS.enc.Utf8.stringify(decrypted).toString();
|
||||||
return dec;
|
return dec;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Decryption failed", error);
|
console.error("Decryption failed", error);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user