A contact-tracing phone application and server that protects the privacy by using Homomorphic Encryption (HE) and Differential Privacy. HETracing was created as part of final year dissertation in order to discuss about the costs of using HE for contact tracing.
The app works for both iOS and Android and the front-end is written in Dart. The back-end server is written in Java. Three HE libraries can be linked to the phone application and server:
There are multiple steps to make the phone application and server build. The HE libraries need to be built for the phone platform that you want to use and also the server's platform.
To build for the server, you need to build the three HE libraries according to their specification. After this, you need to:
- Change lines
9-10from this CMakeLists.txt file to specify the path of thesmkhelibrary - Change line
12from this CMakeLists.txt file to specify the correctgo path - Run
cmake .inhe-component/bridge/server - Run
makeinhe-component/bridge/server
After these steps, the binary will be created in he-component/bridge/server and can be linked correctly from Java.
The server is also connected to a MariaDB database. To set the database, use the tables.sql file to create the tables needed by HETracing and then modify line 19 of the Controller file to
point to the correct connection URL for the database.
Before building, modify line 4 from ConnectionService.swift, line 21 from ConnectionService.java and lines 6-7 from connection_service.dart to point to the right server IP.
As in the case of the server, the first step is to build the three libraries for the phone's platform. After this, you need to link the binaries with CMake for Android or inside Xcode for iOS.
After building the binaries, you need to:
- Modify lines
24-26from Makefile and line7from go.mod to point to the right paths - Run
make androidinsidehe-component/src/client/lattigo/go - Change lines
5, 6, 8, 9from this CMakeLists.txt file to point to the binaries created for SEAL/SMKHE - Run the application
You will probably need a developer account for notifications to work.
- Modify line
7from go.mod to point to the right path and runmake iosinsidehe-component/src/client/lattigo/go, creating the go library insidehe-component/src/client/lattigo/go/build - Inside Xcode, add the header and library search paths under
Search PathsfromBuild Settings - Inside Xcode, under
Build Phases, go toLink Binary With Librariesand all the three libraries' binaries - Run the application
HETracing using Firebase Cloud Messaging to send notifications from the server and the phone application uses the Google Maps API and Places API. To make the application work as expected, you will need:
- A Google API key that can be used for Maps and Places. You need to copy this in: line
18of Android Manifest, line7of google_places.dart and line36of AppDelegate.swift - For server, you need the FCM
jsonfile's path to be kept in environment variableGOOGLE_APPLICATION_CREDENTIALSand you need to specify the project id in line20of FCMNotificationManager.java - For iOS, you need the FCM
GoogleService-Info.plistplaced in the root of the iOS project - For Android, add the FCM
google-services.jsonto theappfolder

