Git Product home page Git Product logo

covidcotra's Introduction

covidcotra

This is an experimental rust library for managing the data exchange for a covid-19 contract tracing system.

Concepts

Conceptionally there are three components:

  • Identity represents a single device. However for extra safety a device can rotate IDs for as long as it also polls for some period of time on the older IDs.
  • Authority represents a trusted authority (for instance the ministry of health)
  • ContactLog is a minimal abstraction over a contact log.

Identity

The identity internally holds a unique ID (the UniqueIdentity). This identity is only ever transmitted to the central authority when the person behind this identity tests positive. However also IDs of potential contacts are transmitted.

An identity can be looked at in two other ways: a ShareIdentity which is an identity which is encrypted with the public key of the public authority and is only ever shared with other devices. The share ID should rotate regularly and can be used by the central authorities to determine that a user saw another user. Since the IDs rotate it's impossible (at least on this level) for a device to determine that they have seen a device a second time.

Secondarily there is the HashedIdentity. This is a hashed version of the unique ID which can be used to "poll" for updates or subscribe to a push channel. The central authority cannot map from hashed identity to unique identity but the other way round. This means that the unique identity (which eventually gets associated with a real human identity if revealed) only gets known to the central authority under the following circumstances:

  • a user tests positive and reveals
  • the central authority listens on device IDs walking around with a lot of devices deployed all over the place.
  • a user submits a list of contacts they saw

Notifications

The central authority marks the hashed IDs of contacts as tainted. A device polls alls of the hashed IDs of all the unique IDs it generated and used in the last N days (for instanc 14 days) for tainted status. If any show up as tained they should contact the authorities.

ID Behavior

  • unique ID: you can make multiple but not rotate them too often. You should never share this ID because if someone else has it, they can become you.
  • share ID: this is good to share with others but you should rotate it regularly
  • hashed ID: a derived version of the unique ID that is used for polling for tainted status. You should only send a hashed ID to the authority and nobody else otherwise they can poll your taint status.

ID Cycling

When a user is revealed by testing positive they are encouraged to rotate the unique ID. They can do that safely because after testing positive they will end up in quarantine anyways. Since other users unique IDs are also revealed through contact list uploaded they are encouraged to rotate once they test positive. If they test negative they could start sending with a new ID instead of the old one but they would still need to poll the old ID for updates for an extended period of time.

Generally devices are free to have multiple identities if they want. For instance they could chose to transmit not just different share IDs but also use different unique IDs for extra privacy. A device could for instance roll a new ID every day. The only downside of this is that it then needs to poll the hashed ID for each generated ID until the infection window (~14 days?) made an ID expire naturally.

This is a proof of concept for this blog post about contact tracing.

License: Apache-2.0

covidcotra's People

Contributors

mitsuhiko avatar

Watchers

 avatar

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.