2017 © Pedro Peláez
 

library opencrypt

Two-way encryption (encrypt and decrypt) data using PHP with OpenSSL

image

martinusso/opencrypt

Two-way encryption (encrypt and decrypt) data using PHP with OpenSSL

  • Thursday, October 26, 2017
  • by martinusso
  • Repository
  • 2 Watchers
  • 4 Stars
  • 33 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 22 % Grown

The README.md

opencrypt

Build Status Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version Latest Unstable Version License composer.lock, (*1)

Two-way encryption (encrypt and decrypt) data using PHP with OpenSSL, (*2)

Installation

composer require martinusso/opencrypt, (*3)

Tips

  • $secretKey should have been previously generated in a cryptographically safe way, like openssl_random_pseudo_bytes. OpenCrypt has a static method OpenCrypt::generateKey() for this.

Usage

$password = "OpenCrypt";

// Should have been previously generated in a cryptographically safe way
$secretKey = 'SECRET_KEY';

// You can pass the IV as argument or it is generated automatically
$openCrypt = new OpenCrypt($secretKey [, string $iv ]);

// get the IV
$iv = $openCrypt->iv();

// encrypt
$encryptedPassword = $openCrypt->encrypt($password);
// $encryptedPassword = 'GWw3bqL7FqjmRs0yyIR/8A=='

// decrypt
$decryptedPassword = $openCrypt->decrypt($encryptedPassword);
// $decryptedPassword = 'OpenCrypt'

generate IV

OpenCrypt offers a static method to generate a safe IV:, (*4)

$iv = OpenCrypt::generateIV();

generate key

it is also possible to generate a safe secret key:, (*5)

$secretKey = OpenCrypt::generateKey();

License

This software is open source, licensed under the The MIT License (MIT). See LICENSE for details., (*6)

The Versions

26/10 2017

dev-master

9999999-dev https://github.com/martinusso/opencrypt

Two-way encryption (encrypt and decrypt) data using PHP with OpenSSL

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0
  • ext-openssl *

 

The Development Requires

php encrypt decrypt openssl

26/10 2017

3.1.0

3.1.0.0 https://github.com/martinusso/opencrypt

Encrypts and decrypts data using PHP with OpenSSL

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0
  • ext-openssl *

 

The Development Requires

php encrypt decrypt openssl

24/10 2017

3.0.0

3.0.0.0 https://github.com/martinusso/opencrypt

Encrypts and decrypts data using PHP with OpenSSL

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0
  • ext-openssl *

 

The Development Requires

php encrypt decrypt openssl

24/10 2017

2.0.0

2.0.0.0 https://github.com/martinusso/opencrypt

Encrypts and decrypts data using PHP with OpenSSL

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0
  • ext-openssl *

 

The Development Requires

php encrypt decrypt openssl

23/10 2017

1.0.0

1.0.0.0 https://github.com/martinusso/simplecrypt

Encrypts and decrypts data using PHP with OpenSSL

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0
  • ext-openssl *

 

The Development Requires

php encrypt decrypt openssl