32 lines
1.1 KiB
Markdown
32 lines
1.1 KiB
Markdown
## 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.
|
|
|
|
```php
|
|
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](https://mit-license.org/)
|
|
|
|
#### Credit
|
|
Icons made by [monkik](https://www.flaticon.com/authors/monkik) from [www.flaticon.com](https://www.flaticon.com/); |