getCode() {
let data = "qN49G7bBKHBJpl3mTfwyYA=="
let key = "bluedon"
let iv = "0102030405060708"
let str = this.getDAesString(data, key, iv)
this.$message.success(str)
},
getDAesString(encrypted, key, iv) {
//
var ikey = CryptoJS.enc.Utf8.parse(key)
var iiv = CryptoJS.enc.Utf8.parse(iv)
var decrypted = CryptoJS.AES.decrypt(encrypted, ikey, {
iv: iiv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
})
console.log(decrypted.toString(CryptoJS.enc.Utf8))
return decrypted.toString(CryptoJS.enc.Utf8) //
}
The project is written by vue, so the decrypted console.log is empty. After reading it many times, the ciphertext and key/ ivvalue can be transferred on the online website, but I can"t get the result. That"s what it says on the Internet.