Download the PHP package hlw2326/think-request-crypto without Composer
On this page you can find all versions of the php package hlw2326/think-request-crypto. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download hlw2326/think-request-crypto
More information about hlw2326/think-request-crypto
Files in hlw2326/think-request-crypto
Download hlw2326/think-request-crypto
More information about hlw2326/think-request-crypto
Files in hlw2326/think-request-crypto
Vendor hlw2326
Package think-request-crypto
Short Description Multi-driver HTTP request signature verification, RSA context encryption and decryption library for ThinkPHP.
License MIT
Homepage https://github.com/hlw2326/think-request-crypto
Package think-request-crypto
Short Description Multi-driver HTTP request signature verification, RSA context encryption and decryption library for ThinkPHP.
License MIT
Homepage https://github.com/hlw2326/think-request-crypto
Please rate this library. Is it a good library?
Informations about the package think-request-crypto
hlw2326/think-request-crypto
ThinkPHP / PHP 企业级 HTTP 请求加解密、防篡改签名校验与上下文安全解密扩展包(方案1:RSA + AES 工业级混合加密架构,一次一密,极速高并发)。配套前端 @hlw-uni-mp/request。
🌟 核心特性(方案1 混合加密架构)
- 一次一密(One-Time Key):客户端每次请求动态生成独立的 16 字节随机 AES Key 与 16 字节 IV,彻底消除重放与静态密钥泄露风险。
- RSA-2048 单块免分段:仅使用服务端 RSA 公钥加密 33 字节的对称密钥对(
key:iv),单块加密绝无分段负担,极大降低网络传输体积与加密耗时。 - AES-128-CBC 极速吞吐:使用高效对称算法加密真实业务载荷(支持多字节 UTF-8 JSON),解密耗时降至微秒级,服务端 CPU 消耗降低 80%~95%,轻松支撑超高 QPS。
- 双向签名防篡改:采用 SHA256 算法,按业务参数递归 ASCII 字典序排序 + 时间戳 + Nonce + 密钥计算签名,安全防篡改。
- 动态时钟防重放:毫秒/秒级时间戳比对,内置可配置时钟公差(默认 300 秒),杜绝网络重放攻击。
- 开箱即用中间件:提供
CryptoMiddleware,支持在全局或特定路由一键校验并注入$request->clientContext。 - 全生态闭环:与前端 NPM 生态包
@hlw-uni-mp/request100% 协议级对称互通。
📦 安装说明
通过 Composer 安装:
⚙️ 配置说明
将 config/crypto.php 复制到 ThinkPHP 项目的 config/crypto.php:
或在 .env 环境变量中直接指定:
🚀 快速上手
1. 业务控制器静态调用
2. 使用中间件(一键全局校验)
在 ThinkPHP app/middleware.php 或特定应用/路由中注册:
🤝 配套前端
前端 Uni-app / Vue 项目请配套安装:
📄 开源协议
本项目基于 MIT License 开源。
All versions of think-request-crypto with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.1
ext-json Version *
ext-openssl Version *
ext-json Version *
ext-openssl Version *
The package hlw2326/think-request-crypto contains the following files
Loading the files please wait ...