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.2.tar.gz
(9.4 kB
view hashes)
Built Distributions
Close
Hashes for pylibsrtp-0.6.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad44c7808087cffd7b77c66287cc8aa52909ac8814c0efc9b9f47810cb83d1eb |
|
MD5 | 4ad32801f050a87272a7847778a6fd7c |
|
BLAKE2b-256 | 5acb4acd063e76878e4a34ccdde78280f47c0bd9bff3cf08e9eee832e1c2b82b |
Close
Hashes for pylibsrtp-0.6.2-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 288b9cabd69f04123574487027ae52f5b018d8aadd7647c31459fc10b536920c |
|
MD5 | 760d7dfe7bffe7e545c70224b0275c98 |
|
BLAKE2b-256 | a41c099e30e8e3991d5ba35981a37734a2f8b9317a29385c582a3cabaa021e81 |
Close
Hashes for pylibsrtp-0.6.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a6dfb2608735d2d28746dbf4efff0349db83d4efc242b6dbe22b05c72c17ee0 |
|
MD5 | e9585f99592679f176db1555b7ebdd84 |
|
BLAKE2b-256 | bdf13d5b5f7ffa9e8fdef5febe164e5be05759aa8d5d5369f942197194617e73 |
Close
Hashes for pylibsrtp-0.6.2-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39db1765a994fa5ca56b279e7e73f727aeacd81c07ea510248251923d7059a2f |
|
MD5 | 651da225672b758f9349862272670ef2 |
|
BLAKE2b-256 | 9ed033a2df24aee9607a78a36d0a98ddd37d1aa7b7aa4b6a384e4c1a76bd43d4 |
Close
Hashes for pylibsrtp-0.6.2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30895bbe0936452075131e7ebe69bfd211fd66041403bf4b6038a26e520a7958 |
|
MD5 | 4b56430f722cd178f69cd97cbc204bd2 |
|
BLAKE2b-256 | 4d4d79f9d36a2208efc0907ed99b00926ca7efbf29056a506f02c0613b684dc1 |
Close
Hashes for pylibsrtp-0.6.2-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94887bc0d38279860ebef1f678964e764bba7d6395fa97c9f6e0e3809282767d |
|
MD5 | 5e876f410db9e3cc6838184913e9419b |
|
BLAKE2b-256 | 9ef9fa54875f62bdd1cf12b3e95f11a5e38eb92465de924a148c7848b5c6edc2 |
Close
Hashes for pylibsrtp-0.6.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a43882069634e5e840325ff118c69f3e65943db64bd2feb272f0737c28b995aa |
|
MD5 | a928145ceb1e157bd0ea0ab6291f3521 |
|
BLAKE2b-256 | 526ace551279912fcc182e607cc9bded8fa4245b166b996fea447e57fa79771c |
Close
Hashes for pylibsrtp-0.6.2-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0d33193a543b4f3372d79292ff24ed62cfa664c1ebc30bbedbfc690f75d0aae |
|
MD5 | 3d36af865bbb0c31b0cb26f8fbe94753 |
|
BLAKE2b-256 | 238d5eab8dd83c71d34fd45ee17fd19a81efb216b8ae2b6e86db8a235ec00ad5 |
Close
Hashes for pylibsrtp-0.6.2-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8aa915fbb3df54d44c78a70d82c22ef28a6503cfb36e86118bc245303205279 |
|
MD5 | bb7a16ecb3229a0e72d6d79a48730008 |
|
BLAKE2b-256 | 3001e67838496d9e27e5a0b2ab0c70c8fa28c8eddbd90dc1c7b3071219bf62f9 |
Close
Hashes for pylibsrtp-0.6.2-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df6cad5209813b4f4744d94c058abeebd447620ff5cb66e2baa5be6eea63f635 |
|
MD5 | 85cb1df8d59a9312e8189b6df3b68a7c |
|
BLAKE2b-256 | 8fdd7b3a11b9091f63db0e5076b390d02f39258aec1875ab0f3a9969f851ba9c |
Close
Hashes for pylibsrtp-0.6.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccb8776196cb5e810375232a1d07415dd7161b03a8aacda10fb512dbfbe9d525 |
|
MD5 | 1da7cd4bfde0249dedbee831e6d0c8de |
|
BLAKE2b-256 | d591a8d6386fcc194bf807d8efd4570c9567aea945f5df0f3d26b3fbd1c17427 |
Close
Hashes for pylibsrtp-0.6.2-cp35-cp35m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 334fd48100e8202de9a2ea53ba589dfa6f413c30efc81f25b74d8b58e55e2683 |
|
MD5 | 445b224c099e178be6549d6d77d28728 |
|
BLAKE2b-256 | 3e6de1c53a8baae9e688b931630c11f2b45409f1ddbabb989371e466fa347754 |