skillfed

pylibsrtp

Python wrapper around the libsrtp library

pylibsrtp v1.0.0 2.0M downloads/30d#3,354 on PyPI38
Permissive license BSD-3-Clause AGING released

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 pylibsrtp

uv

uv add pylibsrtp

poetry

poetry add pylibsrtp

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Communications :: TelephonyTopic :: Security :: Cryptography

Tags

srtp encryption decryptionrtp packet protectionsecure real-time transportlibsrtp python wrapperrtp stream encryptionmedia transport securityvoice video encryption
rtp-securitymedia-encryptionwebrtc

More Cryptography packages