PHP code example of orz14 / crypt-php
1. Go to this page and download the library: Download orz14/crypt-php 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/ */
orz14 / crypt-php example snippets
use Orz14\Crypt;
// Encryption
$cipher = Crypt::encrypt('hello world');
echo $cipher; // D5kvEf5S4MAKdLNcTbZdWkMGmI34vQt+LOdP4iU7C+w=
// Decryption
$plain = Crypt::decrypt($cipher);
echo $plain; // hello world
bash
composer bash
# generate key example
php -r "echo base64_encode(random_bytes(32)) . PHP_EOL;"