Python wrapper around the libsrtp library
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pylibsrtp-0.6.3.tar.gz
(9.4 kB
view hashes)
Built Distributions
Close
Hashes for pylibsrtp-0.6.3-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7339006401f32e9fcf1f972e3ebd06e4c105e3b8b7eef35fb8675553bee83dda |
|
MD5 | d6b9214f7217746a416f9b57ddc41a01 |
|
BLAKE2b-256 | abe607bb080996bcced6705baab3ddfe75da1a32ba551b56cb90b3e68db66cfe |
Close
Hashes for pylibsrtp-0.6.3-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8237b3735f77520a637989dfda6a0910e2edbf88e8575b1cfeb09b9febc35f40 |
|
MD5 | 1325dd558f7c83cc650ab33c2d38d2f2 |
|
BLAKE2b-256 | 67d99e44c9bd7d778a036be57cada523f9f5c2db7d0551af9b9c95fe6f633a5e |
Close
Hashes for pylibsrtp-0.6.3-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47e0bec163b90f89808c11076f3f06efbd6ee249a064bfbbc647fb3644a45b6b |
|
MD5 | 74074a05f16f097c7b1d7eb881c0285b |
|
BLAKE2b-256 | b0b66f1cdf60c82ba1412a601cfc690747432e77fcf2ca623eb8dc9b2e02a82e |
Close
Hashes for pylibsrtp-0.6.3-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d742f9d539dc13eb6a666c5646b98298b284dfb522f40c924468af71266bb1e4 |
|
MD5 | 13ee84a8a468064015767f6f0e0c373b |
|
BLAKE2b-256 | 32aa911af807b9e9eb9063bfee10c18e5f19675cd3a86bd4d1419a24b31ffc77 |
Close
Hashes for pylibsrtp-0.6.3-cp37-cp37m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6b77b601fdfb6b16cd028d17783da3483d52b521088d1a70e67bf2dd358c467 |
|
MD5 | 036e9d1bde349b1a5ca6b81c80cbd067 |
|
BLAKE2b-256 | 04385c6ee11b160c4bb029d2f2a20c5e7b36a74c6f7999932255ab2552cbfb0e |
Close
Hashes for pylibsrtp-0.6.3-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf8a525ea33cc19c817decd9e1f0296849c19325d4dbabc90513b55038ff9578 |
|
MD5 | 2a97100fa64241519f428258d239767f |
|
BLAKE2b-256 | b747aab59722e3d04f106a368faf0e16e7c52ccc5ef3cf1dd2d6588ed9a5aeb9 |
Close
Hashes for pylibsrtp-0.6.3-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a0d4bff0cd894e700cf7155d5853f0be03fa4a7fcb1452ff72b05d0168b44a9 |
|
MD5 | 8c640b3c23e72bee18e4ec2bc52bda8b |
|
BLAKE2b-256 | 96125d819327e65e85ce09b1aa2e02bc2dc8b246d2030cf8f00f478c6aebb1dc |
Close
Hashes for pylibsrtp-0.6.3-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 718b8fa3fb049fd424772ac5d620ea9de5922728e58fb4fce3ff47636ada2dc9 |
|
MD5 | ca68b0de572cdffb5c3a868c8f25408e |
|
BLAKE2b-256 | 066d1a5d8444223696ac67770d450c803712a8ff4565e337fc9489e32b60f3b3 |
Close
Hashes for pylibsrtp-0.6.3-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11ff328ed660239b16c83473654c09bc00d6c499507612e1c51bd62be765d7d5 |
|
MD5 | ee28873c1549b00afc2c970c65d054dc |
|
BLAKE2b-256 | c1e415ac3f09a71c7c1eaee8caa6b832f7909aabcbf349fa8ea061d9a7a9dc3e |
Close
Hashes for pylibsrtp-0.6.3-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cf9055cd5b9ef2608564762954d992c8b869f256ab5f5f80763169214547aa5 |
|
MD5 | eccb63cda50c7787d89677526394c3bd |
|
BLAKE2b-256 | 2435965c277f2b83c2d21b5491085d1a1a94508bd62531873647187e9c4048f6 |
Close
Hashes for pylibsrtp-0.6.3-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73d44fa2fe2b3f668f2e29f54517e5cd78d4710c74aa550a5ba6ac0373af4095 |
|
MD5 | dcf013e5dd9e0758f32911f308e9d9b6 |
|
BLAKE2b-256 | ff08cc8cab46e4e4583403ef2e5a84b1be6e44e0268a9676a0398eaafaec4851 |
Close
Hashes for pylibsrtp-0.6.3-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e832bfa640ed75d2abca0c864684e2244c7f76656ab15a4589213838f8cdfe8 |
|
MD5 | b1724ff6dbb106425d6cd6c9880b59e4 |
|
BLAKE2b-256 | 5e9a4c42156a593b3b170a653146aa5689aff4c90cb07b128362ab3ab5635dbf |
Close
Hashes for pylibsrtp-0.6.3-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83a099300b441ca10de732f967533b5e61a9b0c7771ea61fe79b836c012efbdb |
|
MD5 | a95b4bfc6fe67652f13eee48616dac97 |
|
BLAKE2b-256 | a21e69bbb7361b528ce2108ece6027c55ad06555b6cadc421caf1a24dcac89f9 |
Close
Hashes for pylibsrtp-0.6.3-cp35-cp35m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e15afe1bc29bdfff5646d49210b88064d4e032f8bc23f23e330574cc768fd31 |
|
MD5 | c92f8052e7e77614658beeb6d57496f3 |
|
BLAKE2b-256 | a327a2a8ad9f48c7a2cd1d8c7851ac9ebe208e1653b210ec65d6b4d58d4a47c0 |
Close
Hashes for pylibsrtp-0.6.3-cp35-cp35m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d6c23b230dc3815e6cee750e0d0ca3deeaaf9d5df2b3aff9b69a3c44301d8d9 |
|
MD5 | ed769e97ddca87f417d393ee22531f49 |
|
BLAKE2b-256 | 21067296994c076e97109e138477d681c33358fe03ca558785bd99997e59b94a |