crypto - php library
Via Composer
composer require g4/crypto
OpenSSL extension
<?php
use G4\Crypto\Crypt;
use G4\Crypto\Adapter\OpenSSL;
$crypto = new Crypt(new OpenSSL());
$crypto->setEncryptionKey('tHi5Is');
$encryptedMessage = $crypto->encode('new message');
$message = $crypto->decode($encryptedMessage);
Mcrypt extension - obsolete
<?php
use G4\Crypto\Crypt;
use G4\Crypto\Adapter\Mcrypt;
$crypto = new Crypt(new Mcrypt());
$crypto->setEncryptionKey('tHi5Is');
$encryptedMessage = $crypto->encode('new message');
$message = $crypto->decode($encryptedMessage);
$ composer install
$ make integration-tests
(The MIT License) see LICENSE file for details...