PHP code example of edusalguero / zifratu
1. Go to this page and download the library: Download edusalguero/zifratu 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/ */
edusalguero / zifratu example snippets
$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);