Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Sohrab Saran sohrabsaran

🎯
Focusing
View GitHub Profile
@sohrabsaran
sohrabsaran / crypto-aes-gcm.js
Last active Jul 7, 2019 — forked from chrisveness/crypto-aes-gcm.js
Uses the SubtleCrypto interface of the Web Cryptography API to encrypt and decrypt text using AES-GCM (AES Galois counter mode).
View crypto-aes-gcm.js
/*
Forked from https://gist.github.com/chrisveness/43bcda93af9f646d083fad678071b90a
License: MIT
This version at: https://gist.github.com/sohrabsaran/5f1260a5410ee38b9e88dc186af37f70
Changes:
1. Fixed regex bug in ctStr.match (fixed later in the original in https://gist.github.com/chrisveness/43bcda93af9f646d083fad678071b90a/revisions#diff-d559f25d942e0fc455a7207c04b00d94)
2. Added polyfill for TextEncoder
*/
/**