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.
Linux
On Debian/Ubuntu run:
$ apt install libsrtp2-dev
On Fedora/CentOS run:
$ dnf install libsrtp-devel
macOS
On macOS run:
$ brew install srtp
You will need to set some environment variables to link against libsrtp:
export CFLAGS=-I$(brew --prefix openssl)/include -I$(brew --prefix srtp)/include
export LDFLAGS=-L$(brew --prefix openssl)/lib -L$(brew --prefix srtp)/lib
License
pylibsrtp is released under the BSD license.
Metadata
Release files for pylibsrtp 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pylibsrtp-1.0.0.tar.gz | 10.9 kB | Details |
Built distributions (wheels)
Total release size: 23.2 MB
Release files / pylibsrtp-1.0.0.tar.gz
| Download URL | pylibsrtp-1.0.0.tar.gz |
|---|---|
| Size | 10.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b39dff075b263a8ded5377f2490c60d2af452c9f06c4d061c7a2b640612b34d4
|
|
BLAKE2b-256 checksum How to use checksums |
0da66e532bec974aaecbf9fe4e12538489fb1c28456e65088a50f305aeab9f89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / pylibsrtp-1.0.0-cp310-abi3-win_arm64.whl
| Download URL | pylibsrtp-1.0.0-cp310-abi3-win_arm64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.10 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
2696bdb2180d53ac55d0eb7b58048a2aa30cd4836dd2ca683669889137a94d2a
|
|
BLAKE2b-256 checksum How to use checksums |
8eec6e02b2561d056ea5b33046e3cad21238e6a9097b97d6ccc0fbe52b50c858
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / pylibsrtp-1.0.0-cp310-abi3-win_amd64.whl
| Download URL | pylibsrtp-1.0.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
8d6527c4a78a39a8d397f8862a8b7cdad4701ee866faf9de4ab8c70be61fd34d
|
|
BLAKE2b-256 checksum How to use checksums |
c37043db21af194580aba2d9a6d4c7bd8c1a6e887fa52cd810b88f89096ecad2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / pylibsrtp-1.0.0-cp310-abi3-win32.whl
| Download URL | pylibsrtp-1.0.0-cp310-abi3-win32.whl |
|---|---|
| Size | 1.2 MB |
| Tags | CPython 3.10 Windows x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
bae377c3b402b17b9bbfbfe2534c2edba17aa13bea4c64ce440caacbe0858b55
|
|
BLAKE2b-256 checksum How to use checksums |
1e512e9b34f484cbdd3bac999bf1f48b696d7389433e900639089e8fc4e0da0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / pylibsrtp-1.0.0-cp310-abi3-musllinux_1_2_x86_64.whl
| Download URL | pylibsrtp-1.0.0-cp310-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
c134fa09e7b80a5b7fed626230c5bc257fd771bd6978e754343e7a61d96bc7e6
|
|
BLAKE2b-256 checksum How to use checksums |
e35652fa74294254e1f53a4ff170ee2006e57886cf4bb3db46a02b4f09e1d99f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / pylibsrtp-1.0.0-cp310-abi3-musllinux_1_2_i686.whl
| Download URL | pylibsrtp-1.0.0-cp310-abi3-musllinux_1_2_i686.whl |
|---|---|
| Size | 2.4 MB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
f02e616c9dfab2b03b32d8cc7b748f9d91814c0211086f987629a60f05f6e2cc
|
|
BLAKE2b-256 checksum How to use checksums |
91e3715a453bfee3bea92a243888ad359094a7727cc6d393f21281320fe7798c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / pylibsrtp-1.0.0-cp310-abi3-musllinux_1_2_aarch64.whl
| Download URL | pylibsrtp-1.0.0-cp310-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.10 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
4ddb562e443cf2e557ea2dfaeef0d7e6b90e96dd38eb079b4ab2c8e34a79f50b
|
|
BLAKE2b-256 checksum How to use checksums |
8ed5130c2b5b4b51df5631684069c6f0a6761c59d096a33d21503ac207cf0e47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / pylibsrtp-1.0.0-cp310-abi3-manylinux_2_28_i686.whl
| Download URL | pylibsrtp-1.0.0-cp310-abi3-manylinux_2_28_i686.whl |
|---|---|
| Size | 2.3 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
81fb8879c2e522021a7cbd3f4bda1b37c192e1af939dfda3ff95b4723b329663
|
|
BLAKE2b-256 checksum How to use checksums |
bd08a3f6e86c04562f7dce6717cd2206a0f84ca85c5e38121d998e0e330194c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / pylibsrtp-1.0.0-cp310-abi3-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pylibsrtp-1.0.0-cp310-abi3-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.4 MB |
| Tags | CPython 3.10 Linux glibc 2.26+ x86-64 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
293c9f2ac21a2bd689c477603a1aa235d85cf252160e6715f0101e42a43cbedc
|
|
BLAKE2b-256 checksum How to use checksums |
0e14cf5d2a98a66fdfe258f6b036cda570f704a644fa861d7883a34bc359501e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / pylibsrtp-1.0.0-cp310-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
| Download URL | pylibsrtp-1.0.0-cp310-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.10 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
9209b86e662ebbd17c8a9e8549ba57eca92a3e87fb5ba8c0e27b8c43cd08a767
|
|
BLAKE2b-256 checksum How to use checksums |
573f76a841978877ae13eac0d4af412c13bbd5d83b3df2c1f5f2175f2e0f68e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / pylibsrtp-1.0.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | pylibsrtp-1.0.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.2 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
aaad74e5c8cbc1c32056c3767fea494c1e62b3aea2c908eda2a1051389fdad76
|
|
BLAKE2b-256 checksum How to use checksums |
8d0e8d215484a9877adcf2459a8b28165fc89668b034565277fd55d666edd247
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / pylibsrtp-1.0.0-cp310-abi3-macosx_10_9_x86_64.whl
| Download URL | pylibsrtp-1.0.0-cp310-abi3-macosx_10_9_x86_64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.10 abi3 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
822c30ea9e759b333dc1f56ceac778707c51546e97eb874de98d7d378c000122
|
|
BLAKE2b-256 checksum How to use checksums |
aaaf89e61a62fa3567f1b7883feb4d19e19564066c2fcd41c37e08d317b51881
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|