Download the PHP package frista28/stream-crypto-psr7 without Composer
On this page you can find all versions of the php package frista28/stream-crypto-psr7. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package stream-crypto-psr7
stream-crypto-psr7
PSR-7 stream decorators for WhatsApp-like media encryption.
The package provides:
Frista28\StreamCryptoPsr7\Stream\EncryptingStreamfor PSR-7 stream encryptionFrista28\StreamCryptoPsr7\Stream\DecryptingStreamfor PSR-7 stream decryption with MAC validationFrista28\StreamCryptoPsr7\Crypto\MediaCryptofor lower-level string and stream APIsFrista28\StreamCryptoPsr7\Crypto\MediaTypefor media-specific HKDF context selection
The crypto core processes source streams in chunks instead of loading the full payload into a single PHP string. The decorators materialize the transformed result into a seekable temporary stream on first read, so the exposed PSR-7 stream remains rewindable and seekable after transformation.
Requirements
- PHP 8.2 or newer
ext-openssl
Installation
Usage
Stream Decorators
Low-Level Crypto API
MediaCrypto also exposes direct string and stream APIs when you do not need the decorators:
Sidecar Generation
For streamable media types (VIDEO and AUDIO), MediaCrypto can generate WhatsApp-compatible sidecar metadata in
the same encryption pass without rereading the plaintext source stream:
The returned sidecar is a binary string that should be stored alongside the encrypted media object and used as
streaming metadata for chunk validation.
The library currently implements full-stream encryption/decryption and sidecar generation. Chunk-level validation and offset-based partial decryption are intentionally outside the current API surface.
Quality Checks
Run the full local quality gate:
Run individual tools:
Development
The project targets PHP 8.2 and uses:
- PHPUnit for tests
- PHPStan for static analysis
- PHP CS Fixer for code style