Iot Security Using Aes Encryption Technology Based Esp32 Platform
Iot Security Using Aes Encryption Technology Based Esp32 Platform
Iot Security Using Aes Encryption Technology Based Esp32 Platform
2, March 2022
Abstract: The Internet of Things (IoT) is one of the most important modern technologies that have attracted the most
interesting areas of life, whether industrial, academic, or other, in recent years. The main goal is to integrate the physical
world with the digital world through a seamless ecosystem, and this constitutes a new era for the Internet. This technology
provides high commercial value to enterprises as it provides many opportunities in many applications such as energy, health,
and other sectors. However, this technology suffers from many security problems, as it is considered the biggest challenge due
to its complex environment and the limited resources of its devices. There is a lot of research to find successful security
solutions in IoT, in this research, a proposed solution to secure IoT systems using Advanced Encryption Standard (AES)
technology is achieved. Some sensors were linked as an example of the Internet of Things. The data is received by the card
created and developed by Espressif Systems (ESP32) module, where its encrypted then sends to the internet site through an
authorized person to be received from anywhere, and it is also possible to receive it via a published IP which is announced
within the internal network of the ESP32 device module. The decryption part is proposed at last to find out the true values of
the sensors. The proposed approach shows good secured and balanced results at the end.
lights) were linked to the ESP32, the ESP32 chip 4.1.2. ESP32 SoC ( Block Diagram)
receives and encrypts the data, and then this data is
The ESP32 SoC shown in the figure contains:
sent to the special internet page , where this page is
opened securely by a name and a password, the data is 12 Xtensa 32-bit cores (called PRO and APP CPU)
also published on the IP address within the local at 240MHz RTC13 subsystem with ULP.
Internet network linked to the ESP32 chip within the 530 KB SRAM and 448 KB ROM.
same service provider, after receiving the data it can be FAST RTC SRAM (8 KB) and SLOW RTC SRAM
decrypted byusing the AES application on the Internet (8 KB).
and also as an application on a mobile devices, to eFuse memory (1 KB).
know the real values of the data received, and in this Built-in radios: Bluetooth Low power radios,
way it will be difficult to know the real values in the Bluetooth 4.2, and Wi-Fi 802.11 / b / g / e / I.
event that someone can access the information page to Surround input/output: UART, SPI, Ethernet, I2C,
steal the data, because he will need to know the ADCs, DAC, capacitive Touch sensors, PWM
algorithm used for encryption and also the key used in (Pulse-width modulation), etc.
this method, and in this way security can be strongly Contains that optional Flash Two built-in chip
achieved and the information is protected, Figure 4 variants included Flash-ESP32-PICO-D4 with
show this design. (4MB) and ESP32-D2WD with (2MB).
HW Encryption Accelerator with AES,SHA-
256,RSA, and RNG. See Figure 6 [22].
Table 3. Ultrasonic sensor pin configuration. depends on the length of the key [23].
No Pin Name Description
1 VCC Power supply + 5 v 4.3.2. Description of the AES Algorithm
A trigger pin is an i/p pin that has to be kept
2 trigger high for 10µs for initialize measurement by 1. Key Expansions- Round keys are derived from the
sending as a wave.
The echo pin is an o/p pin. This pin also goes
cipher key using the Rijndael key table. AES
high for some of the time that will be the same requires a separate 128-bit round key block for each
3 Echo
as the time taken for the wave to return back to round plus one more. Figure (10) illustrates how this
sensor.
algorithm work
4 Ground It connects with the ground in the circuit
2. Round Primary: Add Round Key-Each byte of the
state is combined with a round key block using
4.3. Advanced Encryption Standard (AES) bitwise xor.
Cryptography 3. Both the encryption and decryption processes
4.3.1. (AES) Specifications require a number of rounds, the number of rounds
depends on the length of the key used in encryption
AES Algorithm: It is a symmetric key block cipher and decryption, in the research paper we used a key
technology used for encryption/decryption. This length (128 bits) so this algorithm needs 10 rounds
technology uses 128, 192, and 256-bit encryption keys to perform the encryption or decryption process, and
to encrypt/decrypt 128-bit data blocks. In this paper, in each round of them Four operations are
we used a 128-bit key length for performed, except for the last round in which three
encryption/decryption. Using a 128-bit encryption key operations are performed as described below.
in this algorithm provides high security because an
encryption key of this length is difficult to crack. As a) Rounds: (1-Sub Bytes, 2-Shift Rows,3-Mix
the estimated time required to break this key is years. Columns, 4-Add Round Key).
The AES algorithm consists of the original key, b) Final Round (1-Sub Bytes, 2-Shift Rows, Add
metadata, and ten rounds (128 bits). The user gives the Round Key) [23].
original key and raw data randomly. In this algorithm As for the decryption process, the operations that are
there are nine rounds, four operations are performed on executed in each round are:
the data in each of these nine rounds in the two states
of encoding and decoding. a) Rounds: (1-InvSubBytes, 2-InvShift Rows, 3-
In the case of encryption, the operations that are InvMix Column, 4-Add Round Key).
performed are: byte substitution (S-box), ShiftRows, b) Final Round: (1-InvSub Bytes, 2-InvShift Rows, 3-
MixColumns, and add round key. In the tenth (last) Add Round Key)
round, the same operations are performed except for
4.3.3. Substitute
the MixColumns transformation.
In the case of decryption, the previous operations (Sub Bytes and InvSub Bytes) are the first operation in
each run of execution, in which each byte of the state is
replaced by a byte of nonlinear S-box and Inverse-S-
box, to find the replacement value, the intercept must
be used in the table. Sub Bytes and InvSub Bytes are
used to hide the relationship between plain text and
ciphertext [2, 3] see in Figure (11).
web page that can be accessed from any site in the the sensor data on the mobile device, and it also
world by the person who has access. The data that displays its value after encryption, and the ability to
appears on this page may be limited to encrypted control the illumination of two lights. This interface
data, or other data may be added to it. is accessed via IP.
Figure 16. Data sensors on Firebase web page. Figure 18. Data sensors on mobile.
Figure 17, shows receipt of data on a website In Figure 19, we have verified the authenticity of
“Things peak .The validity of the encrypted data the original and encrypted data received through a
was verified by applying the AES algorithm on the special application for the AES algorithm to
Internet as a site that implements this algorithm demonstrate the design idea, which is the receipt of
after entering the data necessary for encryption. data in an encrypted form and then it is entered
through an application with the key used in
encryption to obtain the original values of the data,
to keep it from being stolen. And to ensure the
confidentiality of information.
6. Conclusions
Figure 17. Data sensors on things peak web page.
In this design, a mechanism was implemented that
Figure 18, shows the receipt of the original value of
222 The International Arab Journal of Information Technology, Vol. 19, No. 2, March 2022
works to enhance and strengthen the security of the no. 1, pp.1035, 2020.
Internet of Things, by using the ESP32 platform to [12] Inamdar A., “ESP32-S2-Security Features,” The
implement the encryption algorithm AES, and the ESP Journal, https://medium.com/the-esp-
design was also implemented on some sensors to Journal/esp32-s2-security-improvements-
represent the IoT part of the smart home or any other 5e5453f98590, Last Visited, 2020.
application. We chose the temperature, humidity, [13] Khoa T., Nhu L., Son H., Trong N., Phuc C.,
distance and control sensor with two lights. Phuong N., Dung N., Nam N., Chau D., and Duc
This design can be applied to protect and secure the D., “Designing Efficient Smart Home
incoming data from the Internet of Things, due to what Management with Iot Smart Lighting: A Case
the ESP32 chip provides from dealing with IoT, as Study,” Wireless Communications and Mobile
well as the strength provided by AES technology in Computing, vol. 2020, pp.1-18, 2020.
protecting and securing the data received or sent. [14] Kodali R. and Soratkal S., “MQTT Based Home
Automation System Using ESP8266,” in
References Proceedings of IEEE Region 10 Humanitarian
Technology Conference, Agra, pp. 1-5, 2016.
[1] Abd Zaid M. and Hassan S., “Modification [15] Kouicem D., Bouabdallah A., and Lakhlef H.,
Advanced Encryption Standard for Design “Internet of Things Security: A Top-Down
Lightweight Algorithms,” Journal of Kufa for Survey,” Computer Networks. vol. 141, pp. 199-
Mathematics and Computer, vol. 6, no. 1, pp. 21- 221, 2018.
27, 2019. [16] Nandhini P. and Vanitha V., “A Study of
[2] Abdullah A., “Advanced Encryption Standard Lightweight Cryptographic Algorithms for IoT,”
(AES) Algorithm to Encrypt and Decrypt Data International Journal of Innovations and
Cryptography and Network Security,” Advancement in Computer Science, vol. 6, no. 1,
Ryptography and Network Security, vol. 16, pp. pp. 26-35, 2017.
1-11, 2017. [17] Parida D., Behera A., Naik J., Pattanaik S., and
[3] Choi I. and Kim J., “Area-Optimized Multi- Nanda R., “Real-time Environment Monitoring
Standard AES-CCM Security Engine for IEEE System Using ESP8266 and Thing Speak on
802.15. 4/802.15,” Journal of Semiconductor Internet of Things Platform” in Proceedings of
Technology and Science, vol.16, no. 3, pp. 293- International Conference on Intelligent
299, 2016. Computing and Control Systems, Madurai, pp.
[4] Chowdhury M., Ferdous M., Biswas K., 225-229, 2019.
Chowdhury N., Muthukkumarasamy V., “A [18] Postulka J., “Programming of ESP32
Survey on Blockchain-Based Platforms for IoT Microcontrollers,” 2020.
Use-Cases,” The Knowledge Engineering [19] Raghavan R., “https://acodez.in/data-encryption-
Review, vol. 35, 2020. Algorithms/,” and
[5] “ESP32 Series Datasheet,” Espressif Systems, https://blog.storagecraft.com/5-common-
Version 3.6, 2021. Encryption-Algorithms/, Last Visited, 2021.
[6] “ESP-IDF Programming Guide,” [20] Selmane N., Guilley S., and Danger J., “Practical
https://docs.espressif.com/projects/esp- Setup Time Violation Attacks on AES,” in
idf/en/latest/esp32/, Last Visited, 2020. Proceedings of 7th European Dependable
[7] Florin R. and Ionut R., “FPGA Based Computing Conference, Kaunas, pp. 91-96, 2008.
Architecture for Securing Iot with Blockchain,” [21] Shanmuganathan H. and Mahendran A.,
in Proceedings of International Conference on “Encryption based on Cellular Automata for
Speech Technology and Human-Computer Wireless Devices in Iot Environment,” The
Dialogue, Timisoara, pp. 1-8, 2019. International Arab Journal of Information
[8] Hamzah H., Ahmad N., and Ruslan S., “The 128- Technology, vol. 18, no. 3, pp. 347-355, 2021.
Bit AES Design by Using FPGA,” Journal of [22] Vacha M., “IoT Device Security on the ESP32
Physics: Conference Series, vol. 1529, no. 2, pp. platform,” Master's Thesis, Czech Technical
022059, 2020. University in Prague Computing and Information
[9] https://components101.com/sensors/dht11- Center, 2020.
temperature-sensor#, Last Visited, 2020. [23] Zhang J., Gao W., Li J., Tian X., and Dang H.,
[10] https://components101.com/sensors/ultrasonic- “High-Speed and High-Security Hybrid AES-ECC
sensor-working-pinout-datasheet, Last Visited, Cryptosystem Based on FPGA,” in Proceedings of
2020. IEEE International Conference on Signal,
[11] Hussein N. and Shujaa M., “DNA Computing Information and Data Processing, Chongqing, pp.
Based Stream Cipher for Internet of Things 1-6, 2019.
Using MQTT Protocol,” International Journal of
Electrical and Computer Engineering, vol. 10,
IoT Security Using AES Encryption Technology based ESP32 Platform 223
Mohammad Al-Mashhadani
graduate student (Master) in Middle
Technical University, Electrical
Engineering Technical College.
Iraq-Baghdad. majoring in
Computer Technology Engineering-
Holds a bachelor’s degree in the
same specialty in (2004).