PHP Classes
elePHPant
Icontem

PHP Encryption Library: Encrypt and decrypt data using adapter classes

Recommend this page to a friend!
  Info   View files Example   View files View files (8)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2019-02-05 (16 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 105 This week: 17All time: 9,051 This week: 29Up
Version License PHP version Categories
php-encryption-class 1.0MIT/X Consortium ...5PHP 5, Cryptography
Description Author

This package can encrypt and decrypt data using adapter classes.

It can take data to encrypt with a given key and calls an adapter class that encrypt that data.

It can also decrypt the previously encrypted data with the same adtayer class.

Currently the package provides adapter classes to encrypt and decrypt data using OpenSSL and LibSodium.

Name: Muhammad Umer Farooq is available for providing paid consulting. Contact Muhammad Umer Farooq .
Classes: 43 packages by
Country: Pakistan Pakistan
Age: 17
All time rank: 124617 in Pakistan Pakistan
Week rank: 2 Up1 in Pakistan Pakistan Up
Innovation award
Innovation award
Nominee: 2x

Details

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

//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();

//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('sodium');

Use of openSSL

<?php use Lablnet\Encryption; require '../vendor/autoload.php';

$encryption = new Encryption('openssl');

//You can also provide your own key for openSSL $encryption1 = new Encryption('openssl','my-key');

  Files folder image Files  
File Role Description
Files folder imageexample (1 file)
Files folder imagesrc (1 file, 1 directory)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file readme.md Doc. Read me

  Files folder image Files  /  example  
File Role Description
  Accessible without login Plain text file index.php Example Example script

  Files folder image Files  /  src  
File Role Description
Files folder imageAdapter (3 files)
  Plain text file Encryption.php Class Class source

  Files folder image Files  /  src  /  Adapter  
File Role Description
  Plain text file AbstractAdapter.php Class Class source
  Plain text file OpenSslEncryption.php Class Class source
  Plain text file SodiumEncryption.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:105
This week:17
All time:9,051
This week:29Up