Recommend this page to a friend! |
Download .zip |
Info | Example | View files (8) | Download .zip | Reputation | Support forum (1) | Blog (1) | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 193 This week: 1 | All time: 8,410 This week: 341 |
Version | License | PHP version | Categories | |||
php-encryption-class 1.0.0 | MIT/X Consortium ... | 5 | PHP 5, Cryptography |
Description | Author | ||||||||||||||
This package can encrypt and decrypt data using adapter classes. |
|
Encryption in PHP.
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 |
File | Role | Description | ||
---|---|---|---|---|
example (1 file) | ||||
src (1 file, 1 directory) | ||||
composer.json | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
readme.md | Doc. | Read me |
Files | / | src | / | Adapter |
File | Role | Description |
---|---|---|
AbstractAdapter.php | Class | Class source |
OpenSslEncryption.php | Class | Class source |
SodiumEncryption.php | Class | Class source |
php-encryption-class-2019-02-05.zip 5KB | |
php-encryption-class-2019-02-05.tar.gz 3KB | |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.