Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 692 Bytes

README.md

File metadata and controls

24 lines (17 loc) · 692 Bytes

Data encryption with OpenSSL in PHP

It is a simple object oriented library for data encryption using the OpenSSL PHP extension.

See details in the blogpost.

Example usage:

namespace OpenSslCrypt;

$processor = new Processor();

/*
 * Encryption with the public key.
 */
$pubKey = Key\Pub::fromCertificateFile('ssl/crypt.crt');
$encData = $processor->encrypt($data, $pubKey);

/*
 * Decryption with the private key.
 */
$privKey = Key\Priv::fromPrivateKeyFile('ssl/crypt.key');
$decData = $processor->decrypt($encData, $privKey);