PHP code example of salliyme / security
1. Go to this page and download the library: Download salliyme/security 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/ */
salliyme / security example snippets
use salliyme\security\Encrypt;
$instance = new Encrypt();
$instance->generateKey();
$instance->init();
$plainData = "This is a test Encrypt Encrypt and Decrypt Methods.";
$enc = $instance->private_encrypt($plainData);
$dec = $instance->public_decrypt($enc);
echo "Text:", $dec, PHP_EOL;
$plainText = "This data to test Encrypt public Encrypt and private Decrypt.";
$enc1 = $instance->public_encrypt($plainText);
$dec1 = $instance->private_decrypt($enc1);
echo "Text2:", $dec1, PHP_EOL;