loqui / im

Loqui IM allows you to use all your chat accounts in just one FirefoxOS or Ubuntu Touch app.
https://loqui.im
304 stars 112 forks source link

implement axolotl support #659

Open pravi opened 9 years ago

pravi commented 9 years ago

There is a similar proposal for google summer code for conversations android app. http://wiki.xmpp.org/web/Summer_of_Code_2015#axolotl_support_for_Conversations

There is already a javascript implementation of the protocol https://github.com/joebandenburg/libaxolotl-javascript

Without this support xmpp is not usable in an unreliable network, like we have in India or most developing countries that Firefox OS is targetting. This support would make xmpp a usable alternative to whatsapp.

aesedepece commented 9 years ago

:+1: , this is a must have. Meanwhile, we have OTR which is a widely adopted solution in the XMPP ecosystem.

pravi commented 9 years ago

OTR does not work well when connection breaks often, which is the case most of the time where I live. Also it needs both to be online to start. Most people use WhatsApp as a cheaper alternative to SMS. We don't have any reliable Free Software that does asynchronous end to end encrypted messages for Firefox OS. TextSecure or XMPP with axolotl would be a big boost to Firefox OS.

TitanNano commented 9 years ago

this is XMPP only, right?

aesedepece commented 9 years ago

@TitanNano Axolotl is used in WhatsApp as well.

TitanNano commented 9 years ago

Do we want to replace OTR with axolotl or do we want to support both?

pravi commented 9 years ago

I think axolotl is not yet widely available in other clients. So providing both until other clients catch up would be good.

argon-radio commented 9 years ago

I dont use loqui so far (ubuntu touch), but it would be better to support both OTR and axolotl, as pravi said, but keep them even if axolotl is more popular.

acidicX commented 9 years ago

Supporting both should definitely be good, OTR has auto-discovery for clients that support it. Is that the case with axolotl over XMPP? That should make things easier in the UI.

TitanNano commented 9 years ago

yes that's actually what I have in mind. try to go with axolotl and if the other client doesn't support it, try to fall back on OTR.

pravi commented 9 years ago

You can follow the work on axolotr support in "conversations" android app here http://conversationsgsoc2015.blogspot.fr/ He mentions some of the design decisions and challenges, it would be good to collaborate.

pravi commented 9 years ago

This has landed in conversations 1.6.0 today (its called omemo). They are drafting an xep right now.

cmeerw commented 8 years ago

Just in case anyone is interested... :-)

<message from="447961596923@s.whatsapp.net" type="text" id="1455740795-6" t="1455740796" notify="447961596923">
<enc type="pkmsg" v="1">
...</enc>
</message>
 ~ BinaryReader.prototype._readNextTree@app://750a5242-8bff-4e0d-a050-3684fd86ed3d/scripts/mozillahispano/coseme.js:5367:7 [BinaryReader] tools.js:17:6
Parsing message: {"_tag":"message","children":[{"_tag":"enc","children":[],"attributes":{"type":"pkmsg","v":"1"},"_data":{"hexdata":"3308bcc9c102122105185b8d1c94b6ed83f0220e6acb678e6262d0ca9093d5df77d10421fea537ab541a21050cc2ec8a26842c90da1bc641dba65023d536cf11685523f0499caf0393394c722242330a2105939b8dbd79bedec159f7230c2059f4c7567b3ed3f787d6beeb97adeec379d11010001800221070726ecfbfc610d678b5bbe188406582ab92d75ef4f5bbdd28f5d6b2a70430d0e0a302"}}],"attributes":{"from":"447961596923@s.whatsapp.net","type":"text","id":{"hexdata":"313435353734303739352d36"},"t":"1455740796","notify":{"hexdata":"343437393631353936393233"}},"_data":null} ~ parseMessage@app://750a5242-8bff-4e0d-a050-3684fd86ed3d/scripts/mozillahispano/coseme.js:6997:5 [ReaderThread] tools.js:17:6
ENCRYPTED MESSAGE Uint8Array [ 51, 8, 188, 201, 193, 2, 18, 33, 5, 24, 145 more… ] tools.js:17:6
Write node called with  {"_tag":"receipt","children":[],"attributes":{"to":"447961596923@s.whatsapp.net","id":"1455740795-6","t":1455740796439},"_data":null} ~ self._writeNode@app://750a5242-8bff-4e0d-a050-3684fd86ed3d/scripts/mozillahispano/coseme.js:7748:7 [ConnectionManager] tools.js:17:6
Expecting a string! number given instead. ~ BinaryWriter.prototype.writeString@app://750a5242-8bff-4e0d-a050-3684fd86ed3d/scripts/mozillahispano/coseme.js:4911:1 [BinaryWriter] tools.js:17:6
<receipt to="447961596923@s.whatsapp.net" id="1455740795-6" t="1455740796439">
</receipt>
 ~ BinaryWriter.prototype._write@app://750a5242-8bff-4e0d-a050-3684fd86ed3d/scripts/mozillahispano/coseme.js:4835:1 [BinaryWriter] tools.js:17:6
getLocalIdentityKeyPair coseme.js:88:4
getLocalRegistrationId coseme.js:92:4
SESSION CREATED Object { states: Array[1], 1 more… } tools.js:17:6
getLocalSignedPreKeyPair 4780112 coseme.js:96:4
getLocalPreKeyPair 5268668 coseme.js:101:4
getLocalIdentityKeyPair coseme.js:88:4
DECRYPTED MESSAGE Hello, world Object { message: ArrayBuffer, session: Object, identityKey: ArrayBuffer, registrationId: 1156361077 } tools.js:17:6
MESSAGE 1455740795-6 447961596923@s.whatsapp.net Hello, world 1455740796 false 447961596923 false tools.js:17:6
RECEIVE Hello, world Object {  } tools.js:17:6

There is still a lot of work to do, but seems ok for a proof of concept.

TitanNano commented 8 years ago

@cmeerw this is great! :+1:

cmeerw commented 8 years ago

I have committed some support for axolotl encryption in #950 - this supports both encryption and decryption of version 1 messages (version 2 is not supported yet, but shouldn't be too difficult to add). It also doesn't support any media encryption or encrypted group chats (supporting encrypted group chats is probably the most difficult outstanding issue). Note that it also won't work on older Firefox OS releases (currently, it will just fail there - need to at least fall back to plaintext there)