Skip to content

Instantly share code, notes, and snippets.

View ericnakagawa's full-sized avatar
💭
🍕

Eric Nakagawa ericnakagawa

💭
🍕
View GitHub Profile
@csanz
csanz / encrypt_decrypt.js
Created August 30, 2011 16:06
Simple String Encryption & Decryption with Node.js
function encrypt(text){
var cipher = crypto.createCipher('aes-256-cbc','d6F3Efeq')
var crypted = cipher.update(text,'utf8','hex')
crypted += cipher.final('hex');
return crypted;
}
function decrypt(text){
var decipher = crypto.createDecipher('aes-256-cbc','d6F3Efeq')
var dec = decipher.update(text,'hex','utf8')
@colinmollenhour
colinmollenhour / Auth_Mongo.php
Created September 20, 2010 02:12
Auth_Mongo for Kohana
<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* Mongo Auth driver. Adapted from Kohana_Auth_ORM.
*/
class Auth_Mongo extends Auth {
/**
* Checks if a session is active.
*
* @param string role name