https://github.com/febiarifin/laravel-encryption
Combining RSA + AES Encryption to secure REST Endpoint With Sensitive Data
https://github.com/febiarifin/laravel-encryption
aes-encryption laravel laravel-framework rest-api rsa-encryption
Last synced: 4 months ago
JSON representation
Combining RSA + AES Encryption to secure REST Endpoint With Sensitive Data
- Host: GitHub
- URL: https://github.com/febiarifin/laravel-encryption
- Owner: febiarifin
- Created: 2024-09-08T11:58:57.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-09-08T12:11:04.000Z (almost 2 years ago)
- Last Synced: 2025-02-27T06:19:23.846Z (over 1 year ago)
- Topics: aes-encryption, laravel, laravel-framework, rest-api, rsa-encryption
- Language: PHP
- Homepage:
- Size: 77.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Laravel Encryption
Combining RSA + AES Encryption to secure REST Endpoint With Sensitive Data
## Installation
- Create new directory `keys` on server-app/storage and client-app/storage
- Go to directory server-app, and run command
```
openssl genpkey -algorithm RSA -out storage/keys/private_key.pem -pkeyopt rsa_keygen_bits:2048
openssl rsa -pubout -in storage/keys/private_key.pem -out storage/keys/public_key.pem
```
- Copy server-app/storage/keys/public_key.pem to client-app/storage/keys/public_key.pem
- Run command on server-app `php artisan serve --port=8000`
- Run command on client-app `php artisan serve --port=8001`
- Add `SERVER_BASE_URL=YOUR_BASE_URL` to .env on client-app
- Now hit endpoint from client-app
- Method `POST`
- Base url `http://localhost:8001/api/send-encrypted-data`