Skip to content

Instantly share code, notes, and snippets.

View cdimascio's full-sized avatar
👋
🤔👨‍💻🚀

Carmine DiMascio cdimascio

👋
🤔👨‍💻🚀
View GitHub Profile
@cdimascio
cdimascio / crypto-ctr.js
Last active March 2, 2018 23:26 — forked from chris-rock/crypto-ctr.js
Encrypt and decrypt text in nodejs
// Part of https://github.com/chris-rock/node-crypto-examples
// Nodejs encryption with CTR
var crypto = require('crypto'),
algorithm = 'aes-256-ctr',
password = 'd6F3Efeq',
key = Buffer.from('5ebe2294ecd0e0f08eab7690d2a6ee69', 'hex'),
iv = Buffer.from('26ae5cc854e36b6bdfca366848dea6bb', 'hex');
function encrypt(text){