AES CBC encryption | Community
Skip to main content
Level 2
November 16, 2021
Solved

AES CBC encryption

  • November 16, 2021
  • 1 reply
  • 4162 views

Hi

 

I need to implement a crypting function which will use "encryption_aescbcEncrypt" 

It's the first time I implement it so i'm a bite lost of how to done it in the console.

Could you please help me with the code i need to use ? I've already the Key but i don't know if i must create a JS Code and call the parameter in the delivery in order to encrypt the information I want.

 

Any help would be appreciated

 

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by costa_n11

Hi Lise,

 

The crypt function is the one to go in ACC and the documentaiton provided is correct

https://experienceleague.adobe.com/developer/campaign-api/api/f-cryptString.html

Calling JS in the HTML has its own syntax and I suspect that's what you're facing. Could you do the following test if not alredy done

If a workflow: use a JS Code activity and place the following code and you'll have a result

 

Then in the HTML the way to call a JS function is Adobe specific using <% %> element

At the top of the delivery, put the following

 

<% include(put the JS library internal name where you have created the wallet function);
var cryptParams = WalletEncryption(targetData.LOYALTYCARDNUMBER)
%>
Then you will have yout HTML body as expected and if you want to print the value of the variable cryptParams you use the following
<%= cryptParams %>

That should work.

Thanks

Denis

1 reply

Level 2
November 19, 2021

Thanks David

 

But it not help me. We have developped a js code and on our html we have call the function but i get an error each time i test it.

 

Here is our code:

function WalletEncryption(CarteFid)
{
// Initialisation des paramètres de cryptage
var key = "xxxxx";

// Cryptage des paramètres données
var cryptParams = cryptString(CarteFid, key);

return cryptParams;
}

 

And what we have added on our html:

 

eval(yr_gene:WalletEncryption.js.data);


var cryptParams =  cryptString(targetData.LOYALTYCARDNUMBER, key);