From d2699064135423ea1c6e1e05af0195b3719a1426 Mon Sep 17 00:00:00 2001 From: Kato Twofold Date: Sat, 27 Feb 2021 13:52:14 +0200 Subject: [PATCH] + README.md\n+ example.php\n + license --- .gitignore | 1 + README.md | 29 +++++++++++++++++++++++++++++ config.sample.inc.php | 3 ++- example-cli.php | 4 ++++ example.php | 12 ++++++++++++ lib.php | 18 +----------------- license | 9 +++++++++ 7 files changed, 58 insertions(+), 18 deletions(-) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 example-cli.php create mode 100644 license diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2b9ce0a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +config.inc.php \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..434673c --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +## 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/) \ No newline at end of file diff --git a/config.sample.inc.php b/config.sample.inc.php index 669d608..41ece27 100644 --- a/config.sample.inc.php +++ b/config.sample.inc.php @@ -1,3 +1,4 @@