Skip to content

Latest commit

 

History

History
64 lines (38 loc) · 917 Bytes

README.md

File metadata and controls

64 lines (38 loc) · 917 Bytes

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...