Hi.
Firstly apologies, but I'm experimenting and hope my question makes some kind of sense!
I am trying to write a script for a google spreadsheet, and would like to import some crypto code from elsewhere.
The code I would like to use is here. The home page, showing the usage is here.
I have written some code to test the principle:
Obviously this doesn't work, because it doesn't recognize cryptoJS. But how can I import CryptoJS.
I know almost nothing about JavaScript - my method is just to copy and edit snippets from elsewhere, which works fine since I'm generally doing very simple things!
I even tried just copying the stuff from http://crypto-js.googlecode.com/svn/...s/tripledes.js straight into my function, but when I run it, there is a server error.
Firstly apologies, but I'm experimenting and hope my question makes some kind of sense!
I am trying to write a script for a google spreadsheet, and would like to import some crypto code from elsewhere.
The code I would like to use is here. The home page, showing the usage is here.
I have written some code to test the principle:
Code:
function endecode(){
var sheet=SpreadsheetApp.getActiveSheet();
var input=sheet.getRange(2, 1);
var password=sheet.getRange(2,2);
var encrypted=sheet.getRange(2,3);
var decrypted=sheet.getRange(2,4);
encrypted.setValue(CryptoJS.TripleDES.encrypt(input.getValue(), password.getValue()));
decrypted.setValue(CryptoJS.TripleDES.decrypt(encrypted.getValue(), password.getValue()));
};
Obviously this doesn't work, because it doesn't recognize cryptoJS. But how can I import CryptoJS.
I know almost nothing about JavaScript - my method is just to copy and edit snippets from elsewhere, which works fine since I'm generally doing very simple things!
I even tried just copying the stuff from http://crypto-js.googlecode.com/svn/...s/tripledes.js straight into my function, but when I run it, there is a server error.
Comment