d3nengineer/stream-encryption-psr7
最新稳定版本:v1.0.1
Composer 安装命令:
composer require d3nengineer/stream-encryption-psr7
包简介
PSR-7 stream decorators for media encryption (AES-CBC + HKDF + HMAC)
README 文档
README
d3nengineer/stream-encryption-psr7 is a PHP 8.2+ library that exposes lazy PSR-7 stream decorators for media encryption and decryption using AES-CBC, HKDF-SHA256, and truncated HMAC-SHA256 payloads.
Warning
Do not use in production. This repository was created as part of a test assignment and is published for demonstration purposes only. It is not production-ready and is not recommended for real-world use.
Installation
composer require d3nengineer/stream-encryption-psr7
Recommended Entry Point
Use Infra\StreamEncryption\Stream\StreamFactory for the common happy path. It creates lazy encrypting and decrypting decorators without changing the underlying stream behavior or exception model.
<?php use GuzzleHttp\Psr7\Utils; use Infra\StreamEncryption\Enum\MediaType; use Infra\StreamEncryption\Stream\StreamFactory; $factory = new StreamFactory(); $mediaKey = random_bytes(32); $encrypted = $factory->encrypt( Utils::streamFor("binary\x00payload"), $mediaKey, MediaType::IMAGE, ); $decrypted = $factory->decrypt( Utils::streamFor((string) $encrypted), $mediaKey, MediaType::IMAGE, ); $plaintext = (string) $decrypted;
Supported Runtime
- PHP 8.2+
psr/http-message^1.0 or ^2.0guzzlehttp/psr7^2.0
Verification
Run the same checks locally that the repository uses for release-readiness:
composer check
More Details
Package behavior and operational guarantees that do not belong on the landing page live in docs/usage.md. Maintainer-facing release steps live in docs/release-checklist.md.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-01