tgalal / python-axolotl

Python port of libaxolotl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Byte handling in SessionCipher decryptMsg/decryptPkmsg

kalkin opened this issue · comments

The SessionCipher tries to decode() the plaintext in Python 3 here and here.

I use python-axolotl for python-omemo and the gajim-omemo plugin. OMEMO is an XMPP Extension Protocol (XEP) for secure multi-client end-to-end encryption. It is an open standard based on Axolotl. The standard dictates the following:

The client MUST use fresh, randomly generated key/IV pairs with AES-128 in Galois/Counter Mode (GCM). For each intended recipient device, i.e. both own devices as well as devices associated with the contact, this key is encrypted using the corresponding long-standing axolotl session.

So instead of plaintext i just encrypt some random 16 bytes. This approach does not work when you use Python 3 and it explodes in the above mentioned places.