One thing I discovered is that GAS is pretty slow at some things. Heavy compute tasks like cryptography is one of them. I had previously used sjcl encryption for parse.com - noSQL database for GAS but gave up on it because it was just too slow. CyptoJS is better and fine for one off encryptions. However it's much slower than running in your browser. More of that later.
cCryptoGS is available here
Many hashing functions are already included in GAS Utilities service, so all I really need is the Cipher algorithms for encrypting messages, so I've made a simple wrapper. Here's an example
For now I've included these algorithms
If you have need of any others, let me know on G+
If you need to call some of the cipher functions in CryptoJS directly, you can do that too. Here's the above example without the wrapper
Of the implemented algorithms, Rabbit is the fastest - about half a second for an encrypt/decrypt pair. Here's a test running 100 encrypts/decrypts
So what's going on? At first I thought there might some kind of caja thing going on, so I ran it again from htmlService - executing on the client, but caja-fied. Sure it takes a bit longer than purely on the client - but not that much longer.
Here's all 3 tests
Need to think some more....
For help and more information join our community, follow the blog, follow me on twitter, or follow me on g+
Services > Desktop Liberation - the definitive resource for Google Apps Script and Microsoft Office automation > Google Apps Scripts snippets >