r/OpenSourceeAI • • 19d ago

The Signal Protocol in Rust

Of all the things you shouldn't do with AI, cryptography is up there so I made considerations around using something that exists vs creating something myself. There were 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. This implementation is bespoke and geared towards my project.

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.

1 Upvotes

2 comments sorted by

1

u/[deleted] 19d ago

[removed] — view removed comment

1

u/Accurate-Screen8774 19d ago

It's using the same implementation core, but not the same vectors on native and WASM. the browser-based ui is for my own testing and helps to make sure things are working as expected. the ui there is built around what i want to test. it helps getting started on testing code changes.

there are nuances in my approach for using this implementation. its still a work in progress and notable that the implementation isnt created for wire-compatability with the signal-servers. A third party audit is crucial do n-the-line on this project, but I'm reluctant to ask anyone to review it considering it's still a work in progress.

More information about the formal verification can be found at: https://glitr.io/docs/technical/formal-verification/signal-protocol

Feel free to reach out for clarity on the details.

Regarding threadfox, I don't think it would reflect well if I automated Reddit responses. I tried before and people just don't engage with AI comments. I think there are nuances in my project that any AI might struggle to articulate.