baha2rmirzazadeh / phpguard
This package is abandoned and no longer maintained.
The author suggests using the blackplatinum/encryption package instead.
A security cryptography library for PHP. It can be used by different frameworks or pure PHP
v3.1.6
2020-01-25 22:03 UTC
Requires
- php: ^7.2.25
- ext-json: *
- ext-openssl: *
- ext-redis: *
- baha2rmirzazadeh/phpscanner: ^1.5
- symfony/console: ^4.3
README
A security cryptography library for PHP. It can be used by different frameworks or pure PHP
PHPGuard Console App
A command line interface designed for this library due to set a encryption key, test system etc.
Some of commands:
- [php guard set:key]
- [php guard fresh] Installation
Use [Composer] to install the package:
$ composer require baha2rmirzazadeh/phpguard
Examples
use PHPGuard\Crypto\Crypto; use PHPGuard\Crypto\Key; $cr = new Crypto("CAST5-CBC"); $cr->setKey(Key::getKey()); $c = $cr->encrypt([ "Name" => "Baha2r", "LastName" => "Mirzazadeh", "Age" => 22, "IsStudent" => true, "Courses" => ["Math", "Ecocnomy", "Chemistry"] ]); print $c."\n"; print_r($cr->decrypt($c)); $cr = $cr->setCipher("AES-192-CBC"); $cr->setKey(Crypto::generateKey()); $c = $cr->encrypt([ "Name" => "Baha2r", "LastName" => "Mirzazadeh", "Age" => 22, "IsStudent" => true, "Courses" => ["Math", "Ecocnomy", "Chemistry"] ]); print $c."\n"; print_r($cr->decrypt($c)); print_r(Crypto::supported());
Author
- [Bahador Mirzazadeh]
- E-Mail: [baha2r.mirzazadeh98@gmail.com]
License
MIT