Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Encryption functions for AES GCM

salvatore_dange
Level 2
Level 2

Hello all,

Are there any function on Campaign that support AES GCM (No padding)?
Can you provide me an example to encrypt/decrypt a string?

@wodnicki @kapilKochar @Milan_Vucetic @Anita_p @Jyoti_Y @Jean-Serge_Biro & Community

 

Thanks in advace,
Salvatore

Adobe Campaign Classic encryption
1 Accepted Solution
Milan_Vucetic
Correct answer by
Community Advisor
Community Advisor

Hi @salvatore_dange,

Unfortunately not.
Only CBC chipper mode is supported and function is cryptString (AES algorithm).

Regards,

Milan

 

View solution in original post

5 Replies
Milan_Vucetic
Correct answer by
Community Advisor
Community Advisor

Hi @salvatore_dange,

Unfortunately not.
Only CBC chipper mode is supported and function is cryptString (AES algorithm).

Regards,

Milan

 

View solution in original post

Darren_Bowers
Community Advisor
Community Advisor

Hi @salvatore_dange - as @Milan_Vucetic said, there is no built-in AES-GCM crypto library in Campaign, but you can easily create your own.

https://github.com/rndme/aes4js - if you bring in this JS file intro your JavaScript codes folder and then include it into whatever process you want to encrypt/decrypt with then you have AEM GCS library support.

Cheers Darren

salvatore_dange
Level 2
Level 2

Hello,

Thanks for these feedbacks.

@Darren_Bowers this javascript probably needs some libraries and browser-related APIs to work. In fact, as you can see it fails with a simple test:

salvatore_dange_0-1593186084273.png
In case you find a code with no dependency, can you tell me also how to use it in a personalization block (loadLibrary probably doesn't work)?

 

@Milan_Vucetic what about RSA encryption methods?

salvatore_dange_1-1593186268626.png

 

Thanks again!
Salvatore

 

Darren_Bowers
Community Advisor
Community Advisor
@salvatore_dange You might need to hunt around for example code that will run on Campaign. Its a bit hit and miss trying to find specific crypto libraries that are built from the ground up in JS. You might find you have to piece something together if you want native JS that runs on Campaign. Otherwise if you *must* have this particular cypher then you might have to create a local webservice that you can call to encrypt / decrypt when you need it.
Darren_Bowers
Community Advisor
Community Advisor
You can try the minfied version of the Stanford Javascript Crypto Library http://bitwiseshiftleft.github.io/sjcl/