I need to Encrypt some data in angularjs and Decrypt in nodejs. I've seen this stackoverflow answer:
Angular CryptoJs Encryption Not Decryption in Node JS CryptoJS
and tried to use CryptoJS in my angularjs app this way:
HTML
<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/aes.js"></script>
<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/enc-base64-min.js"></script>
JS
app.controller('test', function ($scope) {
var param = 'abc'
var encry = CryptoJS.AES.encrypt(param, 'key');
console.log(encry);
});
But getting this error:
CryptoJS is not defined
I'm new in angularjs so don't have much idea about how to use different libraries.
An example of encryption in angularjs and decryption in nodejs would be very helpful.