Implementing and developing multi-stage cryptography technique for low-cost long-range communication system

ABSTRACT


INTRODUCTION
The vulnerability of cellular networks and wireless technologies during natural disasters or destructive events has been widely reported [1]- [3].These technologies require cell towers and expensive infrastructure to operate, which are susceptible to damage, leading to communication disruptions and obstructing help requests.For example, Hurricane Harvey caused extensive damage to cell towers and call centers, resulting in the internet being disabled in nearly two thousand homes [4].Similarly, during the Baltimore riots in 2015, cell towers were unable to handle the overload, resulting in the paralyzation of police communications and approximately a hundred death cases from police officers [5].Communication devices have revolutionized the way we connect and exchange information across the globe.However, in certain regions or during emergencies, existing communication systems may prove unreliable or inaccessible, leading to significant challenges in communication and coordination.To address these limitations and provide a solution that is affordable, power-efficient, and secure, this research proposes the development of a low-cost communication device capable of transmitting messages over long distances while prioritizing energy conservation and message security [6]- [11].
The primary objective of this research is to create a communication device that offers an efficient means of transmitting messages in areas with limited infrastructure or during critical situations where traditional communication channels may be compromised.To enhance its versatility and usefulness, the proposed device will also incorporate a global positioning system (GPS) feature to enable location sharing,

METHOD
The long-range low-power wireless modulation, known as LoRa, represents a cutting-edge wireless technology that has gained significant attention and recognition in recent years [12], [13].Studies have consistently demonstrated LoRa's outstanding capability to facilitate long-range communication with reliable coverage, making it a preferred choice for various applications, particularly in remote and challenging environments.The integration of chirp pulses and chirp spread spectrum (CSS) in LoRa's data transmission mechanism contributes to its robust performance and efficient utilization of radio frequency resources.
A crucial aspect of LoRa's appeal is its ability to safeguard sensitive data from unauthorized access.Through the implementation of advanced cipher algorithms, LoRa ensures end-to-end encryption with a robust 128-bit key.This security feature instills confidence in users, enabling them to transmit and receive data with enhanced privacy and protection.The LoRa Alliance, a consortium of leading technology companies and organizations, has diligently specified the technical parameters and standards for LoRa's operation.Data transmission occurs over specific radio frequency bands, including 433 MHz, 868 MHz, and 915 MHz.These well-defined frequency bands enable interference-free communication and ensure the coexistence of various LoRa-based applications.
LoRa's efficiency in transmitting small data chunks with low bit rates over extensive distances is truly remarkable.This unique capability is particularly advantageous for internet of things (IoT) applications, where devices often need to communicate essential information using minimal energy and bandwidth resources.Such efficiency translates into prolonged battery life and reduced operational costs for IoT deployments, further solidifying LoRa's position as a cost-effective and sustainable solution.The competitiveness of LoRa is reinforced by research that compares it with other IoT technologies, such as SigFox and weightless standards.Previous studies have consistently shown that LoRa exhibits the highest raw spectral efficiency among these technologies.Factors considered in the comparison include raw spectral efficiency, data rate, and spreading factors, among others.LoRa's superior spectral efficiency ensures optimal utilization of available frequency bands and makes it an ideal choice for IoT applications with stringent data transmission requirements.
In summary, long-range low-power wireless modulation is a wireless technology that uses chirp pulses and chirp spread spectrum to send data [12], [13].Recent studies have shown that LoRa is capable of providing long-range communication with reliable coverage.It is also capable of protecting data from unauthorized access using cipher algorithms.The LoRa Alliance specifies that LoRa uses 128-bit end-to-end encryption and transmits data using radio frequency signals on the 433 MHz, 868 MHz, and 915 MHz frequency bands.LoRa's ability to transmit small chunks of data with low bit rates over long distances is remarkable.Previous research indicates that LoRa has the highest raw spectral efficiency when compared with other IoT technologies such as SigFox and weightless standards.The comparison was based on features such as raw spectral efficiency, rate, and spreading factors, among others.

