{"id":20,"date":"2017-08-29T11:13:13","date_gmt":"2017-08-29T15:13:13","guid":{"rendered":"http:\/\/blogs.harvard.edu\/geeks\/?p=20"},"modified":"2017-08-29T11:13:13","modified_gmt":"2017-08-29T15:13:13","slug":"swellrtwave-e2e-encryption-overview","status":"publish","type":"post","link":"https:\/\/archive.blogs.harvard.edu\/geeks\/2017\/08\/29\/swellrtwave-e2e-encryption-overview\/","title":{"rendered":"SwellRT\/Wave E2E Encryption: Overview"},"content":{"rendered":"<div class=\"post-content\">\n<p><em>The code can be downloaded from <a href=\"https:\/\/github.com\/llopv\/incubator-wave\/tree\/gsoc-2017\">this git branch<\/a> (compare <a href=\"https:\/\/github.com\/llopv\/incubator-wave\/compare\/800fbc87a0a0d1...gsoc-2017\">changes<\/a>).<\/em><\/p>\n<h2 id=\"synopsis\">Synopsis<\/h2>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Apache_Wave\">Apache Wave<\/a> is a software framework for online real-time collaborative<br \/>\nedition. Similarly to Google Docs and Etherpad, it uses <a href=\"https:\/\/en.wikipedia.org\/wiki\/Operational_transformation\">Operational<br \/>\nTransformations<\/a> to manage user collaboration.<\/p>\n<p>During this Google Summer of Code we have provided end-to-end encryption to wave<br \/>\ndocuments. This means that only the people who know a particular key, have<br \/>\naccess to the documents and can edit and retreive the contents of a them,<br \/>\nprotecting in that way the privacy of Wave users.<\/p>\n<p>We have based our work on <a href=\"http:\/\/www.tara.tcd.ie\/bitstream\/handle\/2262\/68179\/paper.pdf;sequence=1\">this awesome paper<\/a> that explains how some<br \/>\nresearchers encrypted Google Docs\u2019 Operational Transformations. We have took<br \/>\ntheir ideas and adapted them to Apache Wave\u2019s architecture.<\/p>\n<h2 id=\"produced-work\">Produced work<\/h2>\n<p>To sumarize the work we have produced, we have recorded this video:<\/p>\n<div class=\"jetpack-video-wrapper\"><iframe loading=\"lazy\" title=\"SwellRT&#039;s GSoC 2017: Wave E2E Encryption\" width=\"660\" height=\"371\" src=\"https:\/\/www.youtube.com\/embed\/izPDptwDxwM?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/div>\n<p>To encrypt the messages we have used the algorithm AES-GCM from the WebCrypto<br \/>\nAPI. We have used JsInterop bindings to call it from our Java classes.<\/p>\n<p>Messages are properly encrypted and decrypted when they are sent and received<br \/>\nby the clients. The texts of a documents are also properly recovered from the<br \/>\nserver\u2019s snapshot. Everything seems to run smoothly, except for some annoying<br \/>\nbugs that appear sparsely, and a serious user interface bug that prevents users<br \/>\nthat did not created the wave to decrypt its snapshot. My mentor and me think<br \/>\nthat we can fix them quickly, just after the program has ended.<\/p>\n<h2 id=\"how-to-use-it\">How to use it<\/h2>\n<p>Running our modified version of Wave does not require any additional<br \/>\nconfiguration, just use Gradle commands as usual. To compile the code and<br \/>\nrun the server use:<\/p>\n<div class=\"language-sh highlighter-rouge\">\n<pre class=\"highlight\"><code><span class=\"gp\">$ <\/span>.\/gradlew run\r\n<\/code><\/pre>\n<\/div>\n<p>And open the url http:\/\/localhost:9898\/ with any browser. Once registered and<br \/>\nlogged in, use the \u201cNew Encrypted Wave\u201d button to create a new encrypted wave.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/llopv.github.io\/gsoc-2017\/assets\/img\/over-1.png\" alt=\"Encrypted Wave button\" \/><\/p>\n<p>In its URL you can see that the new wave\u2019s identifier starts with \u201cew+\u201d instead<br \/>\nof \u201cw+\u201d, as it is usual in common waves. Also, a symmetric cryptographic key is<br \/>\nattached, after the wave identifier, separated by an exclamation mark (!).<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/llopv.github.io\/gsoc-2017\/assets\/img\/over-2.png\" alt=\"Encrypted Wave URL\" \/><\/p>\n<p>The user must preserve that URL (or at least the key part) in order to open the<br \/>\nwave again in the future.<\/p>\n<h2 id=\"future-work\">Future work<\/h2>\n<p>AES-GCM assures both confidentiality and integrity for the messages written by<br \/>\nthe legitimate users, but an attacker who has the control over the server can<br \/>\nstill do a lot of harm:<\/p>\n<ul>\n<li>Only the text of a document is encrypted, but not other parts like the content<br \/>\nof its hiperlinks, for example. We should extend the encryption beyond the<br \/>\ninserted characters.<\/li>\n<li>The authentication could also be extended to all the components, not only text<br \/>\nones. Also, as the <a href=\"http:\/\/www.tara.tcd.ie\/bitstream\/handle\/2262\/68179\/paper.pdf;sequence=1\">paper<\/a> states that the history of a document should<br \/>\nalso be authenticaded (see appendix A.2).<\/li>\n<li>It is unlikely to hide the structure and format of the document to the server,<br \/>\nbut we may be able to hide some more information, like user\u2019s typing traits.<\/li>\n<\/ul>\n<p>On the other hand, it is not convenient having users handling symmetric keys by<br \/>\nthemselves. Keys should be encrypted and stored in the server as user data. To<br \/>\ndo so, we should derive a key from the user\u2019s password using <code class=\"highlighter-rouge\">pbkdf2<\/code> (available<br \/>\nin the WebCrypto API), to encrypt all the keys a user generates or registers<br \/>\nfor her waves.<\/p>\n<p>The users could use public key cryptograpy in order to being able to invite each<br \/>\nother to edit in a wave document. This feature were part of the original plan of<br \/>\nwork for this Summer, but we have had not enough time to develop this part.<\/p>\n<h2 id=\"relevant-links\">Relevant links<\/h2>\n<ul>\n<li><a href=\"https:\/\/github.com\/llopv\/incubator-wave\/tree\/gsoc-2017\">List of commits<\/a><\/li>\n<li><a href=\"https:\/\/llopv.github.io\/gsoc-2017\/e2ee\/2017\/06\/30\/encrypt-ot-1.html\">How can Apache Wave Operational Transformations be encrypted? (Part 1)<\/a><\/li>\n<li><a href=\"https:\/\/llopv.github.io\/gsoc-2017\/e2ee\/2017\/08\/31\/encrypt-ot-2.html\">How can Apache Wave Operational Transformations be encrypted? (Part 2)<\/a><\/li>\n<li><a href=\"https:\/\/llopv.github.io\/gsoc-2017\/code\/2017\/08\/31\/code-walkthrough.html\">Project code walkthrough<\/a><\/li>\n<\/ul>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The code can be downloaded from this git branch (compare changes). Synopsis Apache Wave is a software framework for online real-time collaborative edition. Similarly to Google Docs and Etherpad, it uses Operational Transformations to manage user collaboration. During this Google Summer of Code we have provided end-to-end encryption to wave documents. This means that only &hellip; <a href=\"https:\/\/archive.blogs.harvard.edu\/geeks\/2017\/08\/29\/swellrtwave-e2e-encryption-overview\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">SwellRT\/Wave E2E Encryption: Overview<\/span><\/a><\/p>\n","protected":false},"author":8851,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[15683,34593],"class_list":["post-20","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-gsoc","tag-gsoc17"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/archive.blogs.harvard.edu\/geeks\/wp-json\/wp\/v2\/posts\/20","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/archive.blogs.harvard.edu\/geeks\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/archive.blogs.harvard.edu\/geeks\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/geeks\/wp-json\/wp\/v2\/users\/8851"}],"replies":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/geeks\/wp-json\/wp\/v2\/comments?post=20"}],"version-history":[{"count":4,"href":"https:\/\/archive.blogs.harvard.edu\/geeks\/wp-json\/wp\/v2\/posts\/20\/revisions"}],"predecessor-version":[{"id":27,"href":"https:\/\/archive.blogs.harvard.edu\/geeks\/wp-json\/wp\/v2\/posts\/20\/revisions\/27"}],"wp:attachment":[{"href":"https:\/\/archive.blogs.harvard.edu\/geeks\/wp-json\/wp\/v2\/media?parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/geeks\/wp-json\/wp\/v2\/categories?post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/geeks\/wp-json\/wp\/v2\/tags?post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}