darbe/laravel-secure-payload
最新稳定版本:v1.0.4
Composer 安装命令:
composer require darbe/laravel-secure-payload
包简介
Reusable secure payload encryption and decryption using client_id and secret_key
README 文档
README
🔐 A Laravel package for secure encryption and decryption of data using client_id and secret_key.
Features
- AES-256-CBC encryption
- Timestamp validation (anti-replay)
- Works with multiple clients from database
- Laravel 6+ compatible
- No middleware — manually use in controllers
Installation
1. Require the package (local or private repo)
composer require darbe/laravel-secure-payload
If you're using a local path repository, add this to your composer.json:
"repositories": [ { "type": "path", "url": "packages/darbe/laravel-secure-payload" } ]
2. Add client_id and secret_key to your clients table
Usage
Encrypt data
use SecurePayload; $payload = ['user_id' => 1, 'role' => 'admin']; $encrypted = SecurePayload::encrypt($payload, 'app1');
Decrypt data
use SecurePayload; $decrypted = SecurePayload::decrypt($encrypted, 'app1');
Compatibility
- Laravel 6.x+
- PHP >= 7.2
License
MIT © Darbe Group
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-05-05