Visualization of Cryptographic Protocols
Total Page:16
File Type:pdf, Size:1020Kb
Masaryk University Faculty of Informatics Visualization of Cryptographic Protocols Bachelor’s Thesis Michael Koudela Brno, Spring 2021 Masaryk University Faculty of Informatics Visualization of Cryptographic Protocols Bachelor’s Thesis Michael Koudela Brno, Spring 2021 Declaration Hereby I declare that this paper is my original authorial work, which I have worked out on my own. All sources, references, and literature used or excerpted during elaboration of this work are properly cited and listed in complete reference to the due source. Michael Koudela Advisor: prof. RNDr. Václav Matyáš, M.Sc., Ph.D. i Acknowledgements First of all, I would like to thank all those teachers who teach in such a way that their lectures are interesting and inspiring for students; who create a friendly atmosphere where students are not afraid to ask. I am convinced that students and their teachers should not stand against each other, but together against exciting but challenging topics. Then, I would like to thank prof. Matyáš who let me work on this topic and provided me with advice when needed, always with optimism. The biggest thanks, however, belong to my family and girlfriend, who gave me food and made me relax from time to time so that I could live long enough to see the day when the work on the thesis is finally over. iii Abstract The aim of this thesis is to describe how cryptographic protocols get visualized and to review the tools that can be used for that pur- pose. Various possible views are introduced, and it is analysed which approaches should be preferred, both in general and in four sample scenarios. The existing tools are tested and presented in such a way that it is clear which of them are available, what are their advantages and disadvantages, and on which occasions they should be used to reach the desired goals. The usage of tools is demonstrated on several examples of protocols. The thesis serves not only as an overview of the existing visualizations of those protocols but also as a source of the new ones, which can be used when these protocols are studied. The thesis helps to decide which tool should be used to visualize a protocol in a given situation. It also helps developers of visualization applications, enabling them to study the existing solutions and their problems, and giving them advice on what requirements should their applications fulfil. iv Keywords cryptographic protocol, cryptography, protocol demonstration, specification of requirements, visualization, visualization tool v Contents 1 Introduction 1 2 Visualizations and Their Classification 3 2.1 Dynamics . .3 2.2 Representations . .4 2.3 Perspective . .5 3 Identification of Requirements 7 3.1 General Requirements . .7 3.2 Specific Situations . 10 3.2.1 General Schema Demonstration . 10 3.2.2 Attack Demonstration . 12 3.2.3 Practical View . 13 3.2.4 Security Modifications . 15 4 Visualization Tools 17 4.1 Existing Applications . 17 4.1.1 ProtoViz . 17 4.1.2 Tutorial Environment For Cryptographic Proto- cols (TECP) . 18 4.1.3 Graphical Aid For Security Protocols (GRASP) . 19 4.1.4 Security Protocol Engineering and Analysis Re- source (SPEAR) . 20 4.1.5 Graphical Representation and Animation for Cryptography Education (GRACE) and DISCERN 21 4.1.6 Security Protocol Animator (SPAN) . 24 4.1.7 CrypTool . 26 4.1.8 Cryptography Visualization (CryptoViz) . 29 4.2 Images . 31 4.3 Web Simulations . 33 4.4 Game Representation . 35 5 Protocol Studies 37 5.1 Diffie-Hellman Protocol . 37 5.1.1 Basic Schema . 37 5.1.2 Security . 38 vii 5.1.3 Visualizations . 39 5.2 Needham-Schroeder Shared-Key Protocol . 40 5.2.1 Basic Schema . 40 5.2.2 Security . 42 5.2.3 Visualizations . 42 5.3 Needham-Schroeder Public-Key Protocol . 44 5.3.1 Basic Schema . 44 5.3.2 Security . 45 5.3.3 Visualizations . 45 5.4 R-COMSET Protocol . 46 5.4.1 Basic Schema . 47 5.4.2 Security . 48 5.4.3 Visualizations . 49 6 Evaluation 51 6.1 Tools Overview . 51 6.2 Suggestions for Use Cases . 58 6.2.1 Protocol and Attack Demonstration . 58 6.2.2 Practical view . 59 6.2.3 Security Modifications . 59 7 Conclusion 61 Bibliography 63 A Created Visualizations 69 A.1 GRACE . 69 A.2 SPAN . 69 A.3 CrypTool2 . 69 A.4 CryptoViz . 70 B Screenshots 71 B.1 GRACE . 71 B.2 SPAN . 74 B.3 CrypTool2 . 76 B.4 CryptoViz . 77 C Image Representation 79 viii List of Tables 6.1 Classification of visualization applications. 55 6.2 Classification of visualization techniques. 57 ix List of Figures 2.1 Example message in a graphical (on the left) and physical (on the right) representation. 5 3.1 Typical structure of student learning time [6]. 8 3.2 Overview of the studied use cases. 11 3.3 Example of a composite message structure. Image part extracted from [9]. 15 4.1 Example protocol in ProtoViz [10]. 17 4.2 Example protocol in TECP [11]. 18 4.3 Example protocol in GRASP [12]. 20 4.4 Example protocol in SPEAR II [13]. 21 4.5 Screenshot from GRACE. 22 4.6 Example interaction in DISCERN [16]. 23 4.7 Screenshot from SPAN simulation with intruder. 26 4.8 Screenshot from CrypTool2. 28 4.9 Screenshot from CryptoViz with entering user input. 31 4.10 Illustration of a simple authentication protocol. Image adapted from [9]. 32 4.11 Website simulation example [23]. 34 4.12 Illustration of basic game concepts [24]. 35 4.13 Steps of RSA key exchange in the game [24]. 36 5.1 Using image to visualize man-in-the-middle attack. Image adapted from [9]. 40 5.2 NSSK illustration [36]. 43 5.3 Instructions for NSSK simulation from game rules [25]. 43 5.4 Man-in-the-middle attack on NSPK [38]. 46 5.5 Fixed version of NSPK [38]. 46 5.6 Interleaving attack schema created in PlantUML. 50 B.1 Execution of planned steps is controlled in a separate window. Clicking on icons on the lower or upper bar in the main window results in a new action, changing the protocol run. 71 B.2 Mathematical operations are displayed separately. 72 B.3 Sending messages is visualized using colourful arrows. 72 B.4 Each variable is represented by a small icon. 73 B.5 Details are displayed in a separate window on request. 73 xi B.6 A simple MSC representation is used. 74 B.7 The application can detect attacks automatically. 74 B.8 Attack simulation can be created automatically after an attack is discovered. 75 B.9 It is possible to compose attacker’s knowledge to create a new message. 75 B.10 The whole protocol is executed at once. 76 B.11 Inputs can be generated automatically as well as typed manually. 77 B.12 Sending messages is visualized using moving boxes. 77 B.13 Inputs are automatically validated. 77 B.14 Description of a currently performed operation supports LaTeX syntax. 78 B.15 Information boxes can be added to explain what is happening. 78 B.16 Variables can be displayed in several formats. Past actions are visible only in the log. 78 C.1 Explanation of used symbols. 80 C.2 Public items are located next to the head with party name while the private ones are below, next to the lifeline. 80 C.3 Various tones of the same colour may be used if there are two items of the same type belonging to the same party (r1B and r2B). 81 C.4 Visualization of Needham-Schroeder Shared-Key Protocol. 81 C.5 Visualization of Needham-Schroeder Shared-Key Protocol with replay attack. 82 C.6 Visualization of Needham-Schroeder Public-Key Protocol. 83 C.7 Visualization of Needham-Schroeder Public-Key Protocol with man-in-the-middle attack. 84 C.8 Visualization of R-COMSET Protocol. 85 C.9 Visualization of R-COMSET Protocol with interleaving attack. 86 xii 1 Introduction Cryptographic protocols play an important role in security and privacy of contemporary communication. They are usually described using a textual notation, which is not much illustrative. Visualization can be used to make protocols more understandable and easier to study. Nevertheless, there is a wide range of approaches that can be taken, so when a visualization is used, it is important to ensure that it is suitable for a given purpose. Unfortunately, a systematic overview that would help with the choice of the appropriate visualization is missing. In the best case, studies analyse the approaches used by the visualization tools but do not provide examples of practical usage [1, 2], so it is unclear which tools are available and how they can be accessed and used. This makes the situation difficult for potential developers of such tools as they cannot study the flaws in the past projects. The aim of this thesis is to describe various ways of visualization that facilitate understanding cryptographic protocols and identify useful properties of those visualizations in different learning scenarios. Based on that, the existing applications and techniques are reviewed, and it is recommended on which occasions they should be used to reach the desired goals. At first, different views on how to classify visualizations and the associated tools are introduced. Then, the particular requirements expected from the visualizations are defined, both in general and specifically for concrete scenarios related to cryptography courses. In the fourth chapter, various existing tools are studied. The available ones have been tested in practice, and their advantages and disadvan- tages have been identified. The usage of these tools is demonstrated on selected protocols, described in the fifth chapter.