Cryptography
Cryptography is an essential tool in securing data from unauthorized access, achieved by converting information into an unreadable format through the use of mathematical algorithms and cryptographic techniques [14]- [17].Its name is derived from the ancient Greek terms "krypto" meaning secret and "graphein" meaning message.Cryptography involves two primary processes: encryption and decryption.Encryption is the process of converting plaintext into ciphertext, while decryption is the opposite process of converting ciphertext back to plaintext [14], [15], [17].To decrypt the message and access the original content, a secret key or password is required.Cryptography's main goal is to safeguard confidential information by implementing an unintelligible layer of text, making it possible for only intended individuals to decrypt the encrypted message using a key shared between them.Cryptography is also referred to as the art of secrets, as it ensures that all necessary information is protected from attackers.

Cryptography key
It is essential to understand the two primary types of cryptographic keys: symmetric keys and asymmetric keys [16]- [20].Symmetric key encryption involves generating one private key, which is then shared between two authorized individuals.Without the private key, no one else can view the message's content.Using the same private key, the intended recipient can decrypt the message and restore it to its original format [16], [18], [20]- [24].Examples of symmetric keys include advanced encryption standards (AES), blowfish (BF), and data encryption standards (DES).On the other hand, asymmetric key encryption employs a public key to encrypt the plaintext and a private key to decrypt it.The private key is kept secret and can only be decrypted by the authorized recipient, while the public key is accessible to anyone else.The asymmetric algorithm is reversible, meaning that if two individuals are communicating, one can encrypt the message using a public key, while the other can decrypt that message using a private key.Examples of asymmetric encryption include the Rivest, Shamir, Alderman (RSA) system and the elliptic curve cryptosystem (ECC).

Symmetric encryption
We propose a new encryption system that utilizes one or more symmetrical encryption techniques to modify characters, numbers, and symbols and encrypt plaintext with a private key.Our system incorporates the encryption methods outlined in references [16], [18], [20]- [22] to enhance security.We aim to provide a more robust and effective method of data encryption that can be applied in various settings to ensure the protection of sensitive information.As demonstrated, symmetric key algorithms exhibit superior performance compared to asymmetric algorithms.a. AES: the AES has gained widespread popularity as a reliable symmetrical encryption key for protecting data against potential threats.Its adoption was initiated by the National Institute of Standards and Technology (NIST) in 1997, in response to the vulnerabilities of DES.The latter has been rendered obsolete due to its short key length, which facilitated penetration within a brief period.Thus, AES emerged as a viable solution for data protection, offering enhanced security features.Notably, on November 26, 2001, AES was officially ratified as a federal standard.Its superiority lies in its capability to support a wide range of key lengths, which adds an additional layer of protection against malicious attacks.The AES employs keys that are 128, 192, and 256-bit in length, with 10, 12, and 14 rounds of encryption, respectively, as outlined in [24].The algorithm comprises three layers, with each layer performing a specific mathematical function.b.Transposition: as a symmetric cryptographic algorithm, the transposition algorithm relies on reordering the plaintext elements to produce ciphertext [14].There are various techniques under the transposition algorithm, such as the simple columnar and rail fence techniques. Rail fence: the technique involves writing the plaintext diagonally and then reading it as a sequence of rows [14]. Simple columnar: as a symmetric cryptographic algorithm, the simple columnar transposition technique involves writing the plaintext in a rectangular shape, row by row, and then reading it column by column [13], [14].The number of rows and columns in the rectangle must be taken into consideration.Moreover, both the sender and the receiver must be aware of the key used to rearrange the rectangle columns.c.Substitution: as a common practice, cipher algorithms frequently employ the substitution technique to convert plaintext to ciphertext (encryption) and vice versa (decryption) by substituting one character or group of characters with another.This technique utilizes a table of letters, with the first row arranged in alphabetical order and the second row arranged in a cryptographic sequence.The order of the exchanged letters between the sender and the receiver is sometimes determined by the key.Therefore, both parties must possess the same table to encrypt and decrypt the message.

