Titus Stahl

How to get secure decentralized chat working with XMPP both on mobile and desktop

Update: 21 November 2016 – I now recommend Riot as the best encrypted messenger, as it has similar security to Signal, it is just as decentralized as XMPP and the Android client does not require the proprietary Play Services.


While there is an excellent encrypted chat client available for iOS and Android with Signal that is perfectly suitable for people wanting to switch from WhatsApp, Telegram and other insecure clients, it does not yet fulfill all the requirements we should have for instant messaging:

  1. TextSecure so far works only on mobile devices.
  2. On Android, TextSecure requires the presence of the proprietary Google Play Services (which effectively gives Google administrator access to your phone, including the capacity to track your location and the capacity to install software without you knowing).
  3. TextSecure’s connections go via Open Whispersystem’s centralized server infrastructure. If these servers go down or the company turns evil, there is no alternative to switch to.

As these are obvious downsides, it would be great if there was an instant messaging infrastructure that worked cross-platform on both desktop and mobile, was decentralized (allowing anyone to choose a provider of their liking) and runs on a completely Free Software stack.

Of course, there is such an option: XMPP, a decentralized protocol with many client and server implementations to choose from. In its present form, however, it requires a bit of an effort to get XMPP into a usable state.

Synchronizing messages across online devices

In particular, by default, messages are not synchronized between clients, i.e. messages sent to and from your phone do not automatically appear on your desktop and vice versa which makes it pretty difficult to use if you have multiple devices.

This functionality is only present if your client and server support a feature called “message carbons”. In what follows, I will briefly describe how to get this working.

  • Of the popular messaging servers, only Yax.im supports message carbons properly as well as a number of other useful XMPP extensions. It supports in-band registration, meaning that you can create an account using your favorite XMPP client. (Update 08/10: systemli.org also supports carbons.)

  • On Android, Conversations is the best XMPP client hands-down. It supports message carbons out of the box, next to a number of other useful features that make it quite useable on shaky mobile connections. It also uses very little battery power. Two options that are very useful and not activated by default are “send button shows online status” and “foreground priority” (in the advanced options).

  • I have no information about any iOS client implementing this feature. It is on the roadmap for ChatSecure, though.

  • On the desktop, Jitsi supports message carbons. On the console, there is support in Profanity.

Useable encryption

End-to-end encryption is available for most XMPP clients through OTR. Jitsi supports OTR by default (you have to create a private key in the general options first).

However, OTR does not play nice with multiple devices as it depends on continuous key exchanges between two devices. This means that, until recently, you had to choose between multi-device message synchronization and end-to-end encryption. However, this situation is now improving: The Conversations developers have invented a new protocol called Omemo that enables OTR for multiple devices (and multiple parties).

At the moment, Conversations is the only client that implements Omemo, so you can have only securely synchronized messages if you and your chat partners use Conversations on all devices (which makes its usefulness somewhat limited, as the availability of desktop clients was part of the reasons why XMPP is better than TextSecure).

What has to be done?

The holy grail of decentralized, secure, Free Software instant messaging is now in reach – if only a few features are implemented, it can be available for everyone pretty soon.

  • More XMPP servers must enable support for message carbons (DuckDuckGo, I am looking at you).
  • Jitsi should implement Omemo (UPDATE May 2016: bug)
  • Someone needs to write an Omemo plugin for Gajim (and fix Gajim’s carbon support).
  • The popular client Pidgin should implement message carbons (bug) and Omemo (bug)
  • ChatSecure for iOS needs to implement message carbons (bug) and Omemo (bug).
  • Update 08/10/2015: ChatSecure has announced that their Android code will be based on Conversations in the future which should bring carbons and Omemo support also to this client.

Of these tasks, the missing features in Pidgin are arguably the most difficult ones, but they would be greatly increasing the availability of corporation-independent, cross-device, secure chat.

(Update 17/09/15: I had originally recommended Gajim on the desktop. Further experiments have shown that Gajim does not reliably support message carbons. Jitsi seems superior in this regard.)