dev-master
9999999-dev https://github.com/hieblmedia/simple-php-encrypter-decrypterSimple Encrypt/Decrypt PHP Class
MIT
The Requires
- ext-mcrypt *
- php >=5.5.0
The Development Requires
php encrypt decrypt encryption encode decode
Wallogit.com
2017 © Pedro Peláez
Simple Encrypt/Decrypt PHP Class
Encrypter is a simple class to encode/decode data with an secure key., (*1)
The recommended way to install it through Composer., (*2)
$ curl -sS https://getcomposer.org/installer | php
Or if you don't have curl:, (*3)
$ php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"
$ php composer.phar require hieblmedia/simple-php-encrypter-decrypter:dev-master
After installing, you need to require Composer's autoloader (if not already present):, (*4)
<?php require 'vendor/autoload.php'; // ...
``` php <?php, (*5)
$value = 'My String';, (*6)
// Get encrypter with random secure key $encrypter = new \HieblMedia\Encryption\Encrypter;, (*7)
$encodedValue = $encrypter->encode($value); echo "Encoded value: $encodedValue\n"; // Encrypted value, (*8)
$decodedValue = $encrypter->decode($encodedValue); echo "Decoded value: $decodedValue\n"; // My String, (*9)
### Use your own fixed secure key ###
``` php
<?php
$encrypter = new \HieblMedia\Encryption\Encrypter('yourFixedSecureKey');
// ...
You can run the unit tests with the following command:, (*10)
$ cd path/to/Encrypter/ $ php composer.phar install --dev $ phpunit
Simple Encrypt/Decrypt PHP Class
MIT
php encrypt decrypt encryption encode decode