Skip to content

Instantly share code, notes, and snippets.

@NathanLeadill
Created August 15, 2021 17:58
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 NathanLeadill/57cebf4a62d955730b1f5617edb79286 to your computer and use it in GitHub Desktop.
Save NathanLeadill/57cebf4a62d955730b1f5617edb79286 to your computer and use it in GitHub Desktop.
const encrypt = ((val) => {
let cipher = crypto.createCipheriv('aes-256-ctr', ENC_KEY, IV);
let encrypted = cipher.update(val, 'utf8', 'base64');
encrypted += cipher.final('base64');
return encrypted;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment