1 Introduction

The Internet of Things (IoT) generally denotes the technology in which all the objects and devices around us are connected to the Internet or intranet (local area network) and can send data to each other and communicate with each other [1, 2]. At the same time, they can be easily controlled by humans through special applications [3]. Without any assistance from a human being, they can have conversations with others and use online services [4, 5]. According to the performance of the Internet of Things, various applications can be defined in the fields of medicine, industry, smart city, etc., and due to the growth of applications, the use of IoT has also developed [6].

More and more gadgets and sensors are getting wired up to the Internet as the price of Internet access drops and broadband becomes more widely available [7, 8]. Due to the possibility of connecting different objects from anywhere in the world with the Internet, there are many security problems and complications around the Internet of Things [9,10,11]. Physical objects that are interconnected in a network have sophisticated processors and sensors placed in them, and each of them transmits sensitive data. The process of sharing such a large volume of data begins with the devices themselves, which must securely communicate with the Internet of Things platform [12]. The secure transfer of this volume of data must be guaranteed by the objects themselves that send or receive the information. In the Internet of Things, the application of conventional Internet, sensor network and mobile network will reach the highest level, because everything will be connected to the Internet [13]. Therefore, it is faced with an open environment for access to objects, which, of course, issues related to confidentiality, integrity of data and their accuracy will be one of the upcoming challenges for IoT, which will appear due to security and privacy [14, 15].

With the integration of manifold devices into the Internet of Things system, a higher level of vulnerability occurs that can breach the security of machine-to-machine (M2M) communication in the application environment [16, 17]. Thus, it is important to set up a safe transmission channel for IoT gadgets so that users' personal information and data remain safe and intact [18].

Several authentication, data encryption, hardware encryption, network segmentation, and location-based service solutions have been developed over the past few decades to address IoT security concerns [19]. But due to the availability of the IoT at any moment and anywhere in the world and its dynamic nature, the most important aspect of the security of the Internet of Things is to ensure the correctness and authentication of information [20, 21]. IoT device limitations in terms of power, storage, size, and bandwidth are the main constraint on IoT networks. Therefore, in the encryption problem, there is a need for light authentication and privacy protection approaches for the Internet of Things [22]. However, there are issues with lightweight encryption that have drawn study interest. The most significant obstacles that lie ahead in this field include, for instance, the complexity and operation time of encryption, as well as the assignment of a private encryption key and executive hardware model for the encryption scheme.

Information is concealed and stored privately using encryption to thwart intrusion by hackers and allow only authorized users to access it and safely share it. The use of encryption and authentication methods reduces security problems [23,24,25]. Cryptography, in practice, leads to the production of a message that changes the data of the message transmission by simple text encryption and decryption operations [26]. For both the encrypting and decrypting processes, symmetric key encryption uses the same key. With just one private key, massive amounts of data can be encrypted and processed in a short amount of time [27, 28].

There is no established procedure to safeguard information on the cloud from intrusion by hackers. The cloud encrypts user data to prevent cyber risks and make deciphering the ciphertext harder for attackers. By offering a lightweight encryption operation while preserving encryption complexity, the constraints of the cloud network may be fine-tuned; this operation, depending on the security level, will necessitate expensive hardware and incur large costs. Additionally, in the symmetric key problem, a longer key ensures the security of the ciphertext because it becomes impossible to decipher it. But the same issue makes hardware larger, which in turn increases building costs and energy consumption, and necessitates a relationship between hardware size and encryption security. The demand for lightweight design has grown as a result of the increase in software volume, which is another issue with this subject. Thus, one of the requirements of this research is to propose a lightweight encryption method with high complexity and minimal hardware volume.

In the current study, a new chaotic encryption method with the ability to implement in eight-bit style microcontrollers for image information is presented. In this approach, two completely random and chaotic mapping techniques with the ability to repeat according to the provided symmetric encryption key and the exclusive encryption key generation technique with the help of logical operator xor and shift register and fuzzy logic system are used for encryption operations. In this light encryption, a 32-bit long information encryption system and a 32-bit symmetric key are utilized so that it can be used for small hardware implementation. The idea of chaos mapping is based on a numerical model with the help of a multiplexer. In this circumstance, the numerical mapping in the hexadecimal base will be based on a completely random transfer of information with the appropriateness of the assigned password. Presenting the idea of multiplexer is to indicate the simplicity of chaotic model for hardware design. A Takagi–Sugeno-type fuzzy logic system has been used for the dedicated code generation section. Trapezoidal membership functions have been used to provide a fuzzy logic system in the microcontroller for light encryption. Ultimately, both modeling and simulation of hardware have been done and checked under 8-bit AVR microcontroller. The main achievements of the paper are given below:

  • Introducing a novel key generation technique to enhance IoT systems' authentication and encryption.

  • Introducing a new multiplexer-based chaotic mapping method.

  • Providing a lightweight cryptographic model for low-volume hardware implementation.

  • Chaotic private key generation with the help of Takagi–Sugeno-type fuzzy logic system in the shift register block.

  • Using different indicators to analyze the efficiency of the proposed lightweight encryption technique.

  • Evaluating the effectiveness of the suggested strategy in comparison to other cutting-edge ways.

The developments in the area of lightweight cryptography and its applications are then described in Sect. 2. Section 3 describes the basic concepts of this work. The structure of encryption techniques presented in shift, chaotic mapping from cryptographic images, and generation of private encryption key with the help of fuzzy logic and logic gates are described in Sect. 4. In addition, this chapter introduces the design of lightweight image encryption. The results of the proposed encryption system are described in Sect. 5 and the evaluation criteria are calculated and compared in Sect. 6. The conclusion of the article is presented in Sect. 7.

2 Related Work

Due to their open structure, size, and resource constraints, wireless sensor networks (WSNs) continue to face significant challenges in the areas of security, efficiency, and energy consumption [29]. Thus, researchers have developed protocols like 6LoWPAN and lightweight encryption algorithms like AES-GCM. The flexibility, security, authentication, and control over available power are still areas in which they fall short. FlexCrypt, an automatic lightweight encryption solution for WSNs, is designed to deal with these problems in reference [30]. A novel dynamic clustering mechanism is created in the FlexCrypt system to allow for movement between sensor nodes. Furthermore, the suggested method employs a flexible and lightweight encryption mechanism to automatically select parameters based on the resources available at each sensor node, hence controlling encryption complexity. However, the method is not very noise resistant. To ensure the safety of information transferred between nodes in a WSN, a novel authentication and management approach has been developed [31]. This system outperforms alternative ciphers with fixed encryption parameters in terms of delay, encryption time, energy consumption, and network longevity. But the problem of this work is the lack of compatibility with different data, which limits its use for the Internet of Things.

In [32], data privacy, high security, and efficiency in monitoring numerous biological signals in multi-user networks for cryptographic e-health applications are provided using chaos-based sequencing direct wide-spectrum technology and chaos-based cryptography. To begin, a chaotic Hénon mapping is used to change the spectral characteristics of each basic biosignal in a direct sequence. Once all biosignals have been modulated, the resulting cipher is a modulated sum. To further improve security, the modulated cipher's autocorrelation is reduced through encryption utilizing a global diffusion process with chaotic Hénon mapping. With its high efficiency and security, the suggested system is ideal for multi-biosignal monitoring and multi-user networks in e-health applications, but its design complexity makes it unsuitable for lightweight cryptographic uses. Paper [33] proposes an encryption algorithm for greyscale images using a pseudo-random number generator (PRNG), DNA coding, and pixel sum. The proposed approach is implemented on a Genesys 2 FPGA using minimal hardware resources and can operate at a maximum frequency of 110.8 MHz.The proposed scheme outperformed recent chaos-based image encryption schemes.But for color images, it has high complexity and increases power consumption.

Data encryption solves the latency and complexity issues posed by encryption, whereas ciphertext policy attribute-based encryption (CP-ABE) provides access control. Nevertheless, most IoT devices have restricted memory and processing power, making it challenging to use this ciphertext. Full security (adaptive security) is proposed to be implemented using a modified version of the CP-ABE system in the work [34]. In addition, the decryption overhead and ciphertext length are fixed. In the publication [35], the authors present a new method of encryption that combines symmetric encryption with the expression of encrypted data via features. The paper's objective is to safeguard user privacy by limiting access to specific data to approved services, while still allowing for increased scalability and productivity. One drawback of this approach is a drop in image quality after decoding.

For Internet of Things (IoT) devices with limited computing power, the paper [36] provides a post-quantum network-based authentication technique and a code-based hybrid encryption scheme. The authentication system known as ring-learning with errors (Ring-LWE) uses Bernstein reconstruction in polynomial multiplication to reduce the computing burden of the verification process. Hence, IoT devices with limited resources can use mutually trusted authentication. Using this method, users can conceal their whereabouts and identities completely. To further achieve lightweight encryption performance with minimal hardware requirements, the proposed post-quantum hybrid code-based encryption technique utilizes diagonal structure-based QC-LDPC codes with column ring optimization and simple log domain sum-product algorithm (SLDSPA). But they still suffer from hardware complications.

Using elliptic curve cryptography (ECC) with identity-based cryptography (IBC) for mutual authentication, a new identity-based authentication and key agreement technique (IBAKAS) is presented in paper [37]. Moreover, it combines the generation of private session keys with the use of untrusted channels. However, IBAKAS suffers from slowness and circuit complexity despite achieving all of the necessary security aspects of the key agreement and preventing CWSN-specific cyber assaults. To better secure IoT devices, the authors of [38] describe a new authentication and encryption approach that utilizes random integers generated by fuzzy logic and is based on elliptic curve cryptography (ECC). However, they will waste high consumption power.

In [39], it is looked into the process of doing a security analysis and assessing the effectiveness of a novel lightweight cryptographic method for better protecting data in the cloud computing. In this research, it examined the algorithm architecture of performance and security analysis in cloud computing, with a particular emphasis on computation time and key sensitivity, statistical analysis, picture histogram, and entropy change analysis. Image encryption is a common practice for protecting sensitive medical images from prying eyes, in addition to other measures used to fortify the security of communication and storage networks.But the image quality is not good. In [40], a lightweight encryption method is described for high security medical picture encryption using chaotic Hénon maps, Brownian motion, and the Chen chaotic system. Based on the obtained experimental results, it can be concluded that the suggested encryption system is a lightweight technique that may not meet the needed security level for image-based encryption of confidential patient information.

In [41], a lightweight fuzzy decision blockchain method using MQTT and Fibonacci is suggested, allowing for simple scaling and deployment of the blockchain server's scope. Secure blockchain-to-blockchain communication and transfer is also possible using MQTT. To increase safety, LF-BC is built using DH and the Fibonacci transformation, and the F-PBFT consensus process can drastically cut down on communication costs while simultaneously increasing fault tolerance. The complexity of this architecture prevents it from being used to develop a simple encryption algorithm. advanced encryption standard (AES), a chaotic map, a genetic operator, and a fuzzy inference system are all used in [42] to present a novel picture encryption approach. As an input, this work used rather straightforward photos to achieve the necessary level of confidentiality. The key's sensitivity was raised by employing the SHA-512 hash method. However, it has not been able to reduce the consumption power well.

Lightweight picture encryption using chaos theory is the subject of [43]. At first, an established framework and method are provided and empirically investigated; they are based on two chaotic mappings, such as Arnold and Logistic, for encoding light images. This method, which applies the chaotic combination technique to multiple images, is fast and has yielded positive results in terms of pixel distribution and correlation coefficients between neighboring pixels in the encoded image, but has been unable to increase the complexity of the encoding process. In [44], we see that the Chebyshev mapping used by the stream cipher theory to generate the secret key. Prior to the chaotic processing of a picture, a starting value is set using a sequence of encoding processes. The impact of chaos in light cryptography is very low. The linear propagation layer is a crucial component of hash and lightweight block ciphers. An effective class of lightweight 4 × 4 MDS matrix with equal implementation and inverse costs is presented in the publication [45]. The article's primary objective is fundamental hardware cryptography, and the cost of implementation is expressed in terms of the necessary quantity of XORs.This work has worked well from the point of view of hardware complexity, but the main problem is the high delay of encryption and decryption operations.

To reduce the weight of the 6LoWPAN stack, the authors of article [46] discuss replacing the current encryption technique, the advanced encryption standard (AES-128/256), with a new lightweight encryption architecture called NUCLEAR. With a smaller gate count than AES-128/256 and similar lightweight encryption schemes, the lightweight encryption concept is amenable to implementation as an IP core. In this paper, we present a generalized Feistel structure (GFS) that significantly reduces overhead in these three key areas: memory usage, energy consumption, and physical size [47]. The problem of these two methods is the high number of logical gates for lightweight cryptography. Table 1 reviews some articles for the applications of lightweight cryptography in the field of IoT.

Table 1 Comparison of lightweight encryption methods

By studying the works related to lightweight cryptography, we have seen various attempts to provide very low-power cryptography with low circuit complexity. At the same time, it has been tried to provide techniques to improve security in changing important information and creating a complex password. Considering chaos systems and providing a corresponding circuit model for cryptography, it will still require efforts to reduce its complexity at the level of circuit design. These conditions prompted this article to deal with an innovation of chaotic and random information transfer in hexadecimal basis with the help of a multiplexer-based modeling to completely random mapping corresponding to the defined encryption key. Moreover, different methods have been defined in the case studies in creating the password key, which has been very significant in this field. Therefore, to create the private password key and to prevent hackers from identifying the password key, a logic circuit model consisting of shift registers and logical xor operator has been used, which is improved with the help of a private password fuzzy logic system. The important point in this article will be to present a cryptographic model with optimal speed for generating the encryption key and encryption and decryption.

3 Basic Concepts

The foundational subjects used in this article will be introduced in this section. The topics that were researched include chaos mapping system, fuzzy set system, and lightweight cryptography, which we will go through in the next section.

3.1 Cryptographic Algorithms

Sensitive data may be sent and received via mobile devices and portable computers via e-mail, instant messaging, and other online digital communication methods. Encryption is required when a user’s personal device is lost or stolen, or when a message is intercepted by an unauthorized party [48]. Encryption software is provided with the aim of keeping this important information from being exposed by unwanted people. Encryption is the process of using a software algorithm and a numeric key to convert readable data into an encrypted form. The cipher text is created by transforming the information with the help of the cipher key. The cipher text contains all the data in the plaintext (the original information), but cannot be read by humans or computers until it is decrypted. Therefore, the process of converting cipher text into plain text is known as the concept of decryption, on the other hand, the keys of ciphers are algorithms that are used to encrypt and decrypt data [49, 50].

Various goals are pursued in cryptography in essential areas of security, including availability, authentication, access control, confidentiality, non-repudiation, and integrity, as shown in Fig. 1. With primary encryption, all these goals are achieved, but due to the allocation of too many resources in traditional encryption, the integrity and confidentiality of information are problematic. IoT devices have limitations in terms of computing power, power supply, and memory and battery life. Therefore, it is necessary to seek for the development of traditional cryptographic algorithms to lightweight cryptographic algorithms (LWC) for achieving these goals with the limitations of IoT [51].

Fig. 1
figure 1

The main objectives in the field of security [51]

Lightweight encryption is a form of encryption optimized for low-power, low-memory, low-computing systems that yet need security. Lightweight algorithms also have high speed; low implementations cost, and at the same time reduce the amount of information management due to the very low demand of resources and energy consumption [52, 53].

The weight of an algorithm is defined by an initial value, which is approximately equal to the amount of time and space resources required for its implementation, and most importantly, the amount of energy consumption in both software and hardware dimensions [54]. Time complexity in the software dimension refers to two concepts, first, algorithm speed (which is determined by the number of clock cycles required to process one byte of data) and second, delays. While the complexity of the space in the hardware dimension deals with the concept of memory (RAM), that is, the space required to store the algorithm and process information [55].

In Fig. 2, encryption is divided into two branches according to the types of devices.

Fig. 2
figure 2

Types of encryption based on devices

Lightweight algorithms do not have high bandwidth because they are supposed to handle small amounts of data. This is due to the limitations of 1000 GE (gate equivalent), which is a unit of measurement for digital electronic circuit manufacturing technology, and has independent complexity. For this reason, light ciphers were largely intended for hardware implementations rather than software.

Ultralight encryption algorithms: schematic patterns are considered for ultralight algorithms that include less gate equivalent (GE). These features can be summarized as follows:

  1. Efficiency is determined by counting clock cycles and analyzing how long it takes a program to complete its execution.

  2. The size of the used memory is obtained by measuring the RAM and ROM consumption.

  3. The level of security is obtained by measuring the levels of confusion and diffusion with resistance to multiple (linear or differential) attacks [56].

  4. The less these criteria defined by the gate equivalent are obtained, the more lightweight the algorithm will be.

3.2 Fuzzy Logic Technique

The broad category of techniques used to comprehend, represent, and analyze images, their segments, and features as fuzzy sets is known as fuzzy image processing. The two most crucial phases of fuzzy image processing, “represent” and “process,” are inherently problem and fuzzy-technique specific. Fuzzy image processing has three main stages: image fuzzification, modification of membership values, and, if needed, image defuzzification. Coding of image data (fuzzification) and decoding of the results are the processes in the fuzzification and defuzzification process (defuzzification). These actions enable the processing of photos using the fuzzy approach. Hence, encoding picture data (fuzzification) and decoding the results (defuzzification) are the most critical phases that allow us to manage the image with the methods presented in Fig. 3 [57].

Fig. 3
figure 3

Steps involved in fuzzy image processing [57]

The most useful aspect of fuzzy image processing is that it is visible during the intermediate stage, which is the alteration of membership values or what we might refer to as the intelligence phase because it distinguishes one method from another. As seen in Fig. 4, fuzzy logic is defined by a wide range of membership functions. The effectiveness of the procedure is boosted by using proper membership through fuzzy system inference. This method uses the membership function to group pixels into categories based on their proximity to one another [58, 59].

Fig. 4
figure 4

Types of fuzzy membership functions

An image that has to be handled by fuzzy logic technology must first be transformed into a membership function (fuzzification stage), which allows fuzzy logic to easily change the value of the function. The term “fuzzy clustering,” “fuzzy rule-based,” or “fuzzy integration” may be appropriate. Finding the uncertainty information requires the use of fuzzy image processing. One of the numerous benefits of using fuzzy logic in image processing is as follows:

  1. a.

    To represent and process an image, fuzziness approaches are the most commonly used tools.

  2. b.

    It gives us a mechanism to efficiently handle and manage obscurity.

  3. c.

    It is simple to comprehend the fuzzy logic notion.

  4. d.

    Fuzzy logic offers a great deal of versatility.

  5. e.

    Even if the data are unreliable, fuzzy logic still works.

Fuzzy logic's superiority can be linked to the fact that it is less precise than competing methods. Fuzzy set theory and fuzzy logic can provide the human logic based on if–then rule that is useful in a number of image processing applications for dealing with complications like object recognition and scene analysis. On the other hand, a variety of factors, including unpredictability, ambiguity, and vagueness, cause uncertainty in the data and results of image processing. Also, those uncertainties hinder the development of image processing, which creates numerous challenges [60,61,62].

3.2.1 Takagi–Sugeno Fuzzy Controller

A T–S fuzzy controller is described by a set of fuzzy “IF … THEN” rules. A generic T–S rule can be written as follows:

$$\text{Ri }:\text{ IF x}1\text{ is Ai}1\text{ AND x}2\text{ is Ai}2 \dots \text{ AND xr is Air },\text{ THEN yi }=\text{ fi}\left(\text{x}1,\text{ x}2, \dots ,\text{ xr}\right),\text{ i}=\text{1,2},\dots ,\text{nR},$$
(1)

where Ai1, Ai2,…, Air are fuzzy sets in the antecedent, while yi is a crisp function in the consequent. yi is usually a polynomial function of input variables. However, it can be any function as long as it can appropriately describe the output of the model within the fuzzy region specified by the antecedent of the rule. When yi is a first-order polynomial, as in this paper, the resulting fuzzy inference system is called a first-order Sugeno fuzzy model [63].

$$\text{yi }=\text{ ai}1\text{ x}1 +\text{ ai}2\text{ x}2 + \dots +\text{ air xr }+\text{ bi},\text{ i}=\text{1,2},\dots ,\text{nR},$$
(2)

where ai1, ai2,…, air and bi are parameters which should be identified. The consequents of the T–S controller are hyperplanes (r-dimensional linear subspaces) in ℜr+1, whereas the if-part of the rule partitions the input space and determines the validity of the nR locally linear model for different regions of the antecedent space. The weighted average formula (3) can be used to determine the total output of the T–S system, as each rule produces a crisp output.

$$y=\frac{\sum_{i=1}^{{n}_{R}}{y}_{i}.{w}_{i}}{\sum_{i=1}^{{n}_{R}}{w}_{i}} , {w}_{i}=\prod_{i=1}^{r}{\mu }_{{A}_{i}} \left({x}_{i}\right),$$
(3)

NR is equal to the number of rules.

