Skip to content

Instantly share code, notes, and snippets.

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

Adrian Bravo adrianbravo

🏠
Working from home
  • Minted
  • Philadelphia, PA
View GitHub Profile
@adrianbravo
adrianbravo / encrypt-decrypt.js
Created September 22, 2011 00:08
Basic Node.js crypto cipher/decipher example.
var crypto = require('crypto')
, key = 'salt_from_the_user_document'
, plaintext = 'password'
, cipher = crypto.createCipher('aes-256-cbc', key)
, decipher = crypto.createDecipher('aes-256-cbc', key);
cipher.update(plaintext, 'utf8', 'base64');
var encryptedPassword = cipher.final('base64')
decipher.update(encryptedPassword, 'base64', 'utf8');
@adrianbravo
adrianbravo / vimrc
Created August 2, 2011 20:47
My vimrc
syntax on
set number
set hls
set laststatus=2
set ignorecase
set smartcase
set wildmenu
set paste
set autoindent