micheledef/encrypt-decrypt

Encrypt and Decrypt with a secret key

v1.0.0 2023-03-31 09:26 UTC

This package is auto-updated.

Last update: 2024-12-30 02:07:31 UTC


README

Encrypt and Decrypt with a secret key

Install via Composer

composer require micheledef/encrypt-decrypt

Example of use

require 'vendor/autoload.php';

use Micheledef\EncryptDecrypt\Encrypt as Encrypt;
use Micheledef\EncryptDecrypt\Decrypt as Decrypt;

$string = "Hello World";
$secretkey = "secretkey";

$encrypt = new Encrypt($string, $secretkey);

echo $encrypt;
// wdjRz+GFy9rX5dc=

$decrypt = new Decrypt($encrypt, $secretkey);
echo $decrypt;
// Hello World