Getting error when accessing javascript action plase help me
0
import { CryptoJS } from "crypto-js"; export async function JSA_EncryptDataNew(strStringForEncryption) { const msgString = strStringForEncryption; //JSON.stringify(data); const key = CryptoJS.enc.Utf8.parse('123'); const iv = CryptoJS.lib.WordArray.random(16); const encrypted = CryptoJS.AES.encrypt(msgString, key, { iv: iv }); return iv.concat(encrypted.ciphertext).toString(CryptoJS.enc.Base64); // END USER CODE }
asked
Roshan Mhatre
1 answers
0
That looks like CryptoJS hasn’t loaded, so is undefined when you try to access it.
It’s probably worth checking your import statement and if all the CryptoJS files are in place.
Good luck!
answered
Robert Price