Recommend this page to a friend! |
Download |
Info | Example | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 212 | All time: 8,343 This week: 571 |
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. |
|
<?php |
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 (8) |
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 (8) | / | src | / | Adapter |
File | Role | Description |
---|---|---|
AbstractAdapter.php | Class | Class source |
OpenSslEncryption.php | Class | Class source |
SodiumEncryption.php | Class | Class source |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
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.