Performance Evaluation of Trivium on Raspberry Pi

High connectivity of billions of IoT devices lead to many security issues. Trivium is designed for IoT to overcome the security challenges of IoT. The objective of this study is to implement a security service to provide confidentiality for the communication of IoT devices. Furthermore, this study aims to analyze Trivium performance in terms of keystream generation time and memory utilization on Raspberry Pi Zero, Raspberry Pi 2B, and Raspberry Pi 3B. The result showed that there was a statistically significant difference between the keystream generation time and memory utilization on Raspberry Pi Zero, Raspberry Pi 2B, and Raspberry Pi 3B based on Kruskal-Wallis H test. Further test of Jonckheere-Terpstra indicates that the fastest keystream generation time was on Raspberry Pi 3B, and the smallest memory utilization was on Raspberry Pi 2B. The implemantation of Trivium on three versions of Raspberry Pi shows promising results with less than 27 MB of memory utilization for cryptography leaves more resources available to applications. Keywords—Trivium; Raspberry; Kruskal-Wallis


I. INTRODUCTION
The Internet of Things (IoT) being a promising technology that enables people and objects in the physical world also numerous devices and sensors will be communicating with each other.The increased volume of communication with a huge number of nodes has the potential leading to serious security challenges.One node of IoT is an important sources of information and also a sensitive information that need to be protected, while IoT is vulnerable to attacks [1], [2], such as message modification and/or alteration, traffic analysis, Denial of Service (DoS), Distributed DoS, eavesdropping, Sybil attacks, etc.According to a study by HP states that 70% of the devices in IoT are vulnerable to attacks [3].
Various cryptographic algorithms have been researched to overcome the problem.Trivium is a stream cipher designed by Christophe De Canniere and Bart Preneel who participated in the eSTREAM competition and has been selected as part of a portfolio for hardware-oriented ciphers [4].Based on eSTREAM, NIST recommends Trivium as one of the standard for lightweight cryptography.Some studies evaluated Trivium and other lightweight cryptographic algorithms performance as in [5], [6] and [7].The hardware implementation of eSTREAM ciphers have been implemented on FPGA devices [8] or 8-bit AVR microcontrollers [9] and on NodeMCU [10].
The objective of this study is to implement Trivium on three versions of Raspberry Pi as an embedded device concept of IoT to provide security services and compare the results among them.To evaluate the performance, the memory utilization and keystream generation time of Trivium algorithm is observed.To analyze the data, The Kruskal-Wallis H test is used to examine the difference implementation of Trivium on three Raspberry Pi versions.This paper is structured as follows.Section 2 explains Trivium algorithm and the target devices, i.e Raspberry Pi Zero, Raspberry Pi 2B and Raspberry Pi 3B.Section 3 describes an explanation related to the implementation of Trivium on Raspberry Pi and the result analysis.Finally, conclusions are drawn in Section 4.

II. TRIVIUM ARCHITECTURE AND RASPBERRY PI
This section will disscuss the overview of Trivium and the target devices i.e.Raspberry Pi Zero, Raspberry Pi 2B and Raspberry Pi 3B, also the test to analyze the data namely Kruskall-Walis H test.