A method to estimate the model's parameters (ai1, ai2,…, air, and bi) is needed to finish describing the T–S controller (2). The response surface methodology [64] is used in the next section to generate model parameter estimates.

3.3 Chaos Mapping System

A subfield of mathematics known as chaos theory studies the behavior of dynamic systems that are highly sensitive to their beginning conditions. According to the theory of chaos, which draws from many fields of study, even in the seeming disorder of chaotic complex systems, fundamental patterns, persistent feedback loops, repetition, self-similarity, fractals, and self-organization can be found. Chaos is “a state of utter confusion and chaos; complete lack of organization or order,” as stated in the definition. In contrast, chaos theory, which attempts to anticipate the behavior of “inherently unpredictable” systems, is an intriguing field of study. In reality, the mathematical tool of chaos theory can be used to create order out of disorder.

The main foundation of chaos theory is the idea that order and chaos are not always opposites. An intriguing synthesis of order and chaos is seen in chaotic systems. When viewed from the outside, these systems exhibit unpredictable behavior and disorder, yet when we look within, we find a set of deterministic equations that operate with order. A non-linear dynamic is frequently referred to as chaotic. This phrase is used to explain why supposedly straightforward, linear, and well-behaved systems exhibit complex behavior. Similar to the behavior of a system that has been significantly impacted by random external noise, chaotic activity frequently appears irregular and random. Systems that are incredibly simple and frequently noise-free experience chaos. In reality, these systems are basically “deterministic,” meaning that future behavior can be anticipated with precision from knowledge of the system’s beginning state. Chaos is typically characterized as a limited, irregular, and loud oscillation. In other words, even in the absence of random inputs, a deterministic system exhibits random behavior.

Chaos maps come in two flavors: continuous and discrete. These chaos mappings may be intricate or employ illogical real numbers. Any cryptographic algorithm’s primary component is random number generation [65]. Applications like digital signatures, hashing, encryption, seed vectors, one-time passwords (OTP), and others use pseudo-random number generators [66, 67]. The output of these deterministic pseudo-random number generators, which depend on the starting seed sequence and the generator’s architecture, is also determined [68]. As the output can be totally predicted if the initial value is known, these numbers cannot be considered really random. Hardware and software seed-based random number generators are the two primary categories of random number generators [69]. For cryptography applications, random number generators are utilized [70, 71]. Hardware random number generators produce numbers through physical mechanisms like thermal noise or other outside influences [72]. Up to four dimensions are possible for some chaos maps. Most chaotic maps described in the literature are three-dimensional. The principal points of perturbed maps can vary between 0 and 18 parameters. A polynomial c-type fractal map with three dimensions and 18 seed parameters is the most complex chaotic map that has been documented in the literature [73]. In this article, a discrete-type chaos mapping is used in hexadecimal basis. In this mapping, for the applicable modeling in the hardware, it is used to shift the numbers corresponding to the password based on a multiplexer system which will be explained in the next section.

4 Proposed Work

In recent years, the need to encrypt images to create a secure transmission of images on the Internet and wireless communication networks has increased more than ever. Encryption is one of the old and effective ways to solve these challenges. But the use of classical algorithms such as IDEA, AES and DES do not have the necessary efficiency in this field. To disturb the relationship between pixels in this data, chaos functions are used. Considering the characteristics of chaotic functions such as extreme sensitivity to initial values, random behavior, non-periodicity, certainty, etc., these functions are used to generate chaotic sequences. Chaos theory is a branch of mathematics and physics that is related to systems whose dynamics show very sensitive behavior against the change of initial values, so that their future behavior can no longer be predicted. In this section, a new chaotic mapping with the ability to implement light hardware is proposed to change the pixels of different images with a completely random mapping and only with a special key code in hexadecimal basis and achieve an encrypted image. Also, to increase the security complexity in addition to the chaotic mapping, a shift register technique has been proposed for binary shifting using a fuzzy logic system to determine the shift and generate a special code key for the shift register operation.

Step1: S1 = ChoaticFunction(R, L1).

S1 = S1 >  >  > K1.

Step2: S2 = change (S1).

S2 = ChoaticFunction (S2, L2).

S2 = S2 >  >  > K2.

S2 = Change (S2).

S2 = XOR (S2)

$$\text{Final }=\text{ XOR }((\text{S}2>>>+1),\text{ L})$$
(4)

Z1 = XOR(S-key, S-key >  >  > 3).

Z2 = XOR (Z1, Z1 <  <  < 3)

$$\text{S}-\text{key }=\text{ XOR }(\text{Z}2)$$
(5)
$$\text{K}1 =\text{ TSfuzzy}(\text{S}-\text{key}1,\text{S}-\text{key}2) ,\text{ K}2 =\text{ TSfuzzy}(\text{S}-\text{key}3,\text{S}-\text{key}4) ,\text{ L }=\text{ S}-\text{key}$$
(6)

The flowchart of the proposed scheme is shown in Fig. 5. This flowchart is divided into two parts: generating the secret password key and encrypting the style of each image pixel size. This work involves creating a hidden password and extracting the code of the binary shift information of the number of pixels using a fuzzy system. In information-style encryption, shift mapping with a rotational shift register, fuzzy logic, and xor operator are used to structure the composite information mapping of the image, which includes a multiplexer-based chaotic model. With this technique, changing the contents of the image pixels simply requires two steps: chaotic mapping and cascade shifting, followed by the xor operation. The size of the hardware program increases as the number of steps increases. As a result, these two steps meet the objectives of task complexity. For the password key generation part, shift register and xor logic structures were used, while a semantic model based on fuzzy logic was used to calculate the number of binary shifts of information. This section first explains and analyzes the proposed method of chaos mapping before introducing the fuzzy system technique for information change register activities. Finally, how to use xor logic gates and shift registers to generate a unique cryptographic key for a symmetric encryption key scramble will be covered.

