This repository has been archived on 2024-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Daniel Legt 5ae3d8294b + Changed the approach to an OOP model 2021-02-28 10:58:55 +02:00
.gitignore + README.md\n+ example.php\n + license 2021-02-27 13:52:14 +02:00
README.md + Credits for the image 2021-02-27 13:57:32 +02:00
config.sample.inc.php + README.md\n+ example.php\n + license 2021-02-27 13:52:14 +02:00
example-cli.php + README.md\n+ example.php\n + license 2021-02-27 13:52:14 +02:00
example.php Worked some more on the example, still wanna add a % increse in size and clean the lib to feature a memory cleaning of all of the variables that it doesn't need 2021-02-27 14:14:26 +02:00
lib.php + Changed the approach to an OOP model 2021-02-28 10:58:55 +02:00
license + README.md\n+ example.php\n + license 2021-02-27 13:52:14 +02:00

README.md

About

The Project is a simple php encryption wrapper, not even a library, the whole point is that it has integrity checks on the encryption part which helps out quite a bit with errors.

Usage

Simply use the provided functions from the lib.php file, you can simply import it into any project using that file.

require_once("/path/to/the/file/kpcrypt/lib.php")

$input = "Super secret string!";
$key   = "My key to encrypt the string with";

// Encrypt the data, the cipher can be easily changed, the integrity_check is recommended to be left to TRUE even if it takes some extra time to decrypt and check.
$encryptedData = encryptData($input, $key, 'AES-256-CBC', TRUE);

// Echo out the encrypted values to check them

echo "Encrypted: " . $encryptedData; 
echo "\n";
echo "Decrypted: " . decryptData($encryptedData, $key);
echo "\n";
echo "Peak Memory: " . memory_get_peak_usage() / 1024 . "Kb"; // Check the memory in kb

License

The licensing of the project is the MIT license

Credit

Icons made by monkik from www.flaticon.com;