Skip to content

Instantly share code, notes, and snippets.

View puneetthakur66's full-sized avatar

Puneet Thakur puneetthakur66

  • Chandigarh
View GitHub Profile
@puneetthakur66
puneetthakur66 / encryption.js
Created September 11, 2018 05:09 — forked from Tiriel/encryption.js
Symetric encryption/decryption for PHP and NodeJS communication
'use strict';
const crypto = require('crypto');
const AES_METHOD = 'aes-256-cbc';
const IV_LENGTH = 16; // For AES, this is always 16, checked with php
const password = 'lbwyBzfgzUIvXZFShJuikaWvLJhIVq36'; // Must be 256 bytes (32 characters)
function encrypt(text, password) {