r/crypto • • Oct 25 '26

The Signal Protocol in Rust

There are a few nuances to my approach, but the key detail is that I wanted it to also work in a browser so I needed the ability to build to a wasm to be used in js.

Signal libraries don't offer browser based capabilities and so I created this to target web aswell as native.

I wanted to implement the Signal protocol for a series of secure messaging apps I’m working on, so I built this project to test and use in my own work. It’s still far from finished, but I think it’s at a stage where it’s worth sharing with the community.

IMPORTANT DISCLAIMER: This project is not professionally audited and is not production-ready. I do not recommend anyone use this in their own code yet. It is provided strictly for testing, experimentation, and demo purposes. I used AI as an assistant to help build this, so double-check everything before taking it seriously.

Project Links:

Current Status & Development:

  • Spec Alignment: The goal is to fully align with the official Signal protocol spec.
  • Testing: It includes unit tests, but due to WASM testing limitations, I also added a Storybook-like UI to run and test it directly within a browser environment.

The impementation here is being used in a few experimental messaging apps (similarly unaudited and unreviewed):

I am also working towards adding it to an open source project soon as seen at: https://github.com/positive-intentions/chat for e2e open-source transparency in the implementation.

3 Upvotes

4 comments sorted by

16

u/T-Dahg Oct 25 '26

Take a look at libsignal service used in e.g. Whisperfish, a third-party Signal client for SailfishOS.

I think it's very much preferable that a community collaborates on a project, instead of creating a new one every time. Especially in this era of vibe-coding, there are going to be a lot of slop projects, and well-managed quality projects are going to be more and more important.

-4

u/Accurate-Screen8774 Oct 25 '26

Thanks. You're absolutely right about how reinventing the wheel should be avoided. But I couldn't find something aligned to what I wanted.

I took a brief look at that repo and it seems it would be possible to gear it towards a wasm build target, but it doesn't seem to do that just yet. Building for a browser environment is a core requirement for me in my project. I previously looked around and could not find something for it.

Can you tell me more about the maturity of that project? Where I can find out more about it's audits, formal verification or threat model.

10

u/rubdos Oct 26 '26

One of the libsignal-service-rs authors here. I hope you see the irony in your concern: "I used AI as an assistant to help build this, so double-check everything before taking it seriously", and then cracking down on a 10-year-old project built and looked at by five humans is quite something.

What's more concerning though, is that the upstream Signal protocol reference implementation by Signal themselves is written in Rust and is publicly available; i.e., you don't need our libsignal-service-rs at all for your purposes. You could've forked and ported libsignal-protocol over to support the wasm target relatively easily.

Third, if you want your browser-based clients to become a thing, you'll want to issue some kind of statement regarding the security concerns pertaining to browser based e2ee. I'll do the extremely lazy and offensive thing of meat-proxying Google's AI summary: https://share.google/aimode/JAsVjwNMIX67L8UMY

8

u/aspensmonster Oct 25 '26

I used AI as an assistant to help build this

That's an immediate no for me.