nichin79/encrypt-php

There is no license information available for the latest version (v1.0.1) of this package.

Basic encrypt/decrypt for PHP

v1.0.1 2024-02-24 21:19 UTC

This package is auto-updated.

Last update: 2024-09-24 22:51:47 UTC


README

Simple class for openssl_encrypt and openssl_decrypt functionality for PHP

Example

<?php

require_once __DIR__ . '/../vendor/autoload.php';

use Nichin79\Encryption\Encryption;

$encryption = new Encryption([
  'passphrase' => 'pass1234',
]);

$string = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
$encrypted = $encryption->encrypt($string);
$decrypted = $encryption->decrypt($encrypted);

echo "\r\nOriginal String:\r\n$string\r\n";
echo "\r\nEncrypted String:\r\n$encrypted\r\n";
echo "\r\nDecrypted String:\r\n$decrypted\r\n";