Skip to content

Instantly share code, notes, and snippets.

View ariassd's full-sized avatar
🏠
Working from home

Luis Arias ariassd

🏠
Working from home
View GitHub Profile
@nibarius
nibarius / jsencrypt.js
Last active August 18, 2021 19:34
A variant of jsencrypt.js that can (only) be used to sign messages using public key. Can run in an environment without the window and navigator properties.
// This is a modification of jsencrypt.js from https://github.com/travist/jsencrypt
// It has been modified to remove all accesses to window and navigator to be
// able to use it together with Google Apps Scripts where these properties does not
// exist.
//
// The only intended use of this code is to sign messages using a public key. It
// is done like this:
//
// var encrypt = new JSEncrypt();
// encrypt.setPublicKey(publicKey);