Facing challenge to bundle the Crypto-js.js file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2018 09:35 PM
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.
- Labels:
-
Integrations
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2018 03:56 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2020 10:28 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2020 11:08 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2023 04:17 PM
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?