/crypto

encryption php library

Primary LanguagePHPMIT LicenseMIT

crypto

crypto - php library

Install

Via Composer

composer require g4/crypto

Usage

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

mcrypt-viking-funeral

<?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);

Development

Install dependencies

$ composer install

Run tests

$ make integration-tests

License

(The MIT License) see LICENSE file for details...