2017 © Pedro Peláez
 

library encrypt

Generic class for performing encryption

image

phlib/encrypt

Generic class for performing encryption

  • Thursday, February 23, 2017
  • by letssurf
  • Repository
  • 5 Watchers
  • 4 Stars
  • 304 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 9 % Grown

The README.md

phlib/encrypt

Code Checks Codecov Latest Stable Version Total Downloads Licence, (*1)

PHP encryption/decryption tool, (*2)

Install

Via Composer, (*3)

``` bash $ composer require phlib/encrypt, (*4)


## Usage Creation of an encryptor ``` php $encryptor = new \Phlib\Encrypt\Encryptor\OpenSsl($encryptionPassword);

The encryption password should be a random string of data, preferably at least 32 bytes long, and should be stored on the server. For example, this could be a configuration value or constant (perhaps base64 encoded depending on how the value needs to be stored)., (*5)

The same encryption password must be used to decrypt as was used to encrypt., (*6)

Example of creating an encryption password, (*7)

``` php $encryptionPassword = \openssl_random_pseudo_bytes(32);, (*8)


Encrypt/decrypt some data ``` php $encryptor = new \Phlib\Encrypt\Encryptor\OpenSsl($encryptionPassword); $myData = 'some sensitive data which needs encrypting'; $encrypted = $encryptor->encrypt($myData); // $encryptor could be a completely different instance here, // so long as it is initialised with the same encryption password $decrypted = $encryptor->decrypt(encrypted);

License

This package is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version., (*9)

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details., (*10)

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/., (*11)

The Versions

23/02 2017

dev-master

9999999-dev

Generic class for performing encryption

  Sources   Download

LGPL-3.0

The Requires

 

The Development Requires

by Martin Price

06/04 2016

2.0.0

2.0.0.0

Generic class for performing encryption

  Sources   Download

The Requires

 

The Development Requires

by Martin Price

06/04 2016

1.0.3

1.0.3.0

Generic class for performing encryption

  Sources   Download

The Requires

 

The Development Requires

by Martin Price

23/03 2016

1.0.2

1.0.2.0

Generic class for performing encryption

  Sources   Download

The Requires

 

The Development Requires

by Martin Price

12/02 2016

1.0.1

1.0.1.0

Generic class for performing encryption

  Sources   Download

The Requires

  • php >=5.4.0
  • lib-openssl *

 

The Development Requires

by Martin Price

12/02 2016

1.0.0

1.0.0.0

Generic class for performing encryption

  Sources   Download

The Requires

  • php >=5.5.0
  • lib-openssl *

 

The Development Requires

by Martin Price