Download the PHP package paymetrust/laravel-data-encryption without Composer
On this page you can find all versions of the php package paymetrust/laravel-data-encryption. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download paymetrust/laravel-data-encryption
More information about paymetrust/laravel-data-encryption
Files in paymetrust/laravel-data-encryption
Package laravel-data-encryption
Short Description A Laravel package for data encryption and decryption using RSA keys
License MIT
Informations about the package laravel-data-encryption
Laravel Data Encryption
A Laravel package for json data encryption and decryption using RSA pair keys.
Installation
You can install the package via Composer:
How to use
- Generate RSA keys First you'll need to generate a public and private RSA key. To do this, follow the instructions below
You can then store your private and public keys in the storage directory of your laravel application in any subfolder or directly in the root of the folder.
-
Laravel project configuration Once your keys have been generated and stored, you will now add these two variables to the environment file : SSL_PUBLIC_KEY_PATH="your/storage/path/file.key" and SSL_PRIVATE_KEY_PATH="your/storage/path/file.key". Once this has been done, add these configurations to your config/app.php file so that the package can take them into account.
- Encrypt and decrypt data Now you can use the package to encrypt and decrypt json data. Here's an example of how to do:
To encrypt :
This method is useful if you wish to encrypt json data. For example, if you store data in your database such as tokens or keys formatted as json strings, it would be useful to hide this information for data integrity purposes.