Inspiration

I was inspired to create this project after I tried something similar at a previous hackathon, but without the privacy aspect. Later I found a research paper on an algorithm that used the additively homomorphic properties of the Paillier cryptosystem to calculate proximity between two parties while preserving privacy. I decided to implement this algorithm into an app. It uses the Louis Protocol which involves a third party (in this case the server) verifying the distance result by decrypting a random number that is added to the distance result by one of the encrypting parties, and informing the other one whether it is within the threshold or not.

What it does

Users can broadcast events in a way that people who want to find ongoing events within a certain radius can find out without the location of either party being revealed. When a nearby event or broadcast is found, the app opens a chat between the users to enable further communication.

How we built it

The core algorithm for calculating proximity is written in C++ using libpaillier and GMP. It is compiled for Android using the NDK and called in Flutter via the Dart FFI. A Node.js server is used as a verifying third party which calls a compiled binary of the code to verify the calculated distance ciphertext. The app uses WebRTC to exchange the ciphertexts of the protocol and also for opening a chat between users.

Challenges we ran into

Compiling the C++ code and getting it to link with the Dart FFI using the Android NDK took a lot of trial and error.

What we learned

How to use the Android NDK and Dart FFI to compile native libraries.

What's next for Proximitycast

Todo list to make it more secure: 1) Automatic key regeneration for each broadcasted event 2) Automatic event polling 3) Adding message signatures and verification for all exchanged data 4) There is a bug in the flutter code which can sometimes cause chat messages to be duplicated on one end

Share this project:

Updates