Expand my Community achievements bar.

SOLVED

Encryption functions for AES GCM

Avatar

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?

@Jonathon_wodnicki @kapilKochar @Milan_Vucetic @Anita_punmiya @Jyoti_Yadav @Jean-Serge_Biro & Community

 

Thanks in advace,
Salvatore

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
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

Avatar

Correct answer by
Community Advisor

Hi @salvatore_dange,

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

Regards,

Milan

 

Avatar

Level 9

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

Avatar

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

 

Avatar

Level 9
@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.