DMs for Bluesky! A Rust based POC for an E2E encrypted system over Bluesky
An unofficial Proof of Concept encrypted DM system for Bluesky
I made this project as a Proof of Concept, and as a neat hobby tool. I am not a cryptography engineer, and this has not undergone an audit. While I spent effort to make it safe and effective, it could delete all your data, expose all your secrets, or crash your computer. Check out the Security Model section for more info. USE AT YOUR OWN RISK.
Copy the bmail.toml.example
file to bmail.toml
. It expects this file to be present in the same directory as the bmail binary.
Add your handle and an app password to the handle and password fields in quotes. You need to include your full handle, so either your custom domain or handle.bsky.social
[user]
handle="example.bsky.social"
password="an-app-password"
[key]
file_path="keys/bmail_identity.secret"
This is an example of an on repo direct-messaging system. Messages you send are encrypted and stored in your repo as profile records. Anyone can see the encrypted messages, and who you're messaging, but will be unable to read them without the intended recipient's private key.
Messages are encrypted with the Rust implementation of Age called Rage. It was designed to encrypt files, not for encrypted chat. This leads to several deficiencies.
If the Bmail app is running, it will scan the Firehose for new Bmail Messages, find ones that you are involved in, decrypt them, and show them to you.
If the Bmail app is not running, and you load a conversation, it will scan the participant's profiles for all the messages in the conversation, decrypt them, and show them to you.
When you start the app, a public/private keypair is generated for your computer. The private key is stored in the keys folder. Do not lose this key, as it is required to decrypt messages sent to you. If you want to run this on multiple clients, you'll need to copy the key to each client.
Your public key is attached to your Bluesky profile as a field on your profile record. Others will encrypt messages to you with your public key. For this to work, you must trust that your PDS provider(currently Bluesky) will not change your public key. If someone does, they will be able to decrypt future messages. When you send a message to someone, it'll scan their profile for their public key. If it finds it, it will encrypt your message with it. If it doesn't, it will throw an error.
Currently, there is no way to rotate keys, and you are trusting your personal data store to present your public key accurately. However, since you hold your private key, the best a malicious PDS or Bluesky account hacker would be able to do is impersonate you in the future.
If you suspect this is the case, you can delete or move your key file, and Bmail will generate a new public/private key pair for future messages
When the app is started for the first time, it will create a post that will be hidden from your timeline with the message "You've got Bmail". When you receive a Bmail, the sender will like that post. In typical clients, you won't be able to tell which conversation has a new message, just who sent the new message. There is a custom field on that Like that indicates which Conversation it is, but that is only visible in dev tools right now.
A lightweight and configurable atproto feed generator.
Define, Issue, and Verify Badges for ATProtocol Handles.
An AT Protocol implementation prioritizing community safety and self-governance, written in Rust.
Query Engine used by custom feeds created using the SkyFeed Builder
Rust libraries for Bluesky's AT Protocol services.
A typed Rust library for easily interacting with and consuming the Bluesky Jetstream service.
Your Brand Here!
50K+ engaged viewers every month
Limited spots available!
📧 Contact us via email🦋 Contact us on Bluesky