Internet of Things Security Encryption Capacity Comparison for Iot Based on Arduino Devices
Total Page:16
File Type:pdf, Size:1020Kb
Master of Science in Computer Science June 2020 Internet of Things Security Encryption Capacity Comparison for IoT based on Arduino Devices Olaide Jamiu Olalekan Faculty of Computing, Blekinge Institute of Technology, 371 79 Karlskrona, Sweden This thesis is submitted to the Faculty of Computing at Blekinge Institute of Technology in partial fulfilment of the requirements for the degree of Master of Science in Computer Science. The thesis is equivalent to 20 weeks of full time studies. The author declare that he is the sole author of this thesis and that he had not used any sources other than those listed in the bibliography and identified as references. He further declares that he has not submitted this thesis at any other institution to obtain a degree. Contact Information: Author: Jamiu Olalekan Olaide [email protected] University advisor: Anders Carlsson Department of Computer Science and Engineering Faculty of Computing Blekinge Institute of Technology Internet : www.bth.se SE-371 79 Karlskrona, Sweden Phone : +46 455 38 50 00 Fax : +46 455 38 50 57 ABSTRACT Background: IoT is a system of devices with unique identifiers (UIDs) and can transfer data over a network. They are widely used in various sectors such as Health, Commercial, Transport, etc. However, most IoT devices are being exploited, as it is being recorded for the past few years, on how vulnerable users can be if they have any of these devices in their network. Arduino is one of the most commonly used IoT devices, notably products such as Uno and Mega2560 are highly acceptable in the market and the research world. It is important to know how these devices react to security measures such as encryptions. Objectives: To carry out a theoretical study and performance comparison on Arduino devices and standard cryptographic encryption. The devices and encryption used are Arduino Uno, Mega2560 and AES, XXTEA respectively. Methods: To gain knowledge and information about the selected algorithms and devices, a literature analysis was adopted. An experiment was also carried out to get measurements and record how the algorithms perform on these devices. Results: The literature analysis provides the design similarities and differences of the algorithms and devices. The controlled experiment shows the measurement of the stated encryptions on the Arduino devices. Conclusions: The conclusion is that Arduino Uno and Mega2560 have a similar design but differ in their memory allocation. The AES and XXTEA algorithm have different designs and performances. The result in the controlled experiment shows that the XXTEA outperforms the AES algorithm in terms of Memory and Time consumption significantly in both devices. The Arduino Uno device is slightly ahead of Mega2560 when comparing the result. Keywords: Encryption, Arduino Microcontroller, Security, Similarities, Performance. iii ACKNOWLEDGMENT I would like to give thanks to my teachers, colleagues, and friends for making this master's degree fun. Special thanks to my supervisors Anders Carlsson and Maryna Yevdokymenko, for their guidance, continuous support and their constant and timely assistance throughout my thesis. It would not have been possible to finish this thesis without them. I would also like to give special thanks to Adamov Oleksandr, Amal Mersni for their support and criticism. Also, a special thanks to Prof Arkadii Snihurov for his encouragement, pieces of advice, and useful feedback. I would like to thank my wonderful family and friends for their emotional support, motivation, prayers, and constant encouragement throughout my entire program. iv LIST OF ABBREVIATIONS AAA Authentication, Authorization, and Accounting AES Advanced Encryption Standard AVR Automatic Voltage Regulator CBC Chaining Block Cipher CIA Confidentiality, Integrity, and Availability CPU Central Processing Unit ECB Electronic Code Book EEPROM Electrical Erasable Programmable Read-only Memory IDE Integrated Development Environment IEEE Institute of Electrical Electronic Engineers IoT Internet of Things IV Initialization Vector RAM Random Access Memory ROM Read-only Memory RSA Rivest–Shamir–Adleman SPN Substitution- Permutation Network SRAM Static Random Access Memory TEA Tiny Encryption Algorithm TX/RX Transmitting and Receiving Pins UFN Unbalanced Feistel Network WSN Wireless Sensor Network XXTEA Extended Tiny Encryption Algorithm v LIST OF TABLES Table 3.1: Comparison between Arduino and other IoT devices ............................................... 9 Table 3.2: AES Encryption Round ........................................................................................... 11 Table 4.1: Detail of the Experiment design. ............................................................................. 16 Table 5.1: Comparison of Arduino devices ............................................................................. 19 Table 5.2: XXTEA and AES Properties ................................................................................... 20 Table 5.3: Ranking of the encryption based on Time and Memory ......................................... 21 Table 5.4: Accumulated data for memory. ............................................................................... 25 Table 5.5: Data computation of Time consumption ................................................................. 28 Table 5.6: Summary of Mann Whitney U Test for both Memory and Time ........................... 30 Table A.1: Definition of Mann Whitney U test parameters ..................................................... 45 Table A.2: Test for Memory .................................................................................................... 45 Table A.3: Test for Time .......................................................................................................... 48 vi LIST OF FIGURES Figure 1.1: IoT connectivity. Figure adapted from figure 1 in [1] ............................................ 1 Figure 3.1: Arduino Uno board[15] ........................................................................................... 8 Figure 3.2: Arduino Mega2560 board.[15] ................................................................................ 8 Figure 3.3: Arduino console Sketch. Figure adapted from the IDE. .......................................... 7 Figure 3.4: ECB mode of operation. Figure adapted from [51] ............................................... 10 Figure 3.5: The CBC encryption and decryption. Figure adapted from [51] ........................... 11 Figure 3.6: AES Algorithm[13] ............................................................................................... 12 Figure 3.7: One round of Corrected TEA Block ...................................................................... 13 Figure 5.1: Graphical illustration of the SRAM memory (16byte) ......................................... 22 Figure 5.2: Flash memory graphical illustration. (16byte) ....................................................... 22 Figure 5.3: SRAM memory graphical illustration for 24 bytes ............................................... 23 Figure 5.4: Flash Memory graphical illustration for 24 bytes .................................................. 23 Figure 5.5: SRAM memory graphical illustration for 32byte .................................................. 24 Figure 5.6: Flash Memory Graphical illustration for 32byte. .................................................. 24 Figure 5.7: Graphical Illustration of Uno Time consumption (16bytes) .................................. 25 Figure 5.8:Graphical illustration of Mega Time consumption (16bytes) ................................. 26 Figure 5.9: Graphical illustration of Uno Time consumption (24bytes) .................................. 26 Figure 5.10: Graphical illustration of Mega Time consumption 24bytes ................................ 27 Figure 5.11: Graphical illustration of Uno Time consumption 32bytes .................................. 27 Figure 5.12: Graphical illustration of Mega Time consumption 32bytes ................................ 28 Figure 5.13: Distribution Type (Discrete uniform) .................................................................. 29 Figure 5.14: QQ plot ................................................................................................................ 29 Figure A.1: AES ECB Single Algorithm ................................................................................. 40 Figure A.2: AES_128 Code .................................................................................................... 41 Figure A.3: AES multiple block encryption/decryption(ECB) Algorithm .............................. 41 vii Figure A.4: ECB multiple Code ............................................................................................... 42 Figure A.5: AES CBC (single call) Algorithm ........................................................................ 42 Figure A.6: AES CBC code ..................................................................................................... 43 Figure A.7: XXTEA Algorithm ............................................................................................... 43 Figure A.8: XXTEA code ........................................................................................................ 45 viii CONTENTS ABSTRACT .................................................................................................................... III ACKNOWLEDGMENT ...............................................................................................