Asymmetric encryption
Instead of using symmetric keys, asymmetric key encryption utilizes two keys: one public key to encrypt and one private key to decrypt [25]- [33].RSA is a widely recognized example of asymmetric cryptography [33], and numerous researchers have favored it as the most popular and well-known algorithm.Furthermore, RSA is included in asymmetric encryption, which also encompasses the elliptic curve cryptography algorithm [27]- [32].This algorithm was invented eight years after RSA's creation.Later, many techniques have been proposed on one or more of the previously mensioned approaches [34]- [38]. RSA: in [25], [27] the RSA encryption algorithm is an example of asymmetric cryptography, which is named after its three creators: R. Rivest, A. Shamir, and L. Adleman.This algorithm's security is based on the fact that finding two large prime numbers is relatively easy while factoring the primes' product is incredibly challenging [27].Nonetheless, modern computer advancements have made it easier to factor in large primes, resulting in possible RSA attacks.In RSA, the plaintext is encrypted using a public key to generate ciphertext, while a private key is utilized to decrypt the plaintext.
To encrypt and decrypt data using RSA, the public key, known to everyone in the network domain, is used in addition to the private key, which is kept secret except for the intended recipient.The RSA algorithm includes the following steps [25], [26]: a. Key generation: key generation should be prior before data encryption and decryption, as shown below.
3) Compute Euler's totient function: 4) Randomly select an integer to be the public encryption key () where 1 <  < Ø() and the greatest common divisor of , Ø() is 1. 5) Determine the private decryption key () as ( 2): 6) The public encryption key () includes the modulus  and the public exponent : 7) The private decryption key () includes the modulus  and the private exponent : b. RSA encryption: the process of converting plain text to cipher text is known as RSA encryption.The encryption procedure is described in the following steps:  The receiver must first share the sender's public key (, ) with the sender prior to actually sending data to the intended recipient. To generate the cipher text, the sender encrypts the data using (5):

𝐶 = 𝑚𝑒(𝑚𝑜𝑑 𝑛)
(5) c.RSA decryption: the process of attempting to recover the plain text using the private key (, ) is known as RSA decryption.

Hardware implementation
This work went through many enhancements.The first design used an Arduino microcontroller with long range wide area network (LoRaWAN) to transmit and receive data.In addition, the means of input was a keyboard, and a liquid crystal display (LCD) was used to display the output as shown in the following block diagram shown in Figure 1.
After that, a solar panel was added to power up the system in an eco-friendly way.In addition, the LoRa shield was utilized instead of LoRa R01 for additional features of stability and a more extended range.This stage of the design is shown in the following block diagram in Figure 2.
Finally, a GPS module was inserted into the system's features which finalizes the system demonstrated in Figure 3.The block diagram in Figure 4 represents the process implemented in secure emergency communication system (SECS) and all potential participants in such a system (sender/receiver, and intruder).The system can process both speech or voice messages inputted using a mic or a text message inputted using a keyboard.If the message was entered as a voice, a speech-to-text (STT) converter algorithm would be used to convert this message to text.Furthermore, with a GPS, the sender can share their location information with the plaintext of the sent message.The plaintext will be processed later in a microcontroller.Moreover, using an encryption algorithm, the plaintext will be encrypted to protect the confidentiality of any conversation from getting compromised during the transmission process.Data will get transmitted and received using LoRa module, which is mounted on the microcontroller using LoRa shield and is considered the main module in this system.Data transmitted and received are all cyphertext to avoid any eavesdropping from the unwelcome recipient.Any intruder who uses a module that has the same free-sending frequency will receive a meaningless ciphertext.In other words, only targeted LoRa that has compatible encryption and decryption algorithms will be able to retrieve ciphertext to plaintext.The receiver will have two output options, either to hear the message using a speaker after converting the received text to speech using text-to-speech (TTS) converter algorithm or to display the message using LCD.Arduino processor (ATmega 328P) will have all algorithms (such as TTS/STT, encryption/decryption) saved and run them when required to do so.Table 1 details the connection interface between LoRa and Arduino if LoRa shield was not utilized.Otherwise, if the LoRa shield was used, it is only required to mount it over Arduino pins such that all Arduino pins enter their corresponding socket in LoRa shield.In both systems, with or without LoRa shield, the outputs will be similar except that LoRa shield has a wider transmitting range since it utilizes a better antenna.In other words, Table 1 will not be required if LoRa shield was used.As in Table 2, VCC LCD's pin can be connected to any external 5 V power source to power up the I2C and LCD module.The liquid crystal display can transmit and receive data through an SDA pin using SCL to synchronize data traffic.Table 3 shows the connection of the GPS module with Arduino.
Any secure emergency communication system user's device will have the same circuit diagram as the one presented in Figure 5 regardless of the device's purpose (either to send or receive).Since the system is based on a LoRa transceiver, both the sender and receiver will have the same components, connections, and functionality.The system is composed Arduino microcontroller, LoRa module, antenna, LCD, and GPS.

