danog / php-rtc-srtp
Pure-PHP SRTP and SRTCP encryption using phpseclib, with AES-CM and AES-GCM profiles. MadelineProto's PHP 8.2+ fork removes the libsrtp/FFI dependency.
Fund package maintenance!
Requires
- php: ^8.2
- danog/php-rtc-exception: ^1.0
- danog/php-rtc-mixin: ^1.0
- phpseclib/phpseclib: ^3.0
Requires (Dev)
- phpunit/php-code-coverage: 11.0.x-dev
- phpunit/phpunit: ^11.3
README
A pure-PHP library for Secure RTP (SRTP) and SRTCP packet encryption and decryption. It supports the AES-CM and AES-GCM protection profiles used by WebRTC without requiring OpenSSL or libsrtp FFI bindings.
About this fork
This is the danog/php-rtc-srtp fork used by MadelineProto. It targets PHP 8.2+, replaces the upstream libsrtp binding with an RFC 3711/RFC 7714 implementation backed by phpseclib, and includes interoperability fixes verified against pion/srtp.
All internal Composer dependencies use their danog/php-rtc-* package names directly, so installing a component selects the maintained danog packages throughout the dependency graph.
Features
- AES-GCM and AES-CM encryption for RTP/RTCP packets
- HMAC-SHA1 authentication
- Replay protection
- Interoperable with standard WebRTC implementations
Requirements
- PHP ≥ 8.2
- phpseclib 3 (installed through Composer)
- Linux environment (Windows/macOS support planned)
Documentation
This package is part of the PHP WebRTC library. For complete documentation, examples, and API reference, visit:
Credits
Authors
-
Amin Yazdanpanah
aminyazdanpanah.com github@aminyazdanpanah.com -
Sana Moniri
GitHub
Reporting Issues
Found a bug? Please report it on our issues.
License
BSD 3-Clause License. See LICENSE for details.