PHP code example of emalherbi / myopenssl
1. Go to this page and download the library: Download emalherbi/myopenssl 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/ */
emalherbi / myopenssl example snippets
# equire_once 'vendor/autoload.php';
$ivSSL = 'klEUGdjU4M827qruJdLZVTcVYbCsWoVG';
$hashSSL = 'WK3judku9bOVPjprhrvU2xwCPwDNk4QN';
$openSSL = new MyOpenSSL\MyOpenSSL($hashSSL, $ivSSL);
$key_public = 'ABC';
echo '<pre>';
echo 'String Token:'.$key_public."\n";
$key_encrypt = $openSSL->encrypt($key_public);
echo 'Encrypted String:'.$key_encrypt."\n";
$key_decrypt = $openSSL->decrypt($key_encrypt);
echo 'Decrypted string:'.$key_decrypt."\n";
if ($key_public == $key_decrypt) {
echo "Correct authentication\n";
}
echo '</pre>';