This is a Python library for communicating with XMPP destinations using OTR (Off-the-Record Messaging) encryption.
Features
Your internet application can talk securely to you on your PC or smartphone using readily-available chat software with OTR support
OTRv2
Send to and receive from multiple destinations, with or without fingerprint verification
Pure python (no libotr dependency)
Installation
$ sudo pip install --pre xmpppy # xmpppy is tagged as an "rc" version $ sudo pip install otrxmppchannel
Example
import time
from otrxmppchannel import OTRXMPPChannel
from otrxmppchannel.connection import OTR_TRUSTED, OTR_UNTRUSTED,
OTR_UNENCRYPTED, OTR_UNKNOWN
# Load the base64-encoded OTR DSA key. Constructing the object without
# a key will generate one and provide it via ValueError exception.
privkey = open('.otrprivkey', 'r').read()
class MyOTRChannel(OTRXMPPChannel):
def on_receive(self, message, from_jid, otr_state):
if otr_state == OTR_TRUSTED:
state = 'trusted'
elif otr_state == OTR_UNTRUSTED:
state = 'UNTRUSTED!'
elif otr_state == OTR_UNENCRYPTED:
state = 'UNENCRYPTED!'
else:
state = 'UNKNOWN OTR STATUS!'
print('received %s from %s (%s)' % (message, from_jid, state))
mychan = MyOTRXMPPChannel(
'bradass87@jabber.ccc.de/datadiode',
'supersecret',
[
(
'mendax@jabber.wikileaks.org',
'33eb6b01c97ceba92bd6b5e3777189c43f8d6f03'
),
'esnowden@chat.nsa.gov'
],
privkey
)
mychan.send('') # Force OTR setup
time.sleep(3) # Wait a bit for OTR setup to complete
mychan.send('This message should be encrypted')
Notes
XMPP invitations are not handled
It seems to take roughly 3 seconds to set up an OTR session. Messages sent before the session is ready may be lost.
The private key serialization format is specific to pure-python-otr. Conversions from other formats are not handled.
Dependencies
xmpppy (>= 0.4.1)
pure-python-otr (>= 1.0.0)
Donations
If you found this software useful and would like to encourage its maintenance and further development, please consider making a donation to the Bitcoin address 1MWFhwdFVEhB3X4eVsm9WxwvAhaxQqNbJh.
License
This is free and unencumbered public domain software. For more information, see http://unlicense.org/ or the accompanying UNLICENSE file.
Metadata
Release files for OTRXMPPChannel 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| OTRXMPPChannel-1.0.4.tar.gz | 6.2 kB | Without provenance | Details |
Release files / OTRXMPPChannel-1.0.4.tar.gz
| Download URL | OTRXMPPChannel-1.0.4.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9665036ddce08cfe976003b11f864c4e3d279f48e8919ed692ec22f378afdc98
|
|
BLAKE2b-256 checksum How to use checksums |
75490472a4602f304d162dd3c2a7d78127b9f825baab7bcb7089b73adc21ca68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for OTRXMPPChannel 1.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.