Skip to content

Instantly share code, notes, and snippets.

View autotrof's full-sized avatar
🏠
WFH

Agung Kurniawan autotrof

🏠
WFH
View GitHub Profile
@autotrof
autotrof / php-js-aes
Last active September 23, 2019 00:36
AES encrypt-decrypt between php and javascript
//JAVASCRIPT
import CryptoJS from 'crypto-js';
import { Base64 } from 'js-base64';
const key = 'DK7Mf0GD1JR1Z3ROxeh+l/crGYKHVglLsInUN8Q8RiY=';
//function "unserialize" IS COPY FROM http://locutus.io/php/unserialize/
const unserialize = data => {
var $global = typeof window !== 'undefined' ? window : global;
var utf8Overhead = function(str) {
var s = str.length;