Adopting the Noise Key Exchange in Tox Integration Des Noise

Adopting the Noise Key Exchange in Tox Integration Des Noise

Adopting the Noise key exchange in Tox Integration des Noise Schlüsselaustauschprotokolls in Tox Master Thesis Submitted in partial fulfillment of the requirements for the degree of Master of Science in Engineering to the University of Applied Sciences FH Campus Wien Master Degree Program: IT-Security Author: Tobias Buchberger Student identification number: c1810537022 Supervisor: DI Mathias Tausig Date: 04.07.2020 Declaration of authorship: I declare that this Master Thesis has been written by myself. I have not used any other than the listed sources, nor have I received any unauthorized help. I hereby certify that I have not submitted this Master Thesis in any form (to a reviewer for assessment) either in Austria or abroad. Furthermore, I assure that the (printed and electronic) copies I have submitted are iden- tical. Date: Signature: Preface First of all I would like to take the time to thank my supervisor, Mathias Tausig, for all the help. You were the one who inspired me to choose this topic which combined my already- existing interest in Tox and cryptography. During the practical part of this thesis you guided me in the right directions and in our regular feedback sessions you always encouraged me. Moreover I want to thank zoff, iphy, zugz and nurupo from TokTok (Tox’ development organization) for valuable discussions and help in understanding Tox and its implementation. I look forward to further improve Tox together with these interesting people. Beer’s on me at the next ToxCon! ;-) I also want to thank Jason A. Donenfeld for intially raising the KCI issue in Tox’ handshake. Last but not least I want to thank my partner Hannah for all her help and endurance during the ups and downs while working on this thesis. She always kept calm and managed not to break up with me ;-). i Abstract Tox is a peer-to-peer instant messaging protocol that aims to provide secure messaging. The development of Tox started in the wake of Edward Snowden’s leaks regarding the US National Security Agencies’ (NSA) surveillance of most internet communications. It’s in- tended as a end-to-end encrypted (E2EE) and distributed Skype replacement. Tox features include instant messaging, audio and video calls. The implementation of the Tox protocol is written in C and the library is called "c-toxcore". Tox’ cryptography is based on the NaCl library from Daniel J. Bernstein. The cryptographic primitives for the key exchange (X25519), authentication (Poly1305) and symmetric encryption (XSalsa20) are state of the art peer-reviewed algorithms. Although Tox’ authenticated key exchange (AKE) during the handshake works, it is a "home-brewed" cryptographic protocol. Until now there was no full security analysis conducted on either the Tox protocol or its implementation in C, but the AKE is known to be vulnerable to key compromise impersonation (KCI) attacks. KCI is a vulnerability of AKE protocols, which in this case enables an attacker, who compromised the static long-term private X25519 key of a Tox party Alice, to impersonate any other Tox party (with certain qualifications) to Alice ("reverse impersonation"). This enables an attacker to perform a Man-in-the-Middle (MitM) attack. The cryptographic handshake of the Tox pro- tocol, including the AKE, is described in detail. Based on the analysis of the Tox handshake multiple KCI-attack scenarios are outlined. The Noise Protocol Framework (hereafter referred to as "Noise") is a framework created by Trevor Perrin intended to use by protocol designers to create secure channel protocols based on Diffie-Hellman key agreement. Noise provides different handshake patterns for different use cases. The security properties of these patterns are formally verified. These security properties can include forward secrecy, key confirmation, identity hiding and most notably KCI-resistance. Noise protocols are already used in some applications, like WireGuard VPN and WhatsApp. By using the Noise framework, a new KCI-resistant AKE for the Tox handshake is designed. Tox’ Noised-based AKE uses the "IK" pattern. The name of the resulting Noise protocol is Noise_IK_25519_ChaChaPoly_SHA512. This means the new AKE is also based on X25519 for the key exchange, but encryption during the AKE is performed using the ChaCha20-Poly1305 stream cipher instead of XSalsa20 (which is not supported by Noise). The Noise-C library from Rhys Weatherley is used to implement the new AKE in c-toxcore. Two functions are added to Noise-C to be able to retrieve to the symmetric encryption keys after a successful handshake. These keys are then used with the already-existing XSalsa20-Poly1305 encryption in c-toxcore to send encrypted messages. In future work, instead of using the Noise-C library, which supports most of Noise’ hand- shake patterns and all cryptographic primitives, only the Noise protocol used in the Tox handshake can be implemented in c-toxcore. This would remove Noise-C as a dependency (i.e the only other dependency is NaCl/libsodium), reduce source lines of code and therefore reduce the attack surface. Noise also provides functions to further improve security, like ses- sion re-keying, which could also be adopted in Tox. Future work could also include further security analysis of the Tox protocol and its implementation in C. ii Kurzfassung Tox ist ein Peer-to-Peer Instant-Messaging Protokoll, das zum Ziel hat sichere Kommu- nikation zu ermöglichen. Die Entwicklung von Tox hat im Anschluss an Edward Snowdens Veröffentlichungen hinsichtlich der Überwachung der internetbasierten Kommunikation durch die US National Security Agency (NSA) begonnen. Es ist als Ende-zu-Ende verschlüsselte und verteilte Alternative zu Skype gedacht. Tox ermöglicht unter anderem Instant-Messaging und Sprach- bzw. Videotelefonie. Das Tox-Protokoll ist in C implementiert und die Pro- grammbibliothek heißt „c-toxcore“. Die in Tox verwendete Kryptographie basiert auf der NaCl-Programmbibliothek von Daniel J. Bernstein. Die kryptographischen Verfahren für den Schlüsselaustausch (X25519), die Authentifizierung (Poly1305) und die symmetrische Verschlüsselung (XSalsa20) sind aktueller Stand der Technik. Tox’ authentifizierter Schlüs- selaustausch während des Handshakes funktioniert, ist aber ein selbsterstelltes kryptographis- ches Protokoll. Bisher wurde noch keine vollständige Sicherheitsanalyse des Tox-Protokolls oder der Implementierung in C durchgeführt. Es ist jedoch bekannt, dass der Schlüsselaus- tausch für "Key Compromise Impersonation"-Angriffe (KCI) anfällig ist. Im Fall von Tox kann dies einem Angreifer, der den privaten Langzeit-X25519-Schlüssel einer Tox-Benutzerin Alice kompromittiert hat, unter bestimmten Voraussetzungen ermöglichen, sich gegenüber Alice als beliebiger Tox-Benutzer auszugeben. Dies befähigt einen Angreifer Man-in-the- Middle-Attacken durchzuführen. Der kryptographische Handshake des Tox-Protokolls, ein- schließlich des Schlüsselaustausches, wird im Detail beschrieben. Basierend auf der Analyse des Handshakes werden mehrere KCI-Angriffs-Szenarien erläutert. Das Noise Protocol Framework (Noise) wurde von Trevor Perrin entworfen und ist dazu gedacht, von Entwicklern für den Entwurf von Protokollen zum Aufbau sicherer Kommu- nikationskanäle basierend auf dem Diffie-Hellman-Schlüsselaustausch, verwendet zu werden. Noise stellt sogenannte Handshake-Patterns für unterschiedliche Anwendungsfälle zur Ver- fügung. Die Sicherheits-Eigenschaften dieser Patterns sind formal verifziert und sind unter anderem Forward Secrecy, glaubhafte Abstreitbarkeit und am Wichtigsten Resistenz gegen KCI. Noise-Protokolle werden bereits in einigen Applikationen eingesetzt, wie z.B. Wire- Guard VPN und WhatsApp. Mit der Anwendung von Noise wird ein neuer Schlüsselaus- tausch mit Resistenz gegen KCI für das Tox-Protokoll konzipiert. Der Noise-basierte Schlüs- selaustausch verwendet das "IK" Pattern. Der Name des resultierenden Noise-Protokolls ist Noise_IK_25519_ChaChaPoly_SHA512. Daher basiert auch der neue Schlüsselaustausch auf X25519, aber die Verschlüsselung während dem Schlüsselaustausch wird anstelle von XSalsa20 (welches von Noise nicht unterstützt wird) mit ChaCha20 durchgeführt. Die Noise- C Programmbibliothek von Rhys Weatherley wird verwendet, um den neuen Schlüsselaus- tausch in c-toxcore umzusetzen. Zwei Funktionen werden zu Noise-C hinzugefügt, um die Schlüssel für symmetrische Verschlüsselung nach einem erfolgreichen Handshake abzufra- gen. Diese Schlüssel werden anschließend mit der bereits existierenden XSalsa20-Poly1305- Verschlüsselung verwendet, um Nachrichten zu senden. Als nächster Schritt ist angedacht das in Tox verwendete Noise-Protokoll explizit für Tox zu entwickeln, anstatt die Noise-C Programmbibliothek zu verwenden, die die meis- ten Noise-Handshake-Patterns und kryptographischen Verfahren unterstützt. Dies würde die Abhängigkeit von Noise-C für c-toxcore entfernen und durch eine reduzierte Anzahl von Quellcodezeilen die Angriffsoberfläche verringern. Außerdem stellt Noise weitere Funktionen, wie z.B. Session-Rekeying, zur Verfügung, die in Tox übernommen werden könnten, um die Kommunikationssicherheit weiter zu erhöhen. Ebenfalls könnte für das Tox-Protokoll und seine Implementierung in C eine tiefgehende Sicherheitsanalyse durchgeführt werden. iii List of Abbreviations ACCE Authenticated and Confidential Channel Establishment AEAD Authenticated Encryption with Associated Data AES Advanced Encryption Standard AKE Authenticated Key Exchange ATHiCC Asynchronous Tor Hidden Chat Communication DAKE Deniable Authenticated Key Exchange DH Diffie-Hellman DHT Distributed

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    96 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us