Encryption and decryption using asymmetric cryptography (using PHP OpenSSL extention)
based on PHP OpenSSL extension, (*1)
This Aes Class using OpenSSL extension of PHP. The official of PHP manual suggest us using OpenSSL to replace Mcrypt extention, (*2)
php -m | grep openssl, (*3)
php -m | grep openssl
composer require zmisgod/php-aes
Here is a example, (*4)
<?php require_once __DIR__ . '/vendor/autoload.php'; $aes = new SimpleAes\Aes(); $encrypt = $aes->encrypt( 'star zmisgod' ); echo $encrypt . PHP_EOL; //output : xviTncBNkTIg/44a27uGzw== echo $aes->decrypt( $encrypt ) . PHP_EOL; //output : star zmisgod
zmis.me, (*5)
@zmisgod, (*6)
Sources Download
MIT
php encryption aes decryption