Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Python wrapper around the libsrtp library

Project description

rtd pypi-v pypi-pyversions pypi-l pypi-wheel tests codecov

What is pylibsrtp?

pylibsrtp is a Python wrapper around libsrtp, making it possible to encrypt and decrypt Secure Real-time Transport Protocol (SRTP) packets from Python code.

SRTP is a profile of the Real-time Transport Protocol (RTP) which provides confidentiality, message authentication, and replay protection. It is defined by RFC 3711.

You can install pylibsrtp with pip:

$ pip install pylibsrtp

To learn more about pylibsrtp please read the documentation.

Example

#!/usr/bin/env python

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)

# protect RTP
tx_policy = Policy(key=key, ssrc_type=Policy.SSRC_ANY_OUTBOUND)
tx_session = Session(policy=tx_policy)
srtp = tx_session.protect(rtp)

# unprotect RTP
rx_policy = Policy(key=key, ssrc_type=Policy.SSRC_ANY_INBOUND)
rx_session = Session(policy=rx_policy)
rtp2 = rx_session.unprotect(srtp)

# check roundtrip worked!
assert rtp2 == rtp

Building pylibsrtp

If you wish to build pylibsrtp yourself, you will need libsrtp version 2.0 or better.

On Debian/Ubuntu run:

$ apt install libsrtp2-dev

On OS X run:

$ brew install srtp

License

pylibsrtp is released under the BSD license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pylibsrtp, version 0.6.7
Filename, size File type Python version Upload date Hashes
Filename, size pylibsrtp-0.6.7-cp35-cp35m-macosx_10_9_x86_64.whl (53.3 kB) File type Wheel Python version cp35 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-cp35-cp35m-manylinux2010_i686.whl (72.8 kB) File type Wheel Python version cp35 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-cp35-cp35m-manylinux2010_x86_64.whl (75.4 kB) File type Wheel Python version cp35 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-cp35-cp35m-win32.whl (42.6 kB) File type Wheel Python version cp35 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-cp35-cp35m-win_amd64.whl (48.5 kB) File type Wheel Python version cp35 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-cp36-cp36m-macosx_10_9_x86_64.whl (53.3 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-cp36-cp36m-manylinux2010_i686.whl (72.4 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-cp36-cp36m-manylinux2010_x86_64.whl (75.0 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-cp36-cp36m-win32.whl (42.7 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-cp36-cp36m-win_amd64.whl (48.4 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-cp37-cp37m-macosx_10_9_x86_64.whl (53.3 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-cp37-cp37m-manylinux2010_i686.whl (72.4 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-cp37-cp37m-manylinux2010_x86_64.whl (75.0 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-cp37-cp37m-win32.whl (42.6 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-cp37-cp37m-win_amd64.whl (48.5 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-cp38-cp38-macosx_10_9_x86_64.whl (53.4 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-cp38-cp38-manylinux2010_i686.whl (72.9 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-cp38-cp38-manylinux2010_x86_64.whl (75.5 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-cp38-cp38-win32.whl (42.7 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-cp38-cp38-win_amd64.whl (48.5 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-cp39-cp39-macosx_10_9_x86_64.whl (53.4 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-cp39-cp39-manylinux2010_i686.whl (72.5 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-cp39-cp39-manylinux2010_x86_64.whl (75.1 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-cp39-cp39-win32.whl (42.7 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-cp39-cp39-win_amd64.whl (48.5 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-pp36-pypy36_pp73-macosx_10_9_x86_64.whl (50.1 kB) File type Wheel Python version pp36 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-pp36-pypy36_pp73-manylinux2010_x86_64.whl (54.8 kB) File type Wheel Python version pp36 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-pp37-pypy37_pp73-macosx_10_9_x86_64.whl (50.1 kB) File type Wheel Python version pp37 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-pp37-pypy37_pp73-manylinux2010_x86_64.whl (54.8 kB) File type Wheel Python version pp37 Upload date Hashes View
Filename, size pylibsrtp-0.6.7-pp37-pypy37_pp73-win32.whl (40.6 kB) File type Wheel Python version pp37 Upload date Hashes View
Filename, size pylibsrtp-0.6.7.tar.gz (10.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page