PHP code example of guil95 / encryption
1. Go to this page and download the library: Download guil95/encryption library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
guil95 / encryption example snippets
/**
* @param string $value
* @return array
*/
$encrypt = (new Encryption('SECRET_KEY', 'SECRET_IV'))->encrypt($value);
// returns
/**
[
['encryption'] => 'U2NZUzRXUGdNQXhZb2JIYmpEbjV5UT09',
['secretKey'] => '9be3012dcf7250872a8f59ee7bec763da5f263fb2a4cdb23cea25bb105df915925663dfcb54cf1cad7e9d41b53437833bda9909eb1f3d4b3dfa24689f7036bea',
['iv'] => 'bc450f24e0553f98'
]
*/
/**
* @param string $encrypt
* @return string
*/
$decrypt = (new Encryption('SECRET_KEY', 'SECRET_IV'))->decrypt($encrypt);