2017 © Pedro Peláez
 

library php-openssl-cryptor

Simple to use class for encrypting/decrypting using the PHP Openssl library.

image

pensiero/php-openssl-cryptor

Simple to use class for encrypting/decrypting using the PHP Openssl library.

  • Saturday, December 30, 2017
  • by pensiero
  • Repository
  • 0 Watchers
  • 0 Stars
  • 30 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 23 Forks
  • 0 Open issues
  • 3 Versions
  • 11 % Grown

The README.md

php-openssl-cryptor

Simple to use class for encrypting/decrypting using the PHP Openssl library., (*1)

Description

The Cryptor class supports arbitrary encryption and key hashing algorithms, along with raw, base64 and hex encoding of the encrypted data. Static convenience methods are provided for the default of AES, but a cryptor instance can be used for more flexibility. The default uses aes-256-ctr to avoid the need for padding and the related issues. Unfortunately GCM cannot be used as the PHP openssl module does not provide a way to retrieve the GCM tag. This is proposed to be remedied in PHP 7.1 when associated data can be retrieved., (*2)

Install

Require this library through composer:, (*3)

composer require pensiero/php-openssl-cryptor

Example

use OpensslCryptor\Cryptor;

$data = 'Good things come in small packages.';
$key = '9901:io=[<>602vV03&Whb>9J&M~Oq';

$encrypted = Cryptor::Encrypt($data, $key);

echo "'$data' (" . strlen($data) . ") => '$encrypted'\n\n";

$decrypted = Cryptor::Decrypt($encrypted, $key);

echo "'$encrypted' => '$decrypted' (" . strlen($decrypted) . ")\n";

The Versions

30/12 2017

dev-enhancement/references-to-original-repo

dev-enhancement/references-to-original-repo

Simple to use class for encrypting/decrypting using the PHP Openssl library.

  Sources   Download

MIT

The Requires

  • php >=5.6
  • ext-openssl *

 

30/12 2017

dev-master

9999999-dev

Simple to use class for encrypting/decrypting using the PHP Openssl library.

  Sources   Download

MIT

The Requires

  • php >=5.6
  • ext-openssl *

 

30/12 2017

v0.1.0

0.1.0.0

Simple to use class for encrypting/decrypting using the PHP Openssl library.

  Sources   Download

MIT

The Requires

  • php >=5.6
  • ext-openssl *