A. Trivium Architecture
In 2005 Christophe De Canni`ere and Bart Preneel developed a stream cipher called Trivium [11].Trivium is a synchronous stream cipher that takes a secret key and an Initial Value (IV) as inputs and produces keystream that is used for encryption process.It is designed for constrained devices to generate up to bits of keystream from an 80-bit secret key and an 80-bit IV.The state consists of 288 bits which are denoted as s 0 , s 2 ,....,s 287 and depicted in Figure 1.There are two phases in Trivium process i.e. phase internal initialization state by using the key and IV.
The initialization process is performed by loading 80 bits of key and 80 bits of IV into the initial state of 288-bit and the rest are padded with 0, except for bit S 286 , S 287 , S 288 .Then it is rotated four times, a process that is done similar to the key generation phase, but without generating a bit key stream.A complete explanation is given by the following pseudo-code:

B. Raspberry Pi
Raspberry Pi is a single-board, low-cost and highperformance developed in the UK by the Raspberry Pi Foundation that can also be used for embedded systems [10].There are a variety of Raspberry Pi models with different features and improvements in their latest versions that add more components.In this paper, three types of Raspberry are used, i.e.Raspberry Pi Zero, Raspberry 2B, and Raspberry 3B.

C. The Kruskal-Wallis H Test
The Kruskal-Wallis H test is a test that can be utilized to analyze if there are statistically significant differences between two or more categories of an independent variable [15].Kruskal-Wallis is used to determine the significance (pvalue) also the medians or mean ranks of three or more categories.This test is a non-parametric test in which the data within each of the multiple categories do not need to follow a normal distribution.

III. IMPLEMENTATION
Trivium algorithm is tailored for IoT to address the security challenges.The vital process in Trivium, as a symmetric key algorithm, is the generation of keystream.The keystream generation process involves complex mathematical operations.The collected data were then analyzed by using Kruskal-Wallis H test to determine whether there is statistically significant differences of memory utilization and keystream generation time among Raspberry Pi Zero, Raspeberry Pi 2B, and Raspberry Pi 3B.Kruskall-Wallis H test was used since the data were not normally distributed.In Kruskall-Wallis H test, the p-value for the chi-square approximation test is reasonably accurate when the number of experiments is greater than or equal to 30 [16].

IV. CONCLUSION
Trivium is designed for IoT tohandle the security issues of IoT.The implemantation of Trivium on Raspberry Pi Zero, Raspberry Pi 2B, and Raspberry Pi 3B presents promising results that it is suitable candidate to be adopted in IoT applications as with less than 27 MB of memory utilization for cryptography leaves more resources available to applications.The results of memory utilization and keystream generation time were then compared among three types of Raspberry Pi.The result showed that there was a statistically significant difference between the keystream generation time on Raspberry Pi Zero, Raspberry Pi 2B, and Raspberry Pi 3B, and the fastest keystream generation time was on Raspberry 3B.While for memory utilization, the result presented that there was a statistically significant difference between memory utilization on Raspberry Pi Zero, Raspberry Pi 2B, and Raspberry Pi 3B, and the smallest memory utilization was on Raspberry Pi 2B.
To examine the performance, Trivium is evaluated on the basis of memory utilization and keystream generation time.To measure the memory utilization and the keysteram generation time of the Trivium, each of Raspberry Pi is configured in single mode.The memory utilization and keystream generation time of Trivium algorithm are observed and compared among three types of Raspberry Pi.The experiment run 40 times for each Raspberry Pi with various combination of Key and IV as inputs which generates keystream.The average of keystream generation time was 3391.275microsecond for Raspberry Pi Zero, 1426.8 microsecond for Raspberry Pi 2B, and 1051.775microsecond for Raspberry Pi 3B.In the meantime, memory utilization was 26.75 MB for Raspberry Pi Zero, 20.45 MBfor Raspberry Pi Zero and 24.00 MB for Raspberry Pi Zero.With less than 27 MB of memory utilization indicated that with fewer resources for cryptography leaves more resources available to applications.
Table I details the comparison among Raspberry Pi.

TABLE I
Table II to V. www.ijacsa.thesai.org

TABLE II
Whilst for the memory utilization, according to TableIVand TableV, there was a statistically significant difference between memory utilization (χ2= = 112.848,p= 0.000), with a mean rank of 100.50 for Raspberry Pi Zero, 20.50 for Raspberry Pi 2B and 60.50 for Raspberry Pi 3B.For further analysis, if the compared groups are ordered in a certain way, Jonckheere-Terpstra Test is conducted.Table VI and VII presents the result of the Jonckeere-Terpstra test.Based on Table VI, Jonckheere-Terpstra test for ordered alternatives showed that there was a statistically significant trend of keystream generation time of Raspberry Pi Zero, Raspberry Pi 2B, and Raspberry Pi 3B T JT = 133.00,p < 0.0005.Or by way of the fastest keystream generation time was on Raspberry Pi 3B.As for the memory utilization, Jonckheere-Terpstra indicated that there was a statistically significant trend of memory utilization of Raspberry Pi Zero, Raspberry Pi 2B, and Raspberry Pi 3B T JT = 1600.00,p < 0.0005.Or in other word, the largest memory utilization was on Raspberry Pi Zero.

TABLE VI .
JONCKHEERE-TERPSTRA TEST RESULT OF KEYSTREAM GENERATION