Skip to content

Instantly share code, notes, and snippets.

View subversivo58's full-sized avatar
📧
For critical issues, send me an email

Lauro Moraes subversivo58

📧
For critical issues, send me an email
View GitHub Profile
@subversivo58
subversivo58 / .env
Created October 13, 2017 21:24
Simple wrapper to use "googleapis" in Node
HOST=mehost.com
APP_MAIL="Site Name" <memail@mehost.com>
GMAIL_APITOKEN={JSON API TOKEN}
GMAIL_APISECRET={JSON API SECRET}
class HandlerSessionManager
{
      private $dbCollection;
      private $dbSession;
      private $dbName;
      private $expire;
      private $token;
      private $clean;
@subversivo58
subversivo58 / decrypt.js
Created September 4, 2016 10:15 — forked from pradipchitrakar/decrypt.js
AES Encrypt data in php and decrypt in node js.
//require cyrpto module
var crypto=require('crypto');
//key and iv should be same as the one in encrypt.php
var decipher=crypto.createDecipheriv('aes-256-cbc','12345678901234561234567890123456','1234567890123456');
//since we have already added padding while encrypting, we will set autopadding of node js to false.
decipher.setAutoPadding(false);
// copy the output of encrypt.php and paste it below