kanti/mcrypt

Simpel Static mcrypt helper object

1.4 2014-12-19 07:51 UTC

README

https://github.com/Kanti/MCrypt/releases/latest https://packagist.org/packages/kanti/mcrypt

install via Composer

command line:

composer require kanti/mcrypt ~1

composer.json:

"require":{
  "kanti/mcrypt": "~1"
}

how to use it

<?php
require_once "vendor/autoload.php";

$key = "Password";
$data = file_get_contents(__FILE__);
$options = array();

$jsonString = Kanti\MCrypt::encrypt($key, $data, $options);
$data = Kanti\MCrypt::decrypt($key, $jsonString);

var_dump($jsonString);
var_dump($data);

$options

option default
algorithm MCRYPT_RIJNDAEL_256
mode MCRYPT_MODE_CBC
iv php mcrypt_create_iv(mcrypt_get_iv_size($algorithm, $mode), MCRYPT_DEV_URANDOM)

Changlog

Version 1.3

Incompatible to Version 1.2 Data.