Using CryptoJS library server side

manasa ks
Tera Contributor

HI Team

Issue : Imported the CryptoJS AES library in script include  and facing below error " Evaluator: org.mozilla.javascript.EcmaError: "Link to Lib : https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.0.0/aes.min.js

Executed Below Script in Scoped App :

var wsClient = new x_snc_customEncryption.CryptoJS();
var enc_result = wsClient.AES.encrypt(current.short_description, "888888888888888888", {
iv: '888888888888888888'
});

gs.info(enc_result);

 Kindly assist in resolving issue ...as client side encryption and decryption is achievable but facing issue at server side.

 

Thanks

Manasa

1 ACCEPTED SOLUTION

It will save you time and grief if you just buy it.  I have gone down this road before DB Encryption and ultimately DB Encryption will save a lot of work and support headaches.

But if you really want to go there this is what I did 4 years ago before DB Encryption.
https://community.servicenow.com/community?id=community_question&sys_id=d0394fe1db5cdbc01dcaf3231f9619d5&view_source=searchResult

 

View solution in original post

6 REPLIES 6

manasa ks
Tera Contributor

Checking out the Link you provided . I think it will help me out to implement AES encryption without the need of Plugin... Have to check the details of the code .

 

Thanks

Manasa

Akash Kumar7
Tera Expert

Hi, I had the same issue with CryptoJS to use in ServiceNow to call DUO API which has a sha1 sign 
here is the thing that worked very well for me 
- Create a scoped app / use any scoped app 
- Create scrip include
Name  CryptoJS
paste script from //https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.2.0/crypto-js.js  or any version 
create a new script include to call CryptoJS functions, make this as Accessible from all application scope so that you can use in global or other application 
attaching images for reference 

Thanks 
Akash