Khandaq

A messenger with no phone number and no servers

There is no Khandaq server between you: messages go end-to-end encrypted from your device straight to the other person’s, over the open Tox network. If they are offline, the message waits on your device and leaves by itself when they come online.

Free and open source, for Android, iPhone, Windows, macOS and Linux.

An example chat, drawn with the app’s own parts; the people in it are made up. While Amina is offline, two messages wait in the In transit tray on your device. When she comes online, they leave by themselves, one after another, and get the delivered mark.

How it works without a server

Where other messengers have a phone number and a server, Khandaq has an ID and a path between two devices.

An ID instead of a phone number

Nobody asks for your number, email or name. On first launch the app makes a key pair on your device; the public half is the first part of your ID, and the secret half never leaves the device. You give the ID to the people you want to hear from, as text or as a QR code.

F610 617C CC60 B3AA 6703 9463 B622 30D6 717F C3A1 3586 2473 5A49 5F21 C365 CD47
Key, 64 characters. People compare it to be sure it is really you.
B209 C87B
Anti-spam, 8 characters. Change them, and your old ID stops accepting new requests.
4F21
Checksum, 4 characters. It shows a typo.
An example ID. Its last four characters really are its checksum, worked out from the first 72.
  1. Install Khandaq and create a profile. A password is optional: without one, the profile simply opens on this device. If you set one, write it down: nobody can reset it, us included.
  2. Send your ID to someone you trust, or let them scan your QR code.
  3. They paste it into the line at the top and send a request. Once you accept, you are contacts.
Search on iPhone: no match for zzqx, a note that a whole ID is 76 characters, and a button that shows all chats again.
One line at the top searches your chats and takes an ID. With no match, it reminds you that a whole ID is 76 characters.
The chat list on iPhone with the Favorites filter on: Amina and the Hiking club are online now, and Saved Messages sits below, just for you.
Filters over the list: Requests, In transit, Favorites. Below, under Just for you, is Saved Messages.

A path instead of a server

No Khandaq server receives or stores your messages. Devices find each other through the public Tox network, which volunteers run, and then talk directly. The app shows which of three paths a message has right now.

  • Direct

    Your device and theirs, with nothing in between.

  • Via a relay

    When a direct link cannot be made, a volunteer’s node passes the encrypted traffic along. It can see that two devices talk, not what they say.

  • Offline

    No path yet. Messages wait in transit on your device and leave by themselves when the person comes online.

To reach a phone that is asleep, Khandaq runs one small service, the wake relay at push.khandaq.org. It sends a signal with no message text in it; the phone wakes up and fetches the message from the sender. The privacy policy lists exactly what it sees.

The top of the chat list on iPhone: your own link reads online, via a relay, and the In transit filter shows four messages waiting for Yusuf, who is offline.
Your own link, at the top: online, via a relay. Yusuf is offline, so four messages wait in transit.
The same chat list in the dark theme: the In transit filter with everything delivered.
In transit, dark theme: everything delivered.

Your profile lives on your device

Your profile, contacts, history and received files are kept in a database on your device, and you can lock it with a password. There is no copy anywhere else.

That has two sides. A forgotten password cannot be reset by anyone. And moving to a new phone means exporting the profile as a file and importing it there: the ID and contacts come along, the chat history stays behind. A profile runs on one device at a time.

Profile transfer in the iPhone settings: export and import of the profile, and a note that the file holds your ID and contacts while the chat history stays on the device.
Profile transfer in Settings: export and import.
Appearance in the iPhone settings, in the dark theme: the theme matches the system or is set to light or dark, then the language and group system messages.
The dark theme follows the system or your choice.

All six screens are from the iPhone app; the people in them are made up.

Download Khandaq

Free on every platform. Phones install it from Google Play or TestFlight; computers download it from GitHub, with a signature you can check.

