2017 © Pedro Peláez
 

library simple-php-encrypter-decrypter

Simple Encrypt/Decrypt PHP Class

image

hieblmedia/simple-php-encrypter-decrypter

Simple Encrypt/Decrypt PHP Class

  • Saturday, April 2, 2016
  • by hieblmedia
  • Repository
  • 1 Watchers
  • 0 Stars
  • 115 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Simple PHP Encrypter/Decrypter Build Status

Encrypter is a simple class to encode/decode data with an secure key., (*1)

Installing via Composer

The recommended way to install it through Composer., (*2)

Install Composer

$ 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'));"

Add as dependency

$ 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';

// ...

Usage

``` 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');

// ...

Tests

You can run the unit tests with the following command:, (*10)

$ cd path/to/Encrypter/
$ php composer.phar install --dev
$ phpunit

The Versions

02/04 2016

dev-master

9999999-dev https://github.com/hieblmedia/simple-php-encrypter-decrypter

Simple Encrypt/Decrypt PHP Class

  Sources   Download

MIT

The Requires

  • ext-mcrypt *
  • php >=5.5.0

 

The Development Requires

php encrypt decrypt encryption encode decode