Use base code from novaking/ezcrypt