From 1fbe6f2fb04219e55cfe69c47a33f6b92802b44b Mon Sep 17 00:00:00 2001 From: Kato Twofold Date: Sun, 28 Feb 2021 14:13:25 +0200 Subject: [PATCH] Updated README --- README.md | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/README.md b/README.md index e111b1e..0974089 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ The Project is a simple php encryption wrapper, not even a library, the whole po ## Usage Simply use the provided functions from the lib.php file, you can simply import it into any project using that file. +#### String Encryption + ```php setEncryptionBlocks(128); // This will take ~10 times more time, but will use half as much memory. +// Really the best value is the default one. + +$enc_start = round(microtime(true) * 1000); + +// Encrypt the file +$lib->encryptFile(INPUT_FILE, OUTPUT_FILE); + +$enc_end = round(microtime(true) * 1000) - $enc_start; +$dec_start = round(microtime(true) * 1000); + +// Decrypt the file as well +$lib->decryptFile(OUTPUT_FILE, DEC_OUTPUT_FILE); + +$dec_end = round(microtime(true) * 1000) - $dec_start; + +/** + * NOTE: You can also compress the output using gzip +*/ + +echo "\n\n"; +echo "Input File Size: " . round(filesize(INPUT_FILE) / 1024 / 1024, 2) . "Mb"; +echo "\n"; +echo "Output File Size: " . round(filesize(OUTPUT_FILE) / 1024 / 1024, 2) . "Mb"; +echo "\n"; +echo "Peak Memory: " . memory_get_peak_usage() / 1024 / 1024 . "Mb"; // Check the memory in Mb +echo "\n"; +echo "Encryption Time: $enc_end ms\n"; // 9700k = ~210ms ( 4Mb = 100ms ) +echo "Decryption Time: $dec_end ms\n"; +echo "\n"; +$errors = $lib->getErrors(); +echo "Errors: " . ( !empty($errors) ? "\n" . json_encode($errors, JSON_PRETTY_PRINT) : "No Errors!"); + +``` + ## License The licensing of the project is the [MIT license](https://mit-license.org/)