The CreatorCon Call for Content is officially open! Get started here.

Facing challenge to bundle the Crypto-js.js file.

guptashalini041
Kilo Contributor

I am trying to use the crypto.js file of node.js in servicenow. As servicenow doesnot support the node.js so I am trying to bundle the crypto.js using the below URL so that I can use this js in script include.

https://www.youtube.com/watch?v=BUKF2eKL8Gk#t=646

Speaker of the above video is Josh Nerius, Developer Evangelist at ServiceNow. 

I tried to follow all the steps in this video but steps are not clear and unable to generate the bundle file.

Can someone help in creating the bundle file of crypto.js?

Josh Nerius: If you are on community, Can you please share the crypto.js file.

Thank you.

 

 

 

6 REPLIES 6

Pawe_ Ka_czugo1
Kilo Explorer

Which release are you running? As far as I can see CryptoJS 3.12 is already included in London P1 release. I've also checked Kingston P9, and haven't been able to find it there.

You can check what software is included in your release by going to stats.do page (https://instance-name.service-now.com/stats.do) and clicking "Open Source software".

Alternatively, you should be able to find a ready-made bundle, e.g. here:
https://github.com/cjnanda/snc-cryptojs

But how do you access it via a script? I see that I have it included as well, but find no documentation on its use.

Miguel Donayre
ServiceNow Employee
ServiceNow Employee

In order for this to work you are going to have to create a custom app and drop this script include to that application. THIS IS THE ONLY WAY IT WILL WORK. Just be sure you can create a custom application. I called my custom application "key_master" 

 

This is something I pieced together through different forms. So I don't have any documentation. I tried to comment as much as I could and transfer over from different files. 

I created this for an AWS S3 integration 

USE AT YOUR OWN RISK. 

find_real_file.png

 

Thanks, Miguel! This helps out a ton!

I'm getting an error when I execute 

var sig = (x_fise_nodejs.CryptoJS.HmacSHA512(requestVars, apiKey));

but works fine when I do


var sig = (x_fise_nodejs.CryptoJS.HmacSHA256(requestVars, apiKey));

Does your script work only with SHA256? If so, why? Btw, how did you export the crypto-js.js file? Which version was it?