* Fixed a bug in the library
* Fixed the example.php to work with the new OOP style
This commit is contained in:
@@ -16,12 +16,16 @@ function limitStringSize($str, $amount = 20) {
|
||||
return $str;
|
||||
}
|
||||
|
||||
$kpc = new kpcrypt($config['key']);
|
||||
|
||||
echo "Key: " . $kpc->getKey() . " \n";
|
||||
|
||||
// Echo out the results
|
||||
$encryptedData = encryptData($config['input'], $config['key'], 'AES-256-CBC', TRUE);
|
||||
$encryptedData = $kpc->encryptData($config['input'], 'AES-256-CBC', TRUE);
|
||||
|
||||
echo "Encrypted: " . limitStringSize($encryptedData);
|
||||
echo "\n";
|
||||
echo "Decrypted: " . limitStringSize(decryptData($encryptedData, $config['key']));
|
||||
echo "Decrypted: " . limitStringSize($kpc->decryptData($encryptedData));
|
||||
echo "\n";
|
||||
echo "Peak Memory: " . memory_get_peak_usage() / 1024 / 1024 . "Mb"; // Check the memory in kb
|
||||
echo "\n\n";
|
||||
|
||||
Reference in New Issue
Block a user