devkraken / cryptography
Cryptography is a method of protecting information and communications through the use of codes, so that only those for whom the information is intended can read and process it.
Requires
- php: 7.4.*
- ext-openssl: *
- devcoder-xyz/php-dotenv: *
This package is auto-updated.
Last update: 2024-06-05 21:55:57 UTC
README
🍃 Why Cryptography?
Cryptography is a method of protecting information and communications through the use of codes, so that only those for whom the information is intended can read and process it.
🚀 PHP Cryptography is a PHP version of the original Dev Kraken.
🔥Installation
Installation is super-easy via Composer:
$ composer require devkrakem/cryptography
or add it by hand to your composer.json
file.
✅Usage Notes
Add your application configuration to a .env
file in the root
of your project. Make sure the .env
file is added to your .gitignore
so it is not checked-in the code.
Make sure .env
variable name same ⬇ example
SECRET_CRYPTOGRAPHY="your_secret_key"
Make sure you load vendor autoload.php
in your application:
require 'vendor/autoload.php';
You can then load Cryptography
in your application with:
use DevKraken\Cryptography; $cryptography = new Cryptography();
For Encryption
you can use this code in your application and pass
your variable for Encryption
$cryptography->encryptionString = 'Encryption_String'; //or $cryptography->encryptionString = $variable;
For Decryption
you can use this code in your application and pass
your Encryption variable for Decryption
$cryptography->encryptionString = 'Decrypted_String'; //or $cryptography->encryptionString = $Decrypted_variable;
🍀For Example
require 'vendor/autoload.php'; use DevKraken\Cryptography; $cryptography = new Cryptography(); //Encryption $cryptography->encryptionString = 'Your_String'; echo $cryptography->encryption(); // output : eQKe1EO8xVj0vdg= //Decryption $cryptography->decryptionString = $cryptography->encryption(); echo $cryptography->decryption(); // output : Your_String
👽License
PHP Cryptography is licensed under MIT.