project screenshot 1

Freemail

An extensible SMTP-like service that obfuscates senders and receivers by using decentralized storage.

Freemail

Created At

HackFS

Project Description

Free, as in "freedom of assembly"...

The idea behind this project was to obfuscate senders and receivers of mail. Currently, it is very easy to hide what one is saying, by encrypting contents of emails or other messages. But even with unbreakable end-to-end encryption, any centralized service fails when it comes to hiding other revealing things, like who you are talking to, how often, and the size of your messages. The best solution for truly private communication currently on the market is to create disposable accounts on a centralized service, hiding your IP address with something like onion routing. Decentralized or distributed systems provide a fantastic, elegant solution to this problem. As content is propagated through e.g. the IPFS network, it is impossible to tell whether a particular node is the actual originator of a message or not, without controlling a vast majority of the network. The difficulty lies in figuring out a way to allow a message to be addressed to a person, such that that only that person knows where to listen for it, and when it is intended for him. Our application itself has three main components: the SMTP interface that allows one to send and receive messages with any number of familiar email clients; the IPFS / OrbitDB component, which puts up messages and watches particular databases; and the decentralized anonymous file transfer (DAFT) protocol, which defines how people ought to negotiate a) where they will be posting messages, and b) how those messages will be encrypted.

To be more clear about how things work, on a conceptual level: Alice, as somebody who is waiting for messages, has an append-only OrbitDB collection, to which she constantly listens for messages that people send to her. If Bob wants to send something to Alice, the first thing he does is encrypt and push that file onto IPFS. Bob also will want to communicate with Alice further somewhere else (on a different collection), so it is impossible for somebody to simply watch Alice's inbox, etc. Furthermore, Bob wants to use some sort of authenticated encryption with special keys just for him and Alice, so a) he doesn't have one key that could be compromised elsewhere and b) he and Alice both know that nobody can forge messages. So Bob creates a new OrbitDB collection to which he will write for Alice, and a new key pair, and includes the OrbitDB collection address, his newly-generated public key, and the CID of the message he pushed to IPFS in a single header (also including his ethereum address and signature of the rest of the header, since the ethereum-compatible address is short and easy to double check by Alice. He encrypts this header asymmetrically with Alice's public key, and sends it to her aforementioned general inbox. All further communication to her happens on the collection created just for her, that only she knows to listen to. All further communication continues to be in the form of encrypted headers with CIDs of the actual messages on IPFS, so that even the size of the messages is hidden from eavesdroppers.

How it's Made

The project requires a Dovecot IMAP/POP server, which does things like enumerate and store messages, and provides the IMAP/POP interface for email clients.

The main component of the project is a command-line application, which does a few things:

  • creates and maintains a local MongoDB database to keep track of all a user's keys and contacts (including the addresses of databases to read from and write to for particular other users)

  • runs a daemon that listens to all inboxes (OrbitDB collections created by other people, to communicate with the user in question) and reads and processes any newly sent headers, modifying the aforementioned addressbook appropriately, retrieving the referenced document from IPFS, and sending it to the IMAP/POP3 server

  • runs an SMTP server that intercepts messages sent from an email client and allows them to be appropriately processed, with the appropriate headers etc. generated and written to the appropriate databases (this server is set up within the email client as an "outgoing SMTP server")

  • runs a command-line interface, which allows for creation, login, logout and deletion of users (with possibility for password-based encryption-at-rest in the future)

While we unfortunately did not get to actually implement 3Box, it would be very useful in the future for a user to be able to put their general inbox address onto the blockchain, so that for somebody to contact someone else it would only be necessary to know the ethereum address and not the general inbox address as well. The general inbox could be securely retrieved in the background, without the user ever having to enter it in!

background image mobile

Join the mailing list

Get the latest news and updates