Every desktop file is also on the khandaq.org mirror.

  • Android

    From Google Play, which also keeps it up to date. Android 8+. Package com.khandaq.messenger.

    v0.2.70, GPL-3.0
  • iPhone and iPad

    A public beta through Apple TestFlight. Install TestFlight from the App Store, then open the invitation on your phone. iOS 15 or later.

    1.4.34, TestFlight build 143012, MPL-2.0
  • Windows

    Windows 10 and 11, x64. The installer puts Khandaq in the Start menu, and Settings > Apps removes it. The portable zip installs nothing: unzip it and run Khandaq.exe.

    v0.2.70 release on GitHub, GPL-3.0
  • macOS

    khandaq.app in a zip archive, for Macs with Apple Silicon and macOS 11 or later. Tested on macOS 26.

    v0.2.70 release on GitHub, GPL-3.0
  • Linux

    Debian 13 and Ubuntu 24.04 or newer: a .deb package. Other distributions with glibc 2.38 or newer: a portable archive with its own libraries. amd64.

    v0.2.70 release on GitHub, GPL-3.0

Check a download before you run it

Every desktop file is signed with a key published in the source repository, a different place from this website. A checksum alone cannot help here: whoever could replace the download could replace the checksum beside it. A signature made with a key this server does not hold can.

  1. Get the signer list from the repository, not from this page:
    curl -O https://raw.githubusercontent.com/ummalife/khandaq/master/web/downloads/allowed_signers
  2. Download the file and its .sig, then check them:
    ssh-keygen -Y verify -f allowed_signers -I releases@khandaq.org -n khandaq-release -s khandaq-messenger_amd64.deb.sig < khandaq-messenger_amd64.deb
  3. Good "khandaq-release" signature means the file is the one we built. Anything else means: do not run it, and please tell us.

ssh-keygen is already on macOS and Linux and comes with Git for Windows. SHA256SUMS.txt is still published, on GitHub and on this site, as an integrity check rather than a trust anchor: shasum -a 256 -c SHA256SUMS.txt.

Installation notes

Android: Google Play
  1. Open Khandaq on Google Play.
  2. Tap Install. Updates arrive through Google Play.
  3. Coming from an old sideloaded or debug build? Export your profile, uninstall the old app, install from Google Play and import the profile. The signing key is different, so the new app cannot update the old one in place.
Windows: the installer, the portable zip and the unknown publisher warning
  1. Download the installer and its signature, khandaq-windows-installer.exe.sig, and check it as shown above, in Git Bash: ssh-keygen -Y verify -f allowed_signers -I releases@khandaq.org -n khandaq-release -s khandaq-windows-installer.exe.sig < khandaq-windows-installer.exe. Then run it. It asks for administrator rights, installs Khandaq into Program Files and adds it to the Start menu; its last page has a checkbox for a desktop shortcut. To remove Khandaq, use Settings > Apps.
  2. No administrator rights, or rather not install anything? Take the portable zip: check its signature the same way, unzip it and run Khandaq.exe. It opens the same profile as the installed app, unless you turned on Keep the profile next to the app in its settings.
  3. Windows will warn that the publisher is unknown: the desktop build is not yet Authenticode-signed, and we are not going to pretend that is fine. Checking the signature is what tells you the file is genuine; the Windows warning says something true, which is that Windows cannot check that for you.
  4. We are not asking you to add antivirus exceptions. If your antivirus objects to a file whose signature checks out, please tell us: that is a false positive worth chasing, not something to switch off.
macOS: an app that is not notarized
  1. Check the signature as shown above, then unzip and move khandaq.app to Applications.
  2. The build is not yet notarized by Apple, so Gatekeeper will not open it on a first double-click. On macOS 15 and later, try to open it once, then go to System Settings > Privacy & Security, click Open Anyway and confirm. On macOS 14 and earlier, right-click the app, choose Open and confirm. These are Apple’s documented ways to run an app Gatekeeper cannot vouch for, and they keep the rest of Gatekeeper working.
  3. Earlier versions of this page suggested xattr -cr. It is no longer recommended: it strips the quarantine flag from everything in the bundle and turns off exactly the check you would want on the day a download is not genuine.
Debian and Ubuntu: the .deb package
  1. Download khandaq-messenger_amd64.deb and check its signature.
  2. sudo apt install ./khandaq-messenger_amd64.deb
  3. Start Khandaq from the app menu or run khandaq.
Other Linux: the portable archive
  1. tar -xzf khandaq-linux-x86_64-portable.tar.gz
  2. Keep khandaq, khandaq.bin, lib/ and plugins/ together; INSTALL.txt in the archive explains why.
  3. Recommended: install under ~/.local/share/khandaq/ and link ~/.local/bin/khandaq to it.
iPhone and iPad: TestFlight
  1. Install TestFlight from the App Store.
  2. Open the public TestFlight link on your iPhone or iPad.
  3. Accept the invitation and install Khandaq. Updates arrive through TestFlight.

Recent releases

Every release is written up with its date: what was broken, what changed and on which platforms.

Open the changelog

Open source

The Android, iPhone and desktop apps, the wake relay and this website are all on GitHub. Khandaq speaks the open Tox protocol and stays compatible with the public Tox network. It adds group chats, editing and deleting messages for both sides, reactions, voice messages, signed group history and a wake relay that carries no message content.

Public infrastructure

Questions

Do I need a phone number or email to sign up?

No. There is no account and no sign-up. You create a profile on your device and get an ID; share it with people you trust to connect. No phone number, email or other personal detail is asked for or collected.

Do you store my messages?

No. Message content stays on your devices. The only service Khandaq runs is the push wake relay, described in the repository and in the privacy policy. Bootstrap discovery runs on the public Tox DHT, which we do not operate.

Is it really end-to-end encrypted?

Yes. Every message, file and call is end-to-end encrypted by the Tox protocol (NaCl cryptography), directly between devices. No one in the middle, us included, can read your messages or see your contacts.

I sent a message but it was not delivered. Why?

There is no central server holding your messages. A message is delivered when your contact’s device is reachable. If they are offline, it waits in transit and is sent automatically once either of you reconnects, so a message can take a while if the other person has not opened the app. Keeping the app open, or allowing background work and push, makes delivery near-instant.

Why don’t I get notifications when the app is closed?

Because Khandaq is peer-to-peer, a closed app has no live connection. A small push wake service nudges your device to reconnect and fetch the message; it never carries the message content, only a wake signal. Make sure notifications are allowed for Khandaq in system settings and that the app is not force-stopped or battery-restricted. On Android, Google Play builds get these wakes automatically.

Do voice and video calls work between Android and iPhone?

Yes. One-to-one audio and video calls work across Android and iOS: both sides see each other’s camera, upright and full-screen. Calls are peer-to-peer and end-to-end encrypted like messages.

I forgot my profile password. Can you reset it?

No, and no one can. Your profile’s encryption keys are derived from that password, and no server stores it, so there is no reset. If it is lost, you will need a new profile and a new ID. Write the password down somewhere safe when you create the profile.

How do I move my profile to a new phone?

Export your profile on the old device and import it on the new one, so you keep the same ID and contacts. A profile is meant for one active device at a time: running the same one on two devices at once is not supported by the Tox protocol.

Where do I download Khandaq?

Android: the official Google Play listing, which also keeps it updated. iPhone and iPad: TestFlight, while iOS is in beta. Windows, macOS, Linux: the Download section above.

How do I report a bug?

Write to support@khandaq.org or open an issue on GitHub Issues. For a vulnerability, use the private security advisory form.

Is Khandaq the same as Matrix or Element?

No. Khandaq uses the Tox protocol: peer-to-peer, with no homeserver. This website now hosts the Khandaq Messenger download page.

Download Khandaq