Another Small Encryption Helper
Encrypt string or another type of value to encryption.
by default encryption use openssl
with default AES-256-CBC
and another encryption using alternative of str_rot13
and encoded by base64_encode
/**
* Using default encryption mcrypt
*/
Pentagonal\SimpleEncryption\Encryption::encrypt('string to encrypt', 'saltkey');
/**
* Using alternative type
*/
Pentagonal\SimpleEncryption\Encryption::altEncrypt('string to encrypt', 'saltkey');
/**
* Decrypt encrypted string with auto detect encryption use
*/
Pentagonal\SimpleEncryption\Encryption::decrypt('string to decrypt', 'saltkey');
// or can use
Pentagonal\SimpleEncryption\Encryption::altDecrypt('string to decrypt', 'saltkey');
Composer is handy tool for adding library easily from packagist and another resource to your application. Get Install on here : https://getcomposer.org and install on your OS.
{
"require": {
"pentagonal/simple_encrypt" : "~1.0"
}
}
Or directly install via terminal
composer require pentagonal/simple_encrypt
This library require php 5.4.0 or later. Suggest to enable openssl
on your php configuration.
MIT License https://opensource.org/licenses/MIT