Shared Encryption/decryption library for Google Apps Script.

Encryption/decryption library for Google Apps Script.

Amit Agarwal recently showed how to encrypt/decrypt Email messages using a Google Apps Script application in this post  The encryption method he used is SJCL, maintained by the Stanford Security Lab, and available on GITHUB here.
I needed something like that for a Google Apps Script version of a API (here’s the VBA version) that I’m just finishing up, so I thought I may as well share out the library.
The library contains a Google Apps Script version of SJCL, but it’s exposed by these simple functions

These can be included in your project by referencing this library in your GAS project
To encrypt strings in you project, you can do this;
and for restoring the original text;


Happy encrypting.


About brucemcp 223 Articles
I am a Google Developer Expert and decided to investigate Google Apps Script in my spare time. The more I investigated the more content I created so this site is extremely rich. Now, in 2019, a lot of things have disappeared or don’t work anymore due to Google having retired some stuff. I am however leaving things as is and where I came across some deprecated stuff, I have indicated it. I decided to write a book about it and to also create videos to teach developers who want to learn Google Apps Script. If you find the material contained in this site useful, you can support me by buying my books and or videos.

Be the first to comment

Leave a Reply

Your email address will not be published.


19 + twenty =