pylibsrtp
Python wrapper around the libsrtp library
What it is and what it does
pylibsrtp is a Python wrapper around the Cisco libsrtp C library, enabling SRTP packet encryption and decryption directly from Python. SRTP is a security profile of RTP (Real-time Transport Protocol) that adds confidentiality, message authentication, and replay protection—essential for securing voice, video, and other real-time media streams. The package exposes a Policy and Session API to configure encryption keys and SSRC handling, then protect or unprotect individual RTP packets.
The package depends on cffi for C bindings and requires libsrtp 2.0 or later as a system library. It supports Python 3.10 through 3.14 and is distributed as precompiled wheels for most major platforms (Linux, macOS, Windows, including ARM variants), reducing build friction. The project is marked Production/Stable but shows aging maintenance—the last release was 305 days ago, though the repository remains active.
Use it for:
- Encrypt RTP streams in WebRTC applications to ensure media confidentiality between peers.
- Protect VoIP packets in SIP-based telephony systems using standards-compliant SRTP.
- Implement media security in custom real-time communication frameworks that handle raw RTP.
- Validate or decrypt SRTP packets in network monitoring or protocol analysis tools.
- Secure multicast RTP streams where multiple receivers share the same encryption key.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
pylibsrtp encrypts and decrypts Secure Real-time Transport Protocol (SRTP) packets, providing confidentiality, message authentication, and replay protection for RTP streams.
Yes, if you need SRTP packet encryption in Python and can meet the libsrtp 2.0+ system dependency. The package is stable, permissively licensed, and widely downloaded (top 5000 on PyPI). Install friction is moderate due to the compiled dependency, but prebuilt wheels are available for most platforms. Maintenance is aging—no vulnerabilities are known, but the 305-day release gap suggests the project is not actively developed; use it for production only if you accept that bug fixes or feature updates may be infrequent.
Install
pylibsrtp on PyPI
pip
pip install pylibsrtpuv
uv add pylibsrtppoetry
poetry add pylibsrtpInstalling pylibsrtp
Before you install
Medium install friction due to compiled wheels; requires libsrtp 2.0 or later as a system dependency. Maintenance is aging—last release was 305 days ago, though the repository remains active with recent commits and no archived status.
License in practice
Released under BSD-3-Clause (permissive), allowing commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install pylibsrtp
from pylibsrtp import Policy, Session
key = b'\x00' * 30
rtp = b'\x80\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' + (b'\xd4' * 160)
tx_policy = Policy(key=key, ssrc_type=Policy.SSRC_ANY_OUTBOUND)
tx_session = Session(policy=tx_policy)
srtp = tx_session.protect(rtp)
Requires libsrtp 2.0 or later installed on the system (apt/dnf/brew depending on OS); Python 3.10 or later.
Verify before relying
- Whether the package is actively maintained or in maintenance-only mode given the 305-day release gap.
- Performance characteristics and throughput for high-volume RTP stream protection.
- Compatibility with specific RTP implementations or media frameworks beyond basic packet protection.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — cffi |
| Maintenance | aging — 305 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,027,178/month — #3,354 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pylibsrtp-1.0.0-cp310-abi3-macosx_10_9_x86_64.whl; pylibsrtp-1.0.0-cp310-abi3-macosx_11_0_arm64.whl; pylibsrtp-1.0.0-cp310-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pylibsrtp-1.0.0-cp310-abi3-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl; pylibsrtp-1.0.0-cp310-abi3-manylinux_2_28_i686.whl; pylibsrtp-1.0.0-cp310-abi3-musllinux_1_2_aarch64.whl; pylibsrtp-1.0.0-cp310-abi3-musllinux_1_2_i686.whl; pylibsrtp-1.0.0-cp310-abi3-musllinux_1_2_x86_64.whl; pylibsrtp-1.0.0-cp310-abi3-win32.whl; pylibsrtp-1.0.0-cp310-abi3-win_amd64.whl; pylibsrtp-1.0.0-cp310-abi3-win_arm64.whl
Tags
More Cryptography packages
Certifi provides Mozilla's curated collection…
copyleft · top 100 on PyPI
cryptographycryptography provides cryptographic recipes and…
permissive · top 100 on PyPI
rsaPure-Python RSA encryption, decryption,…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
azure-identityProvides Microsoft Entra ID token-based…
unclear · top 1,000 on PyPI
PyNaClPyNaCl provides Python bindings to libsodium…
permissive · top 1,000 on PyPI
rtpDecodes, encodes, and manipulates RTP…
permissive · top 15,000 on PyPI
pyAesCryptEncrypts and decrypts files and binary streams…
permissive · top 15,000 on PyPI
aiortspProvides asyncio-based RTSP client…
copyleft · top 15,000 on PyPI
PyRMVtransportQueries real-time and scheduled transport…
permissive · top 15,000 on PyPI
oscryptooscrypto provides TLS sockets, key generation,…
permissive · top 1,000 on PyPI
PGPyPGPy implements OpenPGP (RFC 4880) in pure…
permissive · top 5,000 on PyPI
PyOTPPyOTP generates and verifies one-time passwords…
permissive · top 1,000 on PyPI
dynamodb-encryption-sdkEncrypts and decrypts DynamoDB items…
permissive · top 15,000 on PyPI
thrift-saslImplements SASL authentication transports for…
permissive · top 5,000 on PyPI