PHP Classes

File: readme.md

Recommend this page to a friend!
  Packages of Muhammad Umer Farooq   PHP Encryption Library   readme.md   Download  
File: readme.md
Role: Documentation
Content type: text/markdown
Description: Read me
Class: PHP Encryption Library
Encrypt and decrypt data using adapter classes
Author: By
Last change: Merge pull request #7 from peter279k/fix_key

Fix key is same on different Encryption classes
Update readme.md
Fix : The specific key should not have the default value #1
first
Date: 6 months ago
Size: 2,140 bytes
 

Contents

Class file image Download

Build Status StyleCI

PHP Encryption

Encryption in PHP.

Requirement

  1. PHP 7 (7.3 Recommanded).
  2. Composer.
  3. openSSL php extension.
  4. Sodium php extension for use sodium adapter.

Insallation

Installing this package is very simple, first ensure you have the right PHP version and composer installed then in your terminal/(command prompt) run:



## Encrypt
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;


### Decrypt
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;


### Adapter
This Package support two encryption adapter
- OpenSSL
- Sodium

Default openSSL will use,
you can use any one you want.

### change Adapter
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');


## Contributions  
There is still a lot of work to do, so feel free to contribute to open `PR`  
  
## License  
MIT  
  
## Support  
Donate coffee?  
here is the bitcoin address  
Balance

Thanks you so much.

Disclaimer

I don't Accept any responsibility for any illegal usage