Software implementation
By acknowledging all encryption techniques up to 2022, it could be recognized that the world is still suffering from relatively inefficient security transmission systems.Therefore, the need for a robust uncrackable encryption approach that meets the telecommunication era and protects the data is growing.Generally, the SECS is designed to provide a highly secure protection approach that encrypts data using a combination of symmetric and asymmetric techniques.Accordingly, the three main pillars that SECS adopts are substitution, AES, and transposition as illustrated in Figure 6.Without further due, let us expand the new approach: a.Initially, the three techniques will be ordered on a scale from 1 to 3 in each new cryptosystem.b.Hence the SECS depends on AES-128 bit, a private key of length 16-bytes should be created in advance.
Assuming the following private key: PEN DEFEATS SWORDS as shown in Figure 7. c.Then, the first 3 characters of the private key will be sorted in ascending order as shown in Figure 8.The selected three characters of the private key will play a role to sort the execution of the three layers depicted in Figure 9.The main idea is that this order will constantly change if the private key is changed to keep the security level.With this approach, the system will be hard enough in front of any hacking attempts as it offers a new mystery to decrypt each time a new key is generated.Depending on the chosen order of the cryptographic techniques in step 1, the implementation of each layer will be as follows: a. Assume the plaintext is: he was in the museum.The plaintext will be encrypted first using the transpositions layer, based on what had been explained in the transposition section, a 4 by 4 matrix will be created to organize the 16-byte plaintext.However, the SECS will get the benefit of this approach by making the matrix reading depend on the 1 st character in the key as follows: -If the key begins with a letter, the ciphertext will be read column by column.
-If the key begins with a number, the ciphertext will be read from right to left.
-If the key begins with a special character, the ciphertext will be read in a zigzag form.In this example, as shown in Figure 10, the private key begins with a letter, so the ciphertext generated from this layer will be: hshseieewnmuatum.Which equals the next cipher-text: >8#67&'47:3$'<*+.By returning the Binary result to its ASCII format, the ciphertext of this layer will be: 86&7 / $#=>".&1>d.Then, AES will be implemented in the previous substitutional text to produce the following ciphertext as shown in Figure 12.

