'Decrypt AES 256 CBC using crypto-js
i have the following key to decrypt erUF9SRCNQZPCBezVGzYYnUVgwAKZTvXzS5Zhgw6B/4= into "54545fwfwefweffvfdv", I tried searching for similar question but the lack of my knowledge in encryption prevent me from solving this from my own.
function getDecryptedCode() {
var key = CryptoJS.enc.Utf8.parse('JM@q@MM8AAxVV');
var iv = CryptoJS.enc.Utf8.parse('');
var ciphertext = CryptoJS.enc.Base64.parse("erUF9SRCNQZPCBezVGzYYnUVgwAKZTvXzS5Zhgw6B/4=");
var encryptedCP = CryptoJS.lib.CipherParams.create({
ciphertext: ciphertext,
formatter: CryptoJS.format.OpenSSL
});
var decryptedWA = CryptoJS.AES.decrypt(encryptedCP, key, {
iv: iv
});
var decryptedUtf8 = decryptedWA.toString(CryptoJS.enc.Utf8);
return decryptedUtf8;
}
console.log(getDecryptedCode());
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
