Skip to content

Instantly share code, notes, and snippets.

@jaredreich
Created April 11, 2019 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaredreich/68083a7fa050574f6f0c4c4136376170 to your computer and use it in GitHub Desktop.
Save jaredreich/68083a7fa050574f6f0c4c4136376170 to your computer and use it in GitHub Desktop.
Browser-side JavaScript AES Encryption
const crypto = require('sjcl')
const iter = 1000
const ks = 256
export const decrypt = (password, encrypted) => crypto.decrypt(password, encrypted)
export const encrypt = (password, text) => crypto.encrypt(password, text, { iter, ks })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment