Skip to content

Setting up and encription and decryption to either request or response on a laravel APP using Hybrid Encryption

Notifications You must be signed in to change notification settings

ibrosharp/laravel_crypto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Service Starter

Install

Add the following to your composer.json file

"repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/ib-Jkid/laravel_crypto.git"
        }
    ]

then run

$ composer require ibrodev/crypto

Features

  • Provides and artisan command for creating private and public keys
  • Encryt and Decrypts Request Automatically

Usage

Register the Service Provider on your Lumen/Laravel Application in boostrap/app

$app->register(\Ibrodev\Crypto\ServiceSetupServiceProvider::class);

Add the Encription and Decryption middleware to the application in boostrap/app

protected $middlewareGroups = [
    /*
    |--------------------------------------------------------------------------
    | Register Middleware
    |--------------------------------------------------------------------------
    |
    | Next, we will register the middleware with the application. These can
    | be global middleware that run before and after each request into a
    | route or middleware that'll be assigned to some specific routes.
    |
    */

    $app->middleware([
        \Ibrodev\Crypto\Middlewares\DecryptionMiddleware::class,
        \Ibrodev\Crypto\Middlewares\EncryptionMiddleware::class,
    ]);
];

Run the artisan command to generate a public and private key

php artisan crypto:init

Testing

composer run test

Credits

License

The MIT License (MIT).

About

Setting up and encription and decryption to either request or response on a laravel APP using Hybrid Encryption

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages