GithubHelp home page GithubHelp logo

openmined / covid-alert Goto Github PK

View Code? Open in Web Editor NEW
43.0 25.0 14.0 8.78 MB

A privacy-preserving app for comparing last-known locations of coronavirus patients

License: Apache License 2.0

JavaScript 91.05% HTML 0.44% Starlark 1.30% Java 1.84% Ruby 2.12% Objective-C 3.26%
privacy privacy-preserving app covid-19 coronavirus

covid-alert's Introduction

COVID Alert

NOTE: This repo serves as a demo for the work being done by the Private Set Intersection team here at OpenMined. You can find their repos here:

We are no longer pursuing a production use-case with this application. Instead we've decided to contribute to another project: https://github.com/corona-trace

Folder Structure

  • /covidalert - React Native App for end-users
  • /dashboard - Create React App with Firebase cloud functions for an API and admin dashboard
  • /designs - All the related design files
  • /package - A small NPM package with three functions. One is for turning GPS coordinates into a sectorKey and gridTensor, and two others for allowing us to stringify and parse BitInts in JSON.

Languages

We have support for the following languages:

  • English
  • Spanish
  • Italian
  • Portuguese (Brazilian)
  • French
  • Russian
  • Chinese (Mandarin)
  • Arabic
  • Hindi

We are open to any pull requests to add support for other languages!

Getting app to work

The dashboard and package directories mostly speak for themselves. To get the app to run, run the following lines:

  1. yarn install to install dependencies
  2. react-native link to add assets (fonts and images) to packages
  3. If you want to install ios, run cd ios && pod install && cd ../
  4. yarn start for hot reloading
  5. iOS: yarn ios / Android: yarn android

Technical Explanation

For anyone wanting to know how we’re currently performing set intersection on the Covid Alert app… this is the description of how the system works. We’re looking to improvements on this process, specifically related to key generation and private set intersection in either Paillier HME or SEAL.

We’re trying to work on improving key generation speed for iOS and Android using React Native. There’s two places where we’re currently using Paillier HME: on the device to generate keys, encrypt the grid tensor, and then decrypt the result AND on the Node.js serverless function where the actual computation takes place. Here’s the workflow:

  1. Mobile phone generates a public/private key for Paillier upon loading the application. Mobile phone also generates a GPS coordinate of the user’s location every 30 seconds while moving.
  2. Coordinates are clipped to 2 digits to generate a “sector key” (accurate to 1km x 1km, aka… not very accurate) and then the 3rd digit (accurate to 100m x 100m) is clipped to generate a “grid tensor” (a 10x10 array of 0's with a 1 representing the location of the user).
  3. The sector key is left unencrypted since it’s not accurate enough to describe a person. The grid tensor, however, is flattened and then each value is encrypted.
  4. The unencypted sector key, the encrypted grid tensor, and the n and g values of the public key are sent to the server.
  5. The server receives everything and immediately regenerates the public key (using the provided n and g values, it must be identical to the one generated on the phone). It also then looks up all locations in the database reported in the last 72 hours for the same sector key.
  6. If one or more locations are found, we loop through the locations and perform a Paillier multiplication of each of the values (unencrypted) of that location (converted into a grid tensor) and the encrypted grid tensor supplied by the mobile phone. At the end of that matrix multiplication, the values are summed. We then continue to iterate over each location summing them against each other as we go.
  7. The final value (all the multiplied sums computed into value) is returned to the mobile phone in encrypted form.
  8. The mobile phone decrypts the value. If it’s 0, they’re safe. If it’s 1 or greater, they’re in an overlapped zone of someone with COVID in the last 72 hours and are promptly notified to exit the area calmly and quietly.

That’s the whole workflow from A->Z. Here’s a link to each of the main files involved in this work...

Acknowledgements

Many people have worked on this application within the OpenMined community, many of which do not show up in the commit history. Here's a brief list (in alphabetical order):

covid-alert's People

Contributors

cereallarceny avatar iamtrask avatar kevmo314 avatar kritikalcoder avatar s0l0ist avatar samelsamel avatar tcp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

covid-alert's Issues

Quarantine reminders | Engine : Calculating distance

Let's calculate the distance that the user moves everyday. Also, would be good to centralize this information somewhere so that we could show where they lie on the curve. Top 10% of all movers, Bottom 10% le of all movers etc.,

(Note: The location data works only if we have the "always on" permission on the app. This is the best we can do!)

Quarantine reminders | Design : Front end

For the already existing issue on (Quarantine reminders | Engine) we'd need a front end to show where the user lies against a population on a dashboard. Can we mock up a couple of front-end graphics/ designs that we could then go and build out

Quarantine reminders | Messaging

For the earlier issue on Quarantine reminder | Engine. We'd need a way to message the information in a safe, cheerful & accurate manner. We have some thoughts around it - would be good to work with a contributor bounce ideas & get this in the app.

I expect this not to take more than 60 minutes

Need better date and time inputs for dashboard

Currently, all of our dates and times are formatted as text inputs and receive little or no validation and formatting. We should have these inputs be smarter to prevent confusion and user error.

Translation into Hindi

Hi Folks,

The COVID - ALERT app currently works in 8 different languages. We need this to work in Hindi. We estimate the time needed for this task would be around 60-90 minutes. Please be very sensitive to the nature of messaging - best would be to slack me "Shreyas" and align on the tone and meaning before publishing it.

thanks

Store keypair

Persist the keypair on the React Native app so that we only need to generate that once.

Add Google Maps location data import

We need to allow patients to import their Google Maps data as locations in the DB. This should help the process of inputting data to be much faster and far more accurate.

Translation to Korean

Hi Folks,

The COVID - ALERT app currently works in 8 different languages. We need this to work in Korean. We estimate the time needed for this task would be around 60-90 minutes. Please be very sensitive to the nature of messaging - best would be to slack me "Shreyas" and align on the tone and meaning before publishing it.

thanks

Translation to Japanese

Hi Folks,

The COVID - ALERT app currently works in 8 different languages. We need this to work in Japanese. We estimate the time needed for this task would be around 60-90 minutes. Please be very sensitive to the nature of messaging - best would be to slack me "Shreyas" and align on the tone and meaning before publishing it.

thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.