edusalguero/zifratu

A PHP library to encrypt and decrypt using AES in a MySQL compatible way

v1.0.1 2016-12-31 17:08 UTC

This package is not auto-updated.

Last update: 2024-09-28 20:14:40 UTC


README

Build Status Scrutinizer Code Quality

Zifratu

Zifratu is a simple PHP library to encrypt and decrypt using AES in a MySQL compatible way

Usage

<?php

$secret = 'my secret key';
$valueToSecure = 'test';
$zifratu = new \EduSalguero\Zifratu\ZifratuFacade($secret);

$encryptedValue = $zifratu->encrypt($valueToSecure);
$decryptedValue = $zifratu->decrypt($encryptedValue);

printf('Secret: %s' . PHP_EOL, $secret);
printf('Value to secure: %s' . PHP_EOL, $valueToSecure);
printf('Encrypted value: %s' . PHP_EOL, $encryptedValue);
printf('Decrypted value: %s' . PHP_EOL, $decryptedValue);