Data encrypted with "cryptString" function cannot be decrypted on website using CryptoJS

rwei-mms-web

05-03-2020

Hi,

I'm trying to embed some encrypted data in links in email and then get the data decrypted when user arrives at the actual website. 

 

Here is what we use to encrypt the data in the Adobe Camapgin:

<%= cryptString('test','base-64-encoded-256bit-key',false) %> 

 

Then on the website, I'm using CryptoJS (https://cryptojs.gitbook.io/docs/) to decrypt the data and I haven't been able to get the decryption working...

 

According to the cryptString documentation, cryptString uses a zero IV? the key param of the function is base64 representation of the AES key (bytes), then it's a CBC, the padding isn't clear in the documentation. I assume that's NoPadding of CryptoJS?

 

Does anyone have any success experience doing this? Thanks!

 

Javascript code:

var iv = CryptoJS.enc.Hex.parse("00000000000000000000000000000000");
var key = CryptoJS.enc.Base64.parse("base64-string-goes-here");
var decrypted = CryptoJS.AES.decrypt({
ciphertext: CryptoJS.enc.Base64.parse("output-of-cryptString"),
}, key, {
mode: CryptoJS.mode.CBC,
iv,
padding: CryptoJS.pad.NoPadding
});

 

Accepted Solutions (1)

Accepted Solutions (1)

rwei-mms-web

07-03-2020

We ended up importing CryptoJS into ACC and use it directly there. Now we have full control on how AES is done and it works great so far.

Answers (1)

Answers (1)

rwei-mms-web

05-03-2020

This is getting very interesting... one strange thing I found is that none of the test outputs I got for the cryptString function is a valid base64 string. have no clue what I'm missing here.