Sharing is caring: pointers to Briar's implementations
Someone at 39C3 asked me about Briar’s implementations for the various transports it supports. Here, I want to give some pointers to that, but also to our research and other useful stuff.
Sources
The following websites contain code of Briar and my Oculta fork (“Briar via WhatsApp”):
Libraries
Briar provides various libraries for its core features that might be interesting for other projects as well:
- Onion Wrapper: “A Java library providing a wrapper for running a Tor client on Android, Linux, macOS and Windows. The wrapper can be used for running hidden services.”
- Tor Moat Api Wrapper: “A tiny wrapper around Tor Project’s Moat Circumvention Settings API”
- Do not kill me library: “An Android library helping to keep a foreground service with wake-locks running”
Interfaces and their implementations
Briar provides 2 interfaces for the most diverse transports it may support in form of plugins: SimplexPlugin and DuplexPlugin.
The former SimplexPlugin is used for Briar’s “one-way” connections:
RemoveableDrivePlugin: sending data via memory cardsMailboxPlugin: sending data via Briar Mailbox (store-and-forward server)- As part of an external research project, a
LoRaPlugingot drafted
The latter DuplexPlugin is used for Briar’s “two-way” connections:
TorPlugin: connections via TorTcpPlugin: connections via TCP in the local network (metadata!)AbstractBluetoothPlugin: connections via Bluetooth
This is the current full feature set of Briar Android. Briar Desktop till yet only supports Mailbox, Tor, and TCP. These plugin interfaces may be used for the craziest other transports, like broadcasting messages from radio stations, LoRa, Reticulum, other anonymization networks like I2P, or even WhatsApp (see below).
Research
Various people at Briar conducted research on social and publish mesh networks for eventual usage in Briar. One has to know that Briar currently doesn’t really do mesh networking to protect metadata. If I want to send a direct message to Alice, I only ever send it to her directly. I don’t send it to Bob to prevent Bob from knowing that and when I chat with Alice. If I share a group (“Forum”) with Alice and Bob, though, both of them will happily forward my message inside the group to the other.
Research was split into two directions. On the one hand, so-called “social meshing” was investigated where I only mesh with contacts I know. Find that research in this repository.
On the other hand, “public meshing” was researched. This is basically what qaul and Bridgefy seem to be doing: anyone running Briar would then synchronize (encrypted) messages with everyone else. Find that research in this other repository.
Also, find more information in the blog post Researching Android’s behavior during Internet shutdowns.
Oculta
Oculta was a research project where I managed to let Briar connect via WhatsApp. By leveraging whatsmeow, users can connect their Briar/Oculta app as a separate “device” in WhatsApp (think browser, tablet, etc.). Oculta then uses this connection via WhatsApp to automatically synchronize messages, just like over any other transport like Tor, Bluetooth, or memory cards. Find the code here:
- Oculta: the organization on Codeberg containing various repositories
WhatsAppPlugin: Oculta’s implementation of Briar’sSimplexPluginfor sending data via WhatsApp- whatsmeow-native: a very bare wrapper around whatsmeow to use it from inside Android apps
You’re considering writing your own transport plugin for Briar? Let’s chat!