Fig. 5
figure 5

Flowchart of suggested lightweight image encryption techniques:A Hybrid encryption process. B The process of producing private keys and fuzzy order

In this two-stage encryption, two key keys K1, K2 are used to rotate the shift register as shown in Fig. 5A. These changes are presented and designed with the aim of maximum complexity. However, password key generation is a significant innovation in this work. Figure 5B shows the private encryption key generation method using a chaotic combination of TS-type fuzzy logic and XOR. In this work, specific definition keys are extracted from the fuzzy system output. Relationships (4–6) have shown the approximate equations governing the cryptography of the proposed scheme. These relationships are stated in the proposed work with the aim of creating a mathematical model for lightweight cryptography. Equation 4 for performing binary shift with the number of K1, K2 code keys and 4-bit shift has been done according to Fig. 5A and it has modeled the steps mathematically. Equation 5 defines logical operations including XOR and shift register to generate the private key, which is fully traced and visible in Fig. 5B. Equation 6 is given for the defined keys of the Takagi Sugeno-type fuzzy logic system.

In these equations, each of the code key (L) and information (R) variables are stored in 32-bit registers. Each of these variables is divided into four eight-bit sections. Pkey represents the public password key and S-key represents the private password key. Other parameters are defined as interfaces between input and output variables.

4.1 Proposed Chaotic Model of İnformation Encryption

In this model, a 32-bit structure is used for encryption. As it can be seen in Fig. 5A, the cryptographic operation has been performed with the two stages of moving the chaos map in combination with the shift register operation and applying the xor operator. In the chaos mapping section, by modeling a multiplexer circuit with the Case command in the hardware coding of the microcontroller section and modeling in the MATLAB section, according to Table 2, the design of the proposed circuit has been carried out. It has been possible to produce entirely distinct data by displacement that is entirely random and arbitrary in accordance with the password table. In this design, a repeating loop is also used to create more complexity and confusion for each password key and higher orders. That is, by repeating the operation, we will get a newer mapping that is completely random. To clarify this work, the following example is used, which is checked for the password code 0 in the following data code with three steps of repetition:

figure a
Table 2 A proposed multiplexer-based chaos mapping

As it can be seen, a new encryption with the same key is created every time. We will use order 10 for iteration to avoid slowing down the hardware part. Therefore, both good complexity and chaos will be applied and processing speed will be maintained. In the same way, for all pixel information, the proposed chaos encryption is defined as 32 bits corresponding to the private encryption key produced in two steps according to Fig. 5A. Among these steps, the shift register operation with a special order is created according to the fuzzy model from the special password key. In other words, the applied code key shows two numbers (K1, K2) representing the shifting number order. In the next step, to improve the histogram of encrypted images, shift and XOR operations are used according to Fig. 5A, and in the last step, an XOR operator with a private key is used to increase the reliability of the cipher key. Attempts have been made to optimize the different cryptographic criteria to the desired value by applying these processes. Also, to determine the order of binary shifts in the current study, according to a fuzzy semantic model, the values of K1, K2 are determined and assigned in such a way that a dispersion of the cipher key is involved in cryptographic applications. The shift direction of each information byte is defined for these values between 1 and 7, which is ascertained using fuzzy logic to discover the values of the private password key.

4.2 Proposed Model of Password Key Generation

In Fig. 5b, the proposed model for generating a private password key is defined. In this proposed process, a 32-bit structure is defined, which by performing a series of registry shift operations and xor operator, slight changes in one bit of the public password key lead to fundamental changes in the private password key. Below are some examples of these changes:

figure b

To determine the fuzzy order in this research, a fuzzy logic system of Takagi–Sugeno type is used. Figure 6 shows the general view of the fuzzy system, which is used for trapezoidal membership functions so that the fuzzy model can be implemented for modeling under microcontroller coding. As it is clear from Fig. 6b, in this structure, the entire range 1–7 is covered by different inputs of the private password key. Table 3 introduces the defined fuzzy rules for determining the order of cryptographic shifts based on different private key values. According to Fig. 6, the membership functions of the input signals in the studied Takagi–Sugeno fuzzy logic system have used trapezoidal membership functions according to Eq. 7. The output of the fuzzy system is defined according to Eq. 3. The program code for defining membership functions is presented below (basecomAVR code):

