This is sort of a part two to the question Trying to print hex string with CryptoJS
Basically, I have a function that uses CryptoJS to encrypt a message and spit out the cypher text as a hex string.
function EncryptAES(text, key) {
var encrypted = CryptoJS.AES.encrypt(text, key);
return encrypted.ciphertext.toString()
}
I want to write a function DecryptAES that takes the hex string, key, and salt (which I apparently need) and returns the original plaintext. The problem is I can't figure out how to get the hex string back into a form that CryptoJS.AES.decrypt will accept, and I can't find anywhere in the documentation where it actually explains how to do it. Maybe I overlooked something. Please help.