RESULTS AND DISCUSSION
Several comprehensive experiments were meticulously conducted to assess and validate the prototype's efficacy, yielding highly promising and significant results as anticipated.In the initial experiment, the focus was on evaluating the transmission process, where diverse modules were rigorously tested under varying conditions.This examination encompassed an extensive range of scenarios, including different environmental factors, signal strengths, and data payloads, ensuring a thorough assessment of the prototype's transmission capabilities.
Building upon the insights gained from the first experiment, the second phase delved into an in-depth examination of the sophisticated security system incorporated into the selected module from the initial experimentation.This critical aspect of the prototype was subject to rigorous scrutiny, evaluating its ability to safeguard data from unauthorized access, potential cyber threats, and malicious intrusions.The robustness of the security system was put to the test, employing various encryption algorithms and authentication mechanisms to ascertain its resilience in real-world scenarios.
The successful outcomes of both experiments underscore the prototype's reliability and resilience, validating its potential as a viable solution for long-range, low-power wireless communication with enhanced data security.The results provide valuable insights into the prototype's performance and pave the way for further refinements and optimization to meet the specific requirements of diverse applications and industries.The significance of these findings extends beyond the scope of this research, as they contribute to the advancement of wireless communication technology, opening doors to a multitude of possibilities in modernizing and transforming connectivity solutions across various domains.a. Experiment one: measuring transceiver's tolerated distance.This experiment aims to assess the distance capabilities of different modules and identify the most suitable one to meet the specified requirements.The results, as presented in Table 4, showcase significant findings for each module that underwent testing.Notably, the LoRa shield and LoRa R01 modules exhibited exceptional performance in effectively transmitting and receiving data over long distances.In contrast, the NRF24-L01 and HC06 modules displayed considerably lower transmission rates compared to the other tested transceivers at the specified  4, it was determined that the LoRa shield module perfectly aligns with the objectives of our work.Consequently, the decision was made to eliminate all other modules and solely proceed with the implementation of the LoRa shield for the project.In this test, the LoRa shield was utilized to upload the security system described in the previous sections into Arduino.The experiment involved two parties: a sender and a receiver.The sender transmitted the message "Hello there!" to the recipient, as shown in Figure 13.The message was encrypted before being sent and could only be decrypted by the intended recipient.This process is similar to encapsulating the message, where the sender encapsulates the message and the receiver decapsulates it.An intruder attempted to decrypt the message, but the highly secure system prevented any unauthorized access.Results of experiment 2: i) intended recipient can decrypt the encrypted message and ii) the intruder receives a misleading message.The secure emergency communication system has the potential to revolutionize multiple fields beyond emergencies.Its ability to securely transmit any type of data over vast distances without requiring cellular or satellite coverage makes it an ideal solution.Moreover, it can be implemented at a low cost.Some possible applications of this system are as follows: a.It can be combined with civilian and military robots and drones to securely send and receive data and control signals over long distances.This combination can be used in several sectors, including the oil and gas sector, electricity companies, army, and education establishments, to improve communication systems.b.The system can be used to establish a communication network that does not rely on any type of coverage, such as cellular, satellite, or the internet.This can be used in various sectors, including the oil and gas sector, the army, emergency and distress situations, civilian applications, bank/university/private sectors, and for building notification systems.c.It can be used to build an efficient and secure health and care system over long distances, without requiring SIM cards or internet and radio frequency coverage to transfer data and information between health and care establishments.The system can also be combined with sensors to monitor patients and detect any sudden changes in their health.d.The system can detect accidents and send the location to the nearest emergency establishment immediately when an accident occurs, potentially saving lives.e.The system can be used to build an efficient IoT system.It can operate using low energy and can be used in wireless networks, satellite applications, and social media.

CONCLUSION
To summarize the contents of our research paper, various investigations were carried out on transceivers.the findings indicate that the LoRa shield module represents a breakthrough in communication networks, thanks to its exceptional capabilities that enable users to utilize the system efficiently and effectively.The primary objective of this research was to evaluate the transmission of data over the air and identify the best module to enhance the secure emergency communication system.The results of the first phase of the study were significant, with the LoRa shield module outperforming all other modules.The second part of the research involved exploring different cipher algorithms, with a new approach proposed that utilized AES, transposition, and substitution.The paper's primary focus was on the use of LoRa in a secure system, with its potential applications spanning various sectors, including the military, education, and beyond.These findings bode well for the future of communication networks, as they promise reduced costs and energy consumption, as well as a more sustainable environment facilitated by the use of solar panels.Future research should focus on refining the system further to meet the needs of the labor market, as well as developing a fully functional secured mobile phone.

Figure 1 .
Figure 1.Block diagram of the initial system design

Figure 2 .
Figure 2. Block diagram of the second design of the system

ISSN: 2302- 9285 Figure 3 .Figure 4 .
Figure 3. Block diagram of the high-level design of a two-way secure communication system

Figure 5 .
Figure 5. Schematic diagram of the circuit

Figure 9 .
Figure 9. Rearranging the order based on the private key Figure 10.Transposition implementation

Figure 11 .Figure 12 .
Figure 11.Performing logical XOR on the plaintext and the key

ISSN: 2302- 9285 
Implementing and developing multi-stage cryptography technique for low-cost … (Eyad M. Hamad) 273 distance.Based on a thorough evaluation of the data provided in Table

Table 4 .
Experiment one: measuring the distance for a different module two: security test.

Figure 13 .
Figure 13.The sender and receiver of the security system

Table 1 .
Interfacing LoRa module with Arduino

Table 3 .
Interfacing GPS module with Arduino