$${\text{Trapezoidal}}({\text{x}}:{\text{a}},{\text{b}},{\text{c}},{\text{d}}) = \,\left\{ {\begin{array}{*{20}c} {0,} & {x < \,a;} \\ {\frac{{(x - a)}}{{(b - a)}},} & {a \le x \le b;} \\ {1,} & {b \le x \le c;} \\ {\frac{{(d - x)}}{{(d - c)}},} & {c \le x \le d;} \\ {0,} & {x \ge d.} \\ \end{array} } \right.$$
(7)

if X<A then

Fig. 6
figure 6figure 6

Fuzzy logic system representation to determine the number of binary shifts of information

Table 3 Fuzzy rules of binary shift determination system

Y =0;

end if

if X>=A && X<B then

Y =(X-A)/(B-A);

end if

if X>=B && X<C then

Y =1;

end if

if X>=C && X<D then

Y =(D-X)/(D-C);

end if

if X>=A && X<B then

Y =0;

end if.

Figure 6c indicates the performance of Takagi Sugeno’s fuzzy system. The basis for calculating the output is calculated based on the weights of each of the trapezoidal membership functions for different inputs. Then, the fuzzy rules for all outputs 1–7 are calculated and given values based on the defined weights. Lastly, the output value is calculated from the calculation of the center of gravity of the different outputs according to Fig. 6c. The basis for determining the fuzzy rules for this work will be to augment the resistance of the password against possible changes and attacks.

5 Results and Discussion

Algorithm simulation for performing standard tests including original image, entropy image and histogram has been done on Intel Core I5-M480@2.67 GHz processor using MATLAB 2017b. To evaluate the performance in the simulation environment under Proteus software, the algorithm has also been implemented on the AVR microcontroller based on ATmega 32. The memory usage time and the execution time of the proposed algorithm are observed. The execution time is 4.73 s and 4.65 s for encoding and decoding respectively, the proposed algorithm uses 16 bytes of memory on ATmega 32 platform. As shown in Table 3, the proposed algorithm is compared with other algorithms implemented on hardware.

The size of a block or a key is measured in bits, while the size of a program or a memory location is measured in bytes. Key expansions and encrypting and decrypting occur in cycles (Table 4).

Table 4 Results for hardware implementation

According to the findings in Fig. 7, an image can only be accurately decoded if the right key is used; otherwise, the image is unrecognizably altered. The incorrect key is only one bit different from the original key, which is used to demonstrate the avalanche test visually. This result can be used to determine the algorithm's strength. We have chosen five well-known 8-bit grayscale photos for the entropy and histogram tests. Also, the uniform distribution of intensities following encryption is an indicator of strong security in the histogram results in Fig. 8 for the original and encrypted image. An 8-bit grayscale image can achieve maximum entropy of 8 bits. From the results in Table 5, it can be seen that the entropy of all encrypted images is close to the maximum, which shows a feature of the algorithm.

Fig. 7
figure 7

Image decoding and key sensitivity

Fig. 8
figure 8

Histogram comparison

Table 5 Results for correlation and entropy

Finally, the correlation comparison in Fig. 9 shows the contrast between the original and encrypted data. The original data, which in the case of this paper is an image, can be seen to be highly correlated and maintain a high value for the correlation coefficient while the encrypted image does not seem to have anything to do with each other.

Fig. 9
figure 9

Correlation comparison

6 Performance Analysis

Some common benchmarks for gauging the robustness of cryptographic systems' statistics and security measures are used to assess the effectiveness of the proposed scheme. In the following, these criteria are defined and reviewed.

6.1 Histogram Analysis

A histogram can be used to visualize any recurring numerical values in a picture. An image's histogram should not contain any abrupt peaks and should instead have a smooth distribution. More encryption security and efficiency are indicated by the histogram's uniform distribution of an encrypted image. Figure 8 shows the histogram view of four encrypted images with the proposed technique.

6.2 Correlation Analysis of Adjacent Pixels

The correlation between adjacent pixels is a crucial indicator of a ciphertext image's chaotic characteristics. This study examined 3250 randomly adjacent horizontal and vertical pixel pairs from an image that had both plaintext and ciphertext versions. The correlation can be determined mathematically in the manner shown below:

$${r}_{xy}=\frac{E(\left(x-E\left(x\right)\right)\left(y-E\left(y\right)\right))}{\sqrt{D\left(x\right)D(y)}},$$
(8)
$$E(x)=\frac{1}{N}\sum_{i=1}^{N}{x}_{i,}$$
$$D\left(x\right)=\frac{1}{N}\sum_{i=1}^{N}({x}_{i}-{E(x))}^{2},$$

where E(x) is the expected mean value and x and y are the grayscale values of adjacent pixels. The correlation coefficient can take on values between –1 and 1, with 1 denoting perfect correspondence between two pictures or pixels. For maximal uncorrelated pixels, or extremely random values, it is important to attain a value near to 0. The visual results presented in Fig. 9 reflect the correlation of the studied images in gray scale, in which the pixels are directly connected and can be cleaned and displayed in exchange for their encrypted images which are distributed in all the points of the image.

6.3 Analysis of Homogeneity, Energy, and Contrast

Homogeneous analysis can be used to determine the closeness of GLCM elements in this system. GLCM tables are used to represent the statistical mixtures of pixel brightness or gray levels. If the homogeneity values are low, then the encryption method is effective. This can be worked out mathematically as:

$$H=\sum_{x,y=1}^{M}\frac{g(x,y)}{1+|x-y|},$$
(9)

where GLCM gray-level concurrency matrices are denoted by g(x,y). The ability to discern one object from another in an image relies on the contrast between those objects, which is the difference in brightness or color. Using contrast analysis, one may determine the overall difference in brightness between neighboring pixels. The contrast values, which represent the degree of randomness of the ciphertext image, should be higher to boost security. Contrast can be expressed mathematically as follows:

$$\text{Contrast}=\sum_{i,j=1}^{M}{\left|x-y\right|}^{2}p\left(x,y\right),$$
(10)

where p(x, y) represents the gray-level co-occurrence matrices in GLCM.

Another metric that can be estimated using GLCM is energy. The energy analysis in this instance calculates square elements. The following is the mathematical formula for calculating energy:

$$\text{Energy}=p{({\varvec{x}},{\varvec{y}})}^{2},$$
(11)

where p(x, y) denotes the simultaneous gray-level matrices. Table 6 compares the pepper image for the above three parameters with two references [55 and 56]. Regarding the delay of this encryption method, it has a very good speed due to the two-stage lightweight encryption which is done at the limit of logical gates and includes a parallel processing for the key generation and encryption.

Table 6 Available results from homogeneous, energy, and contrast analysis

6.4 Analysis of Differential Attacks

Immunity against differential attacks is also one of the critical features of an encryption algorithm. Unified average changing intensity and number of pixels changing rate are two tests that can identify resistance to differential attacks. The specifics of each of the aforementioned tests, which were conducted on two encrypted images with a one-pixel difference between the corresponding plaintext images, are explained below.

6.4.1 Number of Pixels Changing Rate (NPCR)

A MINUTE pixel difference between two plaintext images allows the NPCR test to identify the number of changing pixels. The mathematical formula of NPCR is given below:

$$\text{NPCR}=\frac{{\sum }_{i,j}D(i,j)}{M\times N}\times 100\%.$$
(12)

If the value of two ciphertext images is the same, D(i, j) = 0, while in the opposite case, D(i, j) = 1. The upper limit of NCPR is 100%, but for a good encryption system, the NCPR value should be higher than 99.5%.

6.4.2 Unified Average Changing Intensity

The UACI test can be used to determine the average intensity of a change between two images (one plaintext and one ciphertext) when there is a pixel difference between them. The UACI equation is as follows:

$$\text{UACI}=\frac{1}{M\times N}\left[\sum_{i,j}\frac{|{C}_{1}\left(i,j\right)-{C}_{2}\left(i,j\right)|}{255}\right]\times 100\%.$$
(13)

The encrypted images C1 (i, j) and C2 (i, j) have plain text images that differ from one another by a single pixel. Table 6 provides the figures for NCPR and UACI. Table 7 shows that the proposed cryptographic scheme offers significantly higher security than both contemporary and classic cryptographic systems when their values are compared.

Table 7 Comparison of NPCR and UACI values

6.5 Pixel İnconsistency Analysis

6.5.1 Mean Square Error

The avalanche effect can be studied using the mean squared error (MSE), a measurement of the mean squared error between two pictures. This security method requires a substantial modification to the encrypted image whenever a slight change is made to the plaintext image or key. The mathematical expression of MSE is as follows:

$$\text{MSE}=\frac{1}{W\times H}\sum_{i=1}^{W}\sum_{j=1}^{n}{(X\left(i,j\right)-Y\left(i,j\right))}^{2},$$
(14)

where W and H stand for the image’s dimensions and X and Y are a collection of encrypted images, each with a key that varies by just one bit. Any robust encryption system should have a high measured value of MSE. On all three of the analyzed photos, the MSE test is used. Table 7 demonstrates that the suggested approach is very safe, even when compared to the most cutting-edge cryptographic systems, due to the higher value it obtained.

6.5.2 Peak Signal-to-Noise Ratio (PSNR)

It compares the original image to its encrypted version and calculates the ratio of the two sets of pixel values. For the purpose of computing PSNR, the plain text picture is used as the signal and the encoded image as the noise. The formula for determining PSNR is as follows:

$$\text{PSNR}=10\times {\text{log}}_{10}\left(\frac{255\times 255}{\text{MSE}}\right),$$
(15)

where MSE is the mean square error value. An encryption algorithm benefits from a lower PSNR since it shows that the original plaintext image and its encrypted version differ significantly from one another. The PSNR test was run on each of the three photos in this study. The average of these results showed that according to Table 8, it is better than the values obtained by [58] and it shows that the designed encryption system is significantly better than the existing encryption systems.

Table 8 Comparison of average values of MSE and PSNR

Finally, Table 9 compares the amount of encryption time for the three studied images with a reference that has been simulated with MATLAB software, which shows that this work is very fast.

Table 9 Analysis of the execution time of the proposed algorithm and comparison with the reference [25]

7 Conclusion

In the not-too-distant future, the Internet of Things (IoT) will play an ever-increasing role in our everyday lives. Lightweight security is essential for the communication of sensors and other IoT equipment because their constant contact with the outside world makes them vulnerable to external attacks and threats. Using a proprietary password key generated by a fuzzy logic system and a novel chaotic mapping, this research suggests a lightweight security technique for this purpose. The technique is a good fit for usage in Internet of Things applications because microcontroller implementation and simulation of the suggested model produce encouraging results. Additionally, the outcomes of this work for a number of comparable image situations are examined and compared for histogram analysis, adjacent pixel correlation analysis, contrast analysis, homogeneity analysis, energy analysis, NPCR and UACI values, MSE, and PSNR in several articles. The results indicate that the suggested method has straightforward and useful two-stage encryption hardware in sensors and equipment, while also establishing a good level of complexity for generating the private password key and encrypting the pixel values of nice photos. In the future, we intend to combine a lightweight encryption approach proposed in this work with a compression method. Additionally, in the near future, a thorough examination and performance evaluation of this algorithm's code across a range of hardware and software platforms as well as its resilience to attacks are planned.