Encryption in PHP.
- PHP 7 (7.3 Recommanded).
- Composer.
- openSSL php extension.
- Sodium php extension for use sodium adapter.
Installing this package is very simple, first ensure you have the right PHP version and composer installed then in your terminal/(command prompt) run:
composer require lablnet/encryption
You can encrypt string by calling to encrypt method
<?php
use Lablnet\Encryption;
require '../vendor/autoload.php';
$encryption = new Encryption('your-key');
//Encrypt the message
$encrypt = $encryption->encrypt("This is a text");
echo $encrypt;
You can decrypt token by calling decrypt method
<?php
use Lablnet\Encryption;
require '../vendor/autoload.php';
$encryption = new Encryption('your-key');
//Decrypt the message
$decrypt = $encryption->decrypt($encrypt);
echo $decrypt;
This Package support two encryption adapter
- OpenSSL
- Sodium
Default openSSL will use, you can use any one you want.
You can pass supported adapter to class like
Use of sodium
<?php
use Lablnet\Encryption;
require '../vendor/autoload.php';
$encryption = new Encryption('your-key','sodium');
Use of openSSL
<?php
use Lablnet\Encryption;
require '../vendor/autoload.php';
$encryption = new Encryption('your-key','openssl');
There is still a lot of work to do, so feel free to contribute to open PR
MIT
Donate coffee?
here is the bitcoin address
37x6PA4qtPu2fQnYdW5U7jztYhbchASpBV
Thanks you so much.
I don't Accept any responsibility for any illegal usage