Murmo: A secure messenger that is still just a messenger
by Hexagon, 8 minutes read murmo rootcard cryptalk security encryption messaging rust federation
So, there I was, with an identity system that I had just built for a space game. A login where the password never leaves the browser, and an account that belongs to the user instead of the server. I kept thinking that it would fit something else even better: a messenger. I had played with that idea once before, just for fun, a long time ago. This time I wanted to do it properly, and the result is Murmo.
Some of you may have read the post about rootcard, the federated identity that I built for Xigna. This post is about what came next. But first, a short look back at a fun little project from about twelve years ago.
Back in 2014: Cryptalk
In 2014 I wrote Cryptalk, mostly to see if I could. It was a small HTML5 and Node.js chat, encrypted in the browser. The server was "just a messenger", and it never saw what you wrote. It worked like this:
- You joined a room with
/join, and set a passphrase with/key. - The browser derived a 256 bit key from the passphrase with PBKDF2, and encrypted every message with AES-256 before it was sent.
- Everyone with the same room and passphrase could read the messages. Everyone else saw garbage.
- Messages were "torched" from the screen after ten minutes.
It was a toy, and it was fun to build. It even got a Docker image, a Heroku button and a few stars on GitHub along the way. But it was never meant to be a real messenger, and looking back at it, it shows:
- The passphrase was the only thing. It had to be shared some other way, and anyone who had it could read everything, and write as anyone. There was no way to know who really wrote a message.
- There were no identities. A nickname was just a word you typed with
/nick. - It was a terminal in a browser tab. Slash commands, and the README recommended incognito mode. Fine for a nerd, not for everyone else.
- The server served the code. The encryption ran in the browser, but the server delivered that browser code. A bad server could change it.
That was fine for a hobby project. Fixing it would have needed real identities, and in 2014 I didn't have a good answer for that, nor a reason to find one. Cryptalk has not been updated in years, and I consider it deprecated. Please don't use it for anything today. But the idea stuck with me: a chat where the server is just a messenger. The last point, by the way, is still true for every web app, and I'll get back to it.
What changed: rootcard
When rootcard was done, I suddenly had the missing piece. A rootcard is an identity that the user holds, like an ID card:
- The password never leaves the browser.
- The account id is a hash, and its history is a public log signed by a recovery key that only the user has.
- Anyone can check who you are on their own, without asking a central service.
That is exactly what a messenger needs. If I want to write to Alice#3F9C, I
need to know that the keys I encrypt to really belong to Alice, and not to
someone the server put in between. With rootcard, that trust can start from
Alice's own recovery key instead of from my server.
So I started something new. Not a new version of Cryptalk, but a real messenger this time, with everything I had learned since. It was called mesg for a while, and is now called Murmo.
The goal: as simple as any other messenger
I had a short list again. Murmo should:
- Encrypt every message end to end. The server only ever sees ciphertext.
- Not ask for a phone number or an e-mail address.
- Not let anyone find you by searching. You need someone's exact identifier to write to them.
- Be federated. Anyone can run a server, and people on different servers can write to each other.
- Keep as little as possible on the server. No message history, no contact lists, no access logs.
- Still look and feel like any other messenger.
The last point was the hard one. Security that nobody uses doesn't protect anyone. You shouldn't have to know what a key is to send a message.
So in Murmo you create an account with a name and a password, like everywhere else. You start a conversation, write, send pictures and files, react with an emoji, edit a message, or take it back. It works on the phone, can be installed as an app, and has notifications (that only say "New message"). It speaks English, German, Spanish and Swedish, and has a dark theme.
All the hard parts are still there. They are just in places where you don't have to look at them every day.
How it works, briefly
Your identity is a rootcard. You can create it on a Murmo server, or log in
with a card from another home, like rootcard.org. Your
address looks like Alice#3F9C, or Alice#3F9C@chat.example.org for someone on
another server.
Every browser is a device. It has its own signing key and encryption keys, created with WebCrypto as non-extractable keys. An account's devices form a signed, hash-chained list. The first entry is signed by the account key from the rootcard, and after that, only an existing device can add a new one. So a stolen password is not enough to read your messages. To add a new phone, you compare a code on both screens and approve it on a device you already have. The new device then gets your history from the old one.
Messages are encrypted per device. When you send a message, your browser encrypts it separately for each of the recipient's devices, and for your own other devices (X25519, HKDF and AES-256-GCM). The message is signed by your device inside the encryption, so the server doesn't even see who sent what when it stores it.
The first message is a request. A stranger can't just show up in your chats. The first message from someone new lands in Requests, and you choose to accept, decline or block. The server can't tell a request from any other message, so it never learns who your contacts are.
Safety codes let you compare, in person, that nobody sits in between. And every message carries the newest device lists the sender has seen, so contacts act as witnesses for each other. If a server tries to show different device lists to different people, it is detected as a fork, and the conversation is blocked with a warning.
If you lose your last device, a paper key can approve a new one. The paper key is useless without your password, and your password is useless without the paper key. And if everything is gone, the recovery card from rootcard still gives you your identity back. But not the history. That only lives on your devices, by design.
Why Rust
The server is written in Rust. This is where my detour to Rust with croner a few years ago paid off. Back then I was new to the language. For a server that faces the internet and has to be correct, it was an easy choice this time.
The Murmo server is a single binary. It is a rootcard home, a store for the
public device lists, a WebSocket mailbox for ciphertext, a relay for files, and
the federation between servers. All of it in about ten thousand lines of Rust,
on top of a handful of crates: axum and tokio for HTTP and WebSockets,
rusqlite with a bundled SQLite for storage, ureq with rustls for talking
to other servers, and of course rootcard and rootcard-host.
Rust is a good fit here for a couple of reasons:
- No memory bugs in the parts that read untrusted data. The server reads
WebSocket frames, JSON and binary file chunks from anyone on the internet, and
from other servers. The crate has
unsafe_code = "forbid", and clippy warns about everyunwrap(). - Fuzzing is easy. There are
cargo-fuzztargets for the WebSocket frames, the binary chunk frames, JSON bodies and HTTP text. - It is the same core as rootcard. The server verifies rootcard logs and proofs with the exact same Rust crate that is tested against the JavaScript version, byte for byte.
- It is small and easy to run. One static binary, with release archives for Linux on x86_64 and arm64, a systemd service, or a Docker image.
The server is never trusted with anything secret. It verifies everything it stores (a device list entry that doesn't extend the list, or isn't signed by the right key, is refused). But the clients verify everything again by themselves, and never take the server's word for it. Rust makes the server solid, and the protocol makes sure that a solid server isn't something you have to trust.
The client is the other half. It is plain JavaScript modules, with no build step and no third-party code except the vendored rootcard core and a QR code encoder. That is on purpose: what a server serves can be read, and compared with the source.
Decentralized, not central
Just like rootcard, murmo.org is one server of many. It is
a demo server, not a center. Anyone can run their own, and servers hand each
other encrypted envelopes, so Alice#3F9C@murmo.org can write to
Bob#91AE@chat.example.org.
Your browser only ever talks to your own server, and your server talks to the others. That keeps your network address away from every server you write to. An operator can keep a server private, allow only a list of other servers, or block servers that send spam. Running one takes a DNS name and a few commands:
git clone https://github.com/Hexagon/murmo.git
cd murmo/deploy && cp .env.example .env # set MURMO_DOMAIN=chat.example.org
docker compose up -d
Or, from source, with Rust 1.95 or later:
cargo run --release
# open http://127.0.0.1:8080
What it is not (yet)
Same as with rootcard, I don't want to promise too much. The full list is in the threat model, but the most important points are:
- The server still serves the client. This is the same problem Cryptalk had. A bad server could serve modified code. The client is small and has no build step, each release has a reproducible archive with a checksum, and the app shows which version it claims to be. But nothing checks it for you yet. An installable client that isn't served by the server is planned.
- The server sees some metadata. It doesn't store history or contact lists, but it sees which device sends to which devices at the time of sending.
- Forward secrecy is per week, not per message. Prekeys rotate weekly and are deleted after three weeks. A Double Ratchet with per-message forward secrecy is drafted, but not built.
- It is not quantum-safe. Like rootcard, it uses X25519 and Ed25519 today. Hybrid ML-KEM prekeys are planned.
- It is early. Murmo 0.2 builds on rootcard 0.3.5, and neither has had an external security review. Don't trust it with anything of high value yet.
How it is built
Murmo follows the same rules as rootcard. The protocol is written down first, in DESIGN.md, and the threat model says what each part protects against and what it doesn't. There are server tests in Rust, protocol and end-to-end tests, a browser smoke test, and the fuzz targets. Releases are built by CI, and the client archive is checked to be reproducible.
And again, I had good help from AI along the way. A messenger has a lot of small edge cases: what happens when a message is deleted before it arrives, when two tabs fight over the same connection, or when a contact's server serves an old device list. Going through all of those, and writing a test for each, would have taken me much longer alone.
Try it out
The easiest way is the demo at murmo.org. Create an account (save the recovery card!), and send an invite link or QR code to a friend. Or log in with a card you already made at rootcard.org.
The code is at github.com/Hexagon/murmo,
under MIT or Apache-2.0. It is early, so I would be very happy if you try to
break it. Report security issues privately (see SECURITY.md), and everything
else as an issue.
Twelve years after playing around with Cryptalk, it is fun to see that old idea grow up into a real messenger.