A place to cache linked articles (think custom and personal wayback machine)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.html 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. <!doctype html><!-- This is a valid HTML5 document. -->
  2. <!-- Screen readers, SEO, extensions and so on. -->
  3. <html lang="fr">
  4. <!-- Has to be within the first 1024 bytes, hence before the <title>
  5. See: https://www.w3.org/TR/2012/CR-html5-20121217/document-metadata.html#charset -->
  6. <meta charset="utf-8">
  7. <!-- Why no `X-UA-Compatible` meta: https://stackoverflow.com/a/6771584 -->
  8. <!-- The viewport meta is quite crowded and we are responsible for that.
  9. See: https://codepen.io/tigt/post/meta-viewport-for-2015 -->
  10. <meta name="viewport" content="width=device-width,initial-scale=1">
  11. <!-- Required to make a valid HTML5 document. -->
  12. <title>Temporary Contact Number based Contact Tracing (archive) — David Larlet</title>
  13. <!-- That good ol' feed, subscribe :). -->
  14. <link rel="alternate" type="application/atom+xml" title="Feed" href="/david/log/">
  15. <!-- Generated from https://realfavicongenerator.net/ such a mess. -->
  16. <link rel="apple-touch-icon" sizes="180x180" href="/static/david/icons2/apple-touch-icon.png">
  17. <link rel="icon" type="image/png" sizes="32x32" href="/static/david/icons2/favicon-32x32.png">
  18. <link rel="icon" type="image/png" sizes="16x16" href="/static/david/icons2/favicon-16x16.png">
  19. <link rel="manifest" href="/static/david/icons2/site.webmanifest">
  20. <link rel="mask-icon" href="/static/david/icons2/safari-pinned-tab.svg" color="#07486c">
  21. <link rel="shortcut icon" href="/static/david/icons2/favicon.ico">
  22. <meta name="msapplication-TileColor" content="#f0f0ea">
  23. <meta name="msapplication-config" content="/static/david/icons2/browserconfig.xml">
  24. <meta name="theme-color" content="#f0f0ea">
  25. <!-- Documented, feel free to shoot an email. -->
  26. <link rel="stylesheet" href="/static/david/css/style_2020-06-19.css">
  27. <!-- See https://www.zachleat.com/web/comprehensive-webfonts/ for the trade-off. -->
  28. <link rel="preload" href="/static/david/css/fonts/triplicate_t4_poly_regular.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" crossorigin>
  29. <link rel="preload" href="/static/david/css/fonts/triplicate_t4_poly_bold.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" crossorigin>
  30. <link rel="preload" href="/static/david/css/fonts/triplicate_t4_poly_italic.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" crossorigin>
  31. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_regular.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  32. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_bold.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  33. <link rel="preload" href="/static/david/css/fonts/triplicate_t3_italic.woff2" as="font" type="font/woff2" media="(prefers-color-scheme: dark)" crossorigin>
  34. <script type="text/javascript">
  35. function toggleTheme(themeName) {
  36. document.documentElement.classList.toggle(
  37. 'forced-dark',
  38. themeName === 'dark'
  39. )
  40. document.documentElement.classList.toggle(
  41. 'forced-light',
  42. themeName === 'light'
  43. )
  44. }
  45. const selectedTheme = localStorage.getItem('theme')
  46. if (selectedTheme !== 'undefined') {
  47. toggleTheme(selectedTheme)
  48. }
  49. </script>
  50. <meta name="robots" content="noindex, nofollow">
  51. <meta content="origin-when-cross-origin" name="referrer">
  52. <!-- Canonical URL for SEO purposes -->
  53. <link rel="canonical" href="https://lucumr.pocoo.org/2020/4/9/tcn-contact-tracing/">
  54. <body class="remarkdown h1-underline h2-underline h3-underline hr-center ul-star pre-tick">
  55. <article>
  56. <h1>Temporary Contact Number based Contact Tracing</h1>
  57. <nav>
  58. <p class="center">
  59. <a href="/david/" title="Aller à l’accueil" tabindex="1">🏠</a>
  60. </p>
  61. </nav>
  62. <hr>
  63. <h2><a href="https://lucumr.pocoo.org/2020/4/9/tcn-contact-tracing/">Source originale du contenu</a></h2>
  64. <p class="date">written on Thursday, April 9, 2020
  65. </p>
  66. <p>I have already talked here before about <a class="reference external" href="https://lucumr.pocoo.org/2020/4/3/contact-tracing/">privacy preserving contact
  67. tracing</a> to fight Covid-19 but I figured I
  68. give an update to this. I have spent the last week now investigating
  69. different approaches to this and my view has changed quite a bit.</p>
  70. <p>I strongly believe that contact tracing through phone apps is one of our
  71. best chances to return to normal and without losing our civil liberties.
  72. If you want to understand why, have a look at <a class="reference external" href="https://lucumr.pocoo.org/2020/4/3/contact-tracing/">previous post about this
  73. topic</a>.</p>
  74. <div class="section" id="two-fundamental-approaches">
  75. <h2>Two Fundamental Approaches</h2>
  76. <p>In the previous post I talked in favour of a partially centralized
  77. approach. This was largely because I felt that one of the inherent
  78. problems of any privacy preserving contact tracing system could be
  79. somewhat mitigated. That downside is that a person could always use any
  80. such contact tracing system in a way where they could determine that
  81. another person they met tested positive for covid-19 later. With a
  82. system that has support from a central authority this still cannot be
  83. prevented, but such behavior could be detected as abusive. However I am
  84. not quite convinced that this would just be security by obscurity and that
  85. the more correct way to deal with this is to just fundamentally
  86. communicate to users that this is an inherent property of the system.</p>
  87. <p>So the disclaimer to any app has to be: if you do not want that other
  88. people discover when you will test positive for covid-19 you should not
  89. use any contact tracing apps. Which is also why I strongly believe that
  90. any such system absolutely needs to be voluntary.</p>
  91. <p>So if I no longer believe in favour of the centralized approach, what do I
  92. prefer then? Quite simply put an approach based on temporary contact
  93. numbers, short <a class="reference external" href="https://tcn-coalition.org/">TCNs</a>. These protocols are
  94. fundamentally decentralized and give us some other benefits.</p>
  95. </div>
  96. <div class="section" id="reality-on-the-ground">
  97. <h2>Reality on the Ground</h2>
  98. <p>What makes application based contact tracing very interesting is that they
  99. take advantage of working on top of a widely deployed piece of hardware:
  100. smart phones. Specifically smartphones which support Bluetooth low
  101. energy (BLE). If you hold an AirPods case close to your iPhone you will
  102. notice that something happens on your screen. BLE is what enables that.</p>
  103. <p>The downside of this is that BLE comes with some restrictions. The two
  104. most relevant ones are the payload size. BLE comes with different modes
  105. and different platforms call this in different ways but the most
  106. compatible and energy preserving modes restrict us to under 30 bytes of
  107. payload. That's not enough to make fancy public key cryptography work
  108. which would be necessary for centralized approaches to play to their
  109. advantages. This is also why systems that currently follow the
  110. centralized approach will typically exchange a short ID and the extra
  111. payload is then actually exchanged through the cloud or <a class="reference external" href="https://en.wikipedia.org/wiki/Bluetooth_Low_Energy#GATT_operations">GATT</a>.
  112. The former makes a system that could be somewhat decentralized much more
  113. centralized.</p>
  114. <p>TCN based protocols instead will exchange just random identifiers instead.
  115. Most TCN based protocols currently suggest between 16 and 26 bytes of
  116. effectively random data which is easier to work with.</p>
  117. <p>Another complexity is that at present iOS devices in background cannot
  118. discover each other. This limitation might be solvable by Apple and it
  119. appears various groups are currently in contact with Apple to see what can
  120. be done. Interestingly an iOS device with the app in background can be
  121. discovered by an Android device so there might be a way to fix this.</p>
  122. </div>
  123. <div class="section" id="tcn-strawman-protocol">
  124. <h2>TCN Strawman Protocol</h2>
  125. <p>The TCN strawman protocol is the most basic of all these protocols. It
  126. was first written down by the <a class="reference external" href="https://www.coepi.org/">Co-Epi project</a>
  127. and is very easy to explain.</p>
  128. <ol class="arabic simple">
  129. <li>all mobile phones randomly generate TCNs and remember and broadcast
  130. these.</li>
  131. <li>all mobile phones check against a server which publishes TCNs that are
  132. known to be covid-19 positive.</li>
  133. <li>all mobile phones check their local contact list against the downloaded
  134. list locally for an intersection.</li>
  135. </ol>
  136. <p>Step 2 is the only one where a central system is necessary. For instance
  137. this could be the server of the Austrian Red Cross which publishes TCNs.
  138. Since the TCNs of encounters are only stored on the devices they have to
  139. get on contact with covid-19 tested positive individuals first.</p>
  140. <p>The strawman protocol wouldn't work in practice at the peak of the
  141. infection because of the sheer data requirements. However there are
  142. various cryptographic tricks which are floating around to reduce the size
  143. of the data set.</p>
  144. </div>
  145. <div class="section" id="dp-3t">
  146. <h2>DP-3T</h2>
  147. <p><a class="reference external" href="https://github.com/DP-3T/documents/">DP-3T</a> is currently one of the
  148. most promising protocols here. It has a low cost variant which satisfies
  149. most of the qualities of the strawman protocol while reducing the amount
  150. of data greatly (to around 1.5MB of data per day for a peak infection rate
  151. of 40.000 infections a day). Additionally it comes with a protocol
  152. extension (“Unlinkable decentralized proximity tracing”) which improves on
  153. the simple protocol in a few important aspects. Specifically it makes it
  154. significantly harder for an adversary to track or identify infected users
  155. at the cost of higher bandwidth requirements.</p>
  156. <p>A simple version of the protocol is easily explained:</p>
  157. <ol class="arabic simple">
  158. <li>A device generates a secret key. Each day the user derives a new
  159. version of the secret key by feeding it into a ratchet like a SHA256
  160. hash function.</li>
  161. <li>Each day the device generates TCNs out of the day's secret key for
  162. instance by using a AES in counter mode. If for instance we want to
  163. switch TCNs every 15 minutes we would need to generate 4 * 24 * 16 bytes
  164. worth of TCNs to have enough for a day.</li>
  165. <li>Devices now broadcast a random TCN for the day for 15 minutes each.</li>
  166. <li>When a device encounters another person and they consider the contact
  167. long enough, they record the approximate time of day and the TCN
  168. encountered.</li>
  169. <li>When a user tests covid-19 positive they upload the secret key of the
  170. first day of infection and generate a new secret key.</li>
  171. <li>Other devices now download the secret key for that user and generate
  172. all possible TCNs locally and check for infection. They only need to
  173. generate 14 derivations of the secret key and the 96 TCNs for each day.</li>
  174. </ol>
  175. <p>In the more complex version the device uploads seeds of the secret keys
  176. for all time windows in the infection window. On the backend server a
  177. <a class="reference external" href="https://en.wikipedia.org/wiki/Cuckoo_filter">cuckoo filter</a> is created
  178. every 4 hours and the seeds are inserted. Because Cuckoo filters have a
  179. small probability of producing false positives parameters need to be
  180. selected appropriately to reduce this risk. The upside is that the sets
  181. of identifiers used by the same user are hidden.</p>
  182. </div>
  183. <div class="section" id="pepp-pt-and-local-governments">
  184. <h2>PEPP-PT and Local Governments</h2>
  185. <p>So this leads us to <a class="reference external" href="https://www.pepp-pt.org/">PEPP-PT</a>. It would
  186. appear that PEPP-PT is evaluating DP-3T as the reference protocol and
  187. they are going to open source the code with the idea to support local
  188. authorities in implementing their own version. Officially they have not
  189. decided between centralized or TCN approaches yet, but there seems to be a
  190. high chance it will be the latter. The concept is also very simple.
  191. Simple enough that if you want to explain this system to others, there is
  192. also a nice little <a class="reference external" href="https://ncase.me/contact-tracing/">comic strip available</a> that explains it.</p>
  193. <p>If your local government is planning on implementing a covid tracing app
  194. it might be worth directing them towards <a class="reference external" href="https://github.com/Co-Epi">Co-Epi</a>. It already has an implementation
  195. of many of the same ideas in their GitHub repository. If they do want a
  196. centralized approach the Singaporean government Open Sourced their
  197. application under GPL3 under the name <a class="reference external" href="https://bluetrace.io/">BlueTrace</a>. It avoids largely unnecessary cloud
  198. infrastructure from what I can tell.</p>
  199. </div>
  200. </article>
  201. <hr>
  202. <footer>
  203. <p>
  204. <a href="/david/" title="Aller à l’accueil">🏠</a> •
  205. <a href="/david/log/" title="Accès au flux RSS">🤖</a> •
  206. <a href="http://larlet.com" title="Go to my English profile" data-instant>🇨🇦</a> •
  207. <a href="mailto:david%40larlet.fr" title="Envoyer un courriel">📮</a> •
  208. <abbr title="Hébergeur : Alwaysdata, 62 rue Tiquetonne 75002 Paris, +33184162340">🧚</abbr>
  209. </p>
  210. <template id="theme-selector">
  211. <form>
  212. <fieldset>
  213. <legend>Thème</legend>
  214. <label>
  215. <input type="radio" value="auto" name="chosen-color-scheme" checked> Auto
  216. </label>
  217. <label>
  218. <input type="radio" value="dark" name="chosen-color-scheme"> Foncé
  219. </label>
  220. <label>
  221. <input type="radio" value="light" name="chosen-color-scheme"> Clair
  222. </label>
  223. </fieldset>
  224. </form>
  225. </template>
  226. </footer>
  227. <script src="/static/david/js/instantpage-3.0.0.min.js" type="module" defer></script>
  228. <script type="text/javascript">
  229. function loadThemeForm(templateName) {
  230. const themeSelectorTemplate = document.querySelector(templateName)
  231. const form = themeSelectorTemplate.content.firstElementChild
  232. themeSelectorTemplate.replaceWith(form)
  233. form.addEventListener('change', (e) => {
  234. const chosenColorScheme = e.target.value
  235. localStorage.setItem('theme', chosenColorScheme)
  236. toggleTheme(chosenColorScheme)
  237. })
  238. const selectedTheme = localStorage.getItem('theme')
  239. if (selectedTheme && selectedTheme !== 'undefined') {
  240. form.querySelector(`[value="${selectedTheme}"]`).checked = true
  241. }
  242. }
  243. const prefersColorSchemeDark = '(prefers-color-scheme: dark)'
  244. window.addEventListener('load', () => {
  245. let hasDarkRules = false
  246. for (const styleSheet of Array.from(document.styleSheets)) {
  247. let mediaRules = []
  248. for (const cssRule of styleSheet.cssRules) {
  249. if (cssRule.type !== CSSRule.MEDIA_RULE) {
  250. continue
  251. }
  252. // WARNING: Safari does not have/supports `conditionText`.
  253. if (cssRule.conditionText) {
  254. if (cssRule.conditionText !== prefersColorSchemeDark) {
  255. continue
  256. }
  257. } else {
  258. if (cssRule.cssText.startsWith(prefersColorSchemeDark)) {
  259. continue
  260. }
  261. }
  262. mediaRules = mediaRules.concat(Array.from(cssRule.cssRules))
  263. }
  264. // WARNING: do not try to insert a Rule to a styleSheet you are
  265. // currently iterating on, otherwise the browser will be stuck
  266. // in a infinite loop…
  267. for (const mediaRule of mediaRules) {
  268. styleSheet.insertRule(mediaRule.cssText)
  269. hasDarkRules = true
  270. }
  271. }
  272. if (hasDarkRules) {
  273. loadThemeForm('#theme-selector')
  274. }
  275. })
  276. </script>
  277. </body>
  278. </html>