Introduction

Multimedia is an interactive kind of media that offers users several options for effectively representing information. It serves as a communication tool. A combination of text, audio, video, and animation is used in multimedia to deliver information in an engaging and dynamic way. Multimedia data is vulnerable to cyber-attacks and might leak private information if it falls into the wrong hands. Transmitting information by hiding away from the attackers requires confidentiality. Text data must be encrypted and subject to extreme security measures. Multimedia is used in different applications such as Educational [1] which results in effects on learning outcomes, cognitive burden, and positive emotions in students, and other areas where multimedia is used are telecommunications, cloud, IoT, healthcare etc.

The Internet of Things (IoT) is a network of physical "things" that can communicate with other electronic equipment and computer systems over the internet and share data among themselves. They have software, sensors, and other technology incorporated in them. These devices might be straightforward household objects or highly advanced industrial machinery. Sensors are used in IoT data collecting to track the operation of connected devices. The sensors gather and transmit real-time data that is saved and accessed at any time in order to monitor the state of the IoT network. In some cases, the data collected by these devices are compressed [2]. The collected data is stored cloud. Today, cloud computing, where a big and huge number of distributed computers and parallel computers which are connected, and is one of the standards for storing multimedia content. In order to provide several services, including a server, area, network components, pay-per-use, and numerous more things, a variety of technologies including utility computing, and distributed processing, are integrated. Reduced storage costs, grid computing technologies, power efficiency, service-oriented software, and administration of vast facilities are the main factors that increase the efficiency of cloud computing. Three categories make up cloud computing [3].

In a private cloud, which is implemented for a single organisation or by an external third party and has very advanced security fault tolerance solutions, the infrastructure and service are offered locally, whereas in a public cloud, the infrastructure and service are offered remotely over the internet and allow customers to access storage services and applications. whereas hybrid cloud services combine both public and private cloud services from different providers. In a cloud environment, there are three major types of entities: Data Owner, Cloud Service Provider, and User. The Cloud Service Provider's cloud services are utilised by the Data Owners and users. On this server, many Data Owners store their confidential multimedia assets, which users may access via the cloud. One of the challenges of most concern is controlling multimedia assets in the cloud environment because of the abundance of attackers and bad users. Because it is the central authority responsible for all functions performed by a cloud server, the cloud service provider should offer a robust security method for the user's sensitive or confidential multimedia data [4].

Recently, many academics have offered a variety of plans to strengthen the security of multiple files and to enhance the functionality of the cloud environment. Some of the existing systems are hybrid-based approaches where encryption and decryption are based on different approaches [5], some of them are client-side approaches where the security is performed only on client side [6], and many approaches such as using artificial intelligence [7]. As they are useful to some extent, but security need to provide even to the data which is generated by IoT devices which need to be stored. The IoT gather required data and perform very limited computational calculations, Due to their limited processing and storage capacity, small IoT devices can only handle light protocols. There should be a single standard that is both robust enough to safeguard and lightweight enough to enable light processing devices [8]. So, a lightweight algorithm is needed to perform encryption where the encrypted data is needed to store in cloud which results in confidentiality and improves security.

Problem statement and motivation

The difficulty of encryption in cloud based IoT devices depends on a variety of factors, including the resources available on the device, the complexity of the encryption algorithm, and the security requirements of the application, authentication among the edge computing devices. Few challenges in IoT devices is that they often have limited resources, such as processing power, memory, and battery life, which can make it difficult to implement complex encryption algorithms. As a result, encryption in small IoT devices [9,10,11] is made possible through the use of lightweight cryptography techniques, which are designed specifically to be computationally efficient and require relatively low power and memory usage. One common approach is to use symmetric key encryption algorithm with shorter key size and less computational overhead. Overall, while there are some limitations to encryption in small IoT devices, such as limited processing power and memory, the use of lightweight encryption can help to enable secure communication and data protection in these devices. A light weight encryption algorithm is proposed to encrypt the multimedia data over data generated by IoT devices [12]. It has very less system requirements to perform the encryption. As it is a symmetric cryptosytem the same key is used even for decryption. The main advantage of using this the lengths of plain text and cipher texts are variable, which can be more difficult to break the logic of the algorithm and also robust against different attacks and improving the security in small peripheral IoT devices.

Work contributions

  • Analyze the existed encoding schemes and identify the limitations.

  • Designed and development of a lightweight encryption technique using homomarphic operations such as transformations, shift, etc.

  • Performed differential cryptanalysis and extensive cryptanalysis which show the testing of avalanche effect property. And it shows how the proposed cipher can resist various security attacks.

  • Testing of proposed cipher against existed encryption techniques considering various factors.

Outline of the paper

The remaining sections of the essay are organized as follows: Related works make up “Related works” section. The proposed methodology and modules are presented in “Proposed system” section, a case study to help readers understand the proposed system is presented in “Case study” section, and “Crypt analysis” section is devoted to crypt analysis. Security analysis and discussions are presented in "Performance Analysis" section, and the conclusion and future work are presented in "Conclusion" section.

Related works

Martin Johns et al. [13] proposed a concept of Crypto Membranes, which are a collection of native client-side components that enable the creation of web apps and act as a reliable separation barrier between client and server. Client-side encrypted user data and potentially unreliable third parties. While retaining complete compatibility with existing practices for client-side development. Additionally, to facilitate a realistic he demonstrates how Crypto Membranes may be implemented for currently available web browsers using a regular browser during the transition period extension.

According to Jing Yao et al. [14] delivered an organized overview of the most recent developments in attacks for effective encrypted cloud data search supported by SSE or OPE/ORE. To be more precise, they have classified the opponent model according to a variety of dimensions. Then, under various adversary types, they carefully reviewed the current attacks against SSE and OPE/ORE as well as the leakages permitted by security frameworks.

Eduardo B. Fernandez et al. [15] proposed a pattern that characterizes their design and highlights the vulnerabilities it faces as well as the related counter measures. In order to counteract threats to IoT systems and simplify security management, the pattern provides security protection for data assets and communication routes. The defenses consist of firewall/Intrusion Detection System, security logger/auditor, secure channel, authentication, and permission (IDS). This is a contribution to a collection of patterns that their team is developing with a security focus on IoT ecosystems.

Shruthi Ramesh et al. [16] proposed a system known as Proxy re-ciphering as a service. They combine techniques like FHE, secret sharing, distributed servers, and chameleon hash functions to build a solution that enables strong and long-term privacy-preserving computations for data that is encrypted and is secure even after a device-key compromise. By creating a testbed and monitoring the latencies using actual electrocardiogram recordings from the TELE ECG database, they were able to assess the framework.

According to Ms. P. Kanchanadevi et al. [17] It is essential to protect data using an encryption strategy in a hybrid cloud. Numerous encryption techniques are available to us, but they also raise data security concerns. These issues have been addressed by the attribute-based encryption scheme with Dynamic Attributes Supporting (ABE-DAS). The security of the data in a hybrid cloud is improved by an attribute-based encryption scheme that uses a supporting dynamic attribute approach. With an attribute strategy, the ABE-DAS encryption method operates on both structured and unstructured data. With the use of both dynamic and static properties, it takes plain text and creates a cipher text.

According to K. Naregal et al. [18] cloud computing and IoT devices which using cloud have been increased drastically, which results for ease, efficient and secure access of data. So It has been determined that the cloud-based Internet of Things (IoT) requires a lightweight attribute-based encryption (ABE) approach.

Zeesha Mishra et al. [19] designed and developed communication protection that can be satisfied by simple algorithms. Implementing optimal lightweight ciphers and modelling their design characteristics are the goals. To implement the cipher in hardware from which various metrics may be monitored, design must be simulated. To achieve the stated goal, TEA, XTEA, and XXTEA ciphers were employed. These ciphers were modelled, implemented, and optimized on a platform using field FPGA and ASIC technology. Numerous aspects, including block sizes, rounds of implementation, and crucial scheduling factors, have been considered.

Dina Ibrahim et al. [20] developed a new method for encrypting RGB pictures that uses chaotic systems, 16 rounds of DNA encoding, transpositions, and replacements to encrypt individual RGB image pixels. A logistic chaotic function is used to create random round keys. A nonlinear randomly generated 16 × 16. DNA Playfair matrix is employed with these keys over several rounds to change specific pixels. The suggested approach is resistant against the majority of assaults, according to experimental results, and takes less time to encrypt and decode data. The numerical measurements demonstrate the suggested method's capacity to preserve reference evaluation values while fending against statistical and differential assaults.

According to Feifei Yang et al. [21] In order to secure an image, techniques for image compression and encryption based on BP neural networks and fractional-order memristive hyperchaotic systems are provided. This method compresses the image's pixel values using the BP neural network before dispersing them using the fractional-order memristive hyperchaotic system. The outcomes of the experimental simulation show that the suggested approach has stronger security characteristics in addition to being able to properly compress and encrypt images. The suggested algorithm's key space is more than 2^697, demonstrating that it has a bigger key space and can successfully fend against brute force assaults.

Tatsuya Chuman et al. [22] proposed a block scrambling-based encryption method with a bigger number of blocks and a smaller block size. Even though the original image had three colour channels, images encrypted using the suggested approach require less color information since grayscale images are used instead, which strengthens the system. In terms of block size and block count, this method has more features than traditional encryption. The suggested approach also produces grayscale pictures that are encrypted. These characteristics increase resistance to attacks by brute force and jigsaw puzzle solvers as well as invisibility.

According to Chen Qiuqiong et al. [23] they proposed a novel cryptographic approach based on a chaotic system and DNA coding has been created to address the issue of the low complexity and security of digital picture encryption algorithms. The random matrix and plain-text pictures are subjected to basic operations and DNA coding. A suggested cipher-text feedback technique will improve the diffusion effect. Additionally, the plain-text determines the algorithm’s key, enabling one-time encryption.

Belqassim Bouteghrine et al. [24] proposed a straightforward and quick chaos-based approach for the encryption of multimedia data, especially for the encryption of color images. A derived discrete temporal map in four dimensions is the foundation of the novel technique. Seven nonlinear terms and four controllers are used in the proposed 4-D chaotic system to create a stable chaos that can meet the encryption criteria. The performance of this technique was analyzed by few major factors. Those important factor that are considered are space of key, running time and complexity, correlation. Results are very effective and are also compared with other efficient algorithms and the proposed one gave good results.

Table 1 represents the different works related encryption were considered and the different parameters such as Feistal, cipher type, key type, crypt analysis, number of rounds were observed and studied carefully.

Table 1 Summary of literature survey

Proposed system

A symmetric cryptosystem is one in which the encryption key e is always equal to the decryption key. There are five components of symmetric encryption. The original data or message that is provided to the algorithm as input is in plain text. The plain text is subjected to a number of replacements and changes by the encryption method. The algorithm is given a secret key as input. The secret key determines which precise rotations and transformations the programme makes. The message that is jumbled and output is known as cipher text. It relies on the plain text and secret key. The counterpart of the encryption algorithm is the decryption algorithm. By using the cipher text and the Key, it creates the plain text. An encryption technique based on Matrix rotations of Binary converted ASCII values of each character in plain text. Figure 1 shows the flow of proposed encryption.

Fig. 1
figure 1

Proposed methodology

The rotations logic is that how the formed matrix is changed according to the conditions of the key. Detail explanation of this can be shown using the following flowchart Fig. 2.

Fig. 2
figure 2

Internal process of the proposed approach

Encryption process

Read Secret Message or Plain Text(P). A Randomly Generated Key(K) of size 4. Convert each character in the Plain Text into its corresponding ASCII value and the corresponding to Binary form is generated. If the length of binary number is less than 8 pad with 0’s and make it of length 8. Now make the converted binary of each characters into a matrix ‘M’. Now the rotations phase begins which is dependent on the key. If 1st digit in key is 'EVEN' perform Rotate Shift Up operation (RSU) or if it is ‘ODD’ perform Rotate Shift Down operation (RSD) on ‘M’ as many times as the 2nd digit in key. Store the resultant matrix in 'M1'. And now if 3rd digit in key is 'EVEN' perform Rotate Shift Left operation (RSU) or if it is ‘ODD’ perform Rotate Shift Right operation (RSD) on ‘M1’ as many times as the 4th digit in key. Store the resultant matrix in 'M2'. Transpose the 'M2' matrix and store it in 'MT'. Now flatten the matrix 'MT' i.e. convert the 2D matrix into a single linear array 'T' by reading row wise. Now continuously count the similar bits in 'T' until the different bit is found, when found write the count followed by the bit that occurred previously followed by a '#'. Now repeat the same process till the end of 'T'.

Decryption process

At receiver side the cipher text is decrypted using Decryption. As it was a symmetric cipher model we use the same key even for decryption. The process begins by splitting the cipher text ‘C’ using separator i.e. ‘#’ into ‘t’. For every element in ‘t’ read value except the last digit and store the value penultimate times the ultimate value into ‘T’. Continuously read ‘q’ binary digits from T and make it as a row in the matrix 'MT’ here value of ‘q’ is the length of ‘T’/8. Transpose the matrix 'MT', then store it to 'M2'. If 1st digit in key is 'ODD' perform Rotate Shift Up operation (RSU) or if it is ‘EVEN’ performed Rotate Shift Down operation (RSD) on 'M2' as many times as the 2nd digit in key. Store the resultant matrix in 'M1'. And now if 3rd digit in key is 'ODD' perform Rotate Shift Left operation (RSU) or if it is ‘EVEN’ performing Rotate Shift Right operation (RSD) on ‘M1’ as many times as the 4th digit in key. Store the resultant matrix in 'M'. Flatten the matrix ‘M’ and store it in the Text ‘T’. Consider 8 bits at a time and convert into equivalent decimal, for every decimal find the character of corresponding ASCII value and store it in ‘P’ until the end of ‘T’.

Case study

Input Plain Text—Qwerty@123.

Key—0213.

Encryption process

Step 1: Convert each character in the Plain Text into its corresponding ASCII value and the corresponding to Binary form is generated. If the length of binary number is less than 8 pad with 0’s and make it of length 8. In Table 2, every character’s ASCII value and corresponding binary form of it with length of 8 is filled.

Table 2 Binary form generation

Step 2: Now make the converted binary of each characters into a matrix ‘M’.

$$\left[ {\begin{array}{*{20}c} 0 & 1 & 0 & 1 & 0 & 0 & 0 & 1 \\ 0 & 1 & 1 & 1 & 0 & 1 & 1 & 1 \\ 0 & 1 & 1 & 0 & 0 & 1 & 0 & 1 \\ 0 & 1 & 1 & 1 & 0 & 0 & 1 & 0 \\ 0 & 1 & 1 & 1 & 0 & 1 & 0 & 0 \\ 0 & 1 & 1 & 1 & 1 & 0 & 0 & 1 \\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 1 & 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 1 & 0 & 0 & 1 & 0 \\ 0 & 0 & 1 & 1 & 0 & 0 & 1 & 1 \\ \end{array} } \right]_{10x8}$$

Step 3: As 1st digit in key is ‘Even’, we have to Rotate Shift Up the matrix as many times as the 2nd digit i.e. 2 times.

$$\left[ {\begin{array}{*{20}c} {0} & {1} & {1} & {0} & {0} & {1} & {0} & {1} \\ {0} & {1} & {1} & {1} & {0} & {0} & {1} & {0} \\ {0} & {1} & {1} & {1} & {0} & {1} & {0} & {0} \\ {0} & {1} & {1} & {1} & {1} & {0} & {0} & {1} \\ {0} & {1} & {0} & {0} & {0} & {0} & {0} & {0} \\ {0} & {0} & {1} & {1} & {0} & {0} & {0} & {1} \\ {0} & {0} & {1} & {1} & {0} & {0} & {1} & {0} \\ {0} & {0} & {1} & {1} & {0} & {0} & {1} & {1} \\ {0} & {1} & {0} & {1} & {0} & {0} & {0} & {1} \\ {0} & {1} & {1} & {1} & {0} & {1} & {1} & {1} \\ \end{array} } \right]_{10x8}$$

Step 4—As 3rd digit in key is ‘Odd’, we have to perform Rotate Shift Right the matrix as many a times as the 4th digit in key i.e., 3 times.

$$\left[ {\begin{array}{*{20}c} 1 & 0 & 1 & 0 & 1 & 1 & 0 & 0 \\ 0 & 1 & 0 & 0 & 1 & 1 & 1 & 0 \\ 1 & 0 & 0 & 0 & 1 & 1 & 1 & 0 \\ 0 & 0 & 1 & 0 & 1 & 1 & 1 & 1 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 1 & 1 & 0 \\ 0 & 1 & 0 & 0 & 0 & 1 & 1 & 0 \\ 0 & 1 & 1 & 0 & 0 & 1 & 1 & 0 \\ 0 & 0 & 1 & 0 & 1 & 0 & 1 & 0 \\ 1 & 1 & 1 & 0 & 1 & 1 & 1 & 0 \\ \end{array} } \right]_{10x8}$$

Step 5—Transpose the converted matrix

$$\left[ {\begin{array}{*{20}c} 1 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ 0 & 1 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 1 \\ 1 & 0 & 0 & 1 & 0 & 1 & 0 & 1 & 1 & 1 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 1 & 1 & 1 & 1 & 1 & 0 & 0 & 0 & 1 & 1 \\ 1 & 1 & 1 & 1 & 0 & 1 & 1 & 1 & 0 & 1 \\ 0 & 1 & 1 & 1 & 0 & 1 & 1 & 1 & 1 & 1 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ \end{array} } \right]_{8x10}$$

Step 6—Flattening the Matrix (Rearrange the Resultant 2D matrix into a single linear array).

T ← 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 1 1 0 1 1 0 0 1 0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1 1 0 1 1 1 0 1 0 1 1 1 0 1 1 1 1 1 0 0 0 1 0 0 0 0 0 0.

Step 7—Continuously count the similar bits until the different bit is found, when found write the count followed by the bit that occurred previously followed by a “#”. Now repeat the same process till the end.

Cipher Text:

11#10#11#60#11#10#11#40#21#10#21#20#11#10#11#10#31#100#51#30#61#10#31#10#11#10#31#10#51#30#11#60

Decryption process

Cipher Text:

11#10#11#60#11#100#11#40#21#10#21#20#11#10#11#10#31#100#51#30#61#10#31#10#11#10#31#10#51#30#11#60

Step 1—First split the cipher text ‘C’ using separator i.e. ‘#’ into ‘t’. This process should be continued until the end of the cipher text.

T \(\leftarrow\) 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 1 1 0 1 1 0 0 1 0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1 1 0 1 1 1 0 1 0 1 1 1 0 1 1 1 1 1 0 0 0 1 0 0 0 0 0 0.

Step 2: Continuously read ‘q’ binary digits from T and make it as a row in the matrix 'MT’ here value of ‘q’ is the length of T/8. For every element in ‘t’ read value except the last digit and store the value penultimate times the ultimate value into ‘T’.

$$\left[ {\begin{array}{*{20}c} 1 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ 0 & 1 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 1 \\ 1 & 0 & 0 & 1 & 0 & 1 & 0 & 1 & 1 & 1 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 1 & 1 & 1 & 1 & 1 & 0 & 0 & 0 & 1 & 1 \\ 1 & 1 & 1 & 1 & 0 & 1 & 1 & 1 & 0 & 1 \\ 0 & 1 & 1 & 1 & 0 & 1 & 1 & 1 & 1 & 1 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ \end{array} } \right]_{8x10}$$

Step 3—Transpose the matrix

$$\left[ {\begin{array}{*{20}c} {0} & {1} & {0} & {1} & {0} & {0} & {0} & {1} \\ {0} & {1} & {1} & {1} & {0} & {1} & {1} & {1} \\ {0} & {1} & {1} & {0} & {0} & {1} & {0} & {1} \\ {0} & {1} & {1} & {1} & {0} & {0} & {1} & {0} \\ {0} & {1} & {1} & {1} & {0} & {1} & {0} & {0} \\ {0} & {1} & {1} & {1} & {1} & {0} & {0} & {1} \\ {0} & {1} & {0} & {0} & {0} & {0} & {0} & {0} \\ {0} & {0} & {1} & {1} & {0} & {0} & {0} & {1} \\ {0} & {0} & {1} & {1} & {0} & {0} & {1} & {0} \\ {0} & {0} & {1} & {1} & {0} & {0} & {1} & {1} \\ \end{array} } \right]_{10x8}$$

Step 4—As 1st digit in key is ‘Even’, we have to perform Rotate Shift Down as many times as the 2nd digit in key i.e., 2 times.

$$\left[ {\begin{array}{*{20}c} 0 & 0 & 1 & 0 & 1 & 0 & 1 & 0 \\ 1 & 1 & 1 & 0 & 1 & 1 & 1 & 0 \\ 1 & 0 & 1 & 0 & 1 & 1 & 0 & 0 \\ 0 & 1 & 0 & 0 & 1 & 1 & 1 & 0 \\ 1 & 0 & 0 & 0 & 1 & 1 & 1 & 0 \\ 0 & 0 & 1 & 0 & 1 & 1 & 1 & 1 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 1 & 1 & 0 \\ 0 & 1 & 0 & 0 & 0 & 1 & 1 & 0 \\ 0 & 1 & 1 & 0 & 0 & 1 & 1 & 0 \\ \end{array} } \right]_{10x8}$$

Step 5—As 3rd digit in key is ‘Odd’, we have to perform Rotate Shift Left as many times as the 4th digit in key i.e., 3 times.

$$\left[ {\begin{array}{*{20}c} {0} & {1} & {0} & {1} & {0} & {0} & {0} & {1} \\ {0} & {1} & {1} & {1} & {0} & {1} & {1} & {1} \\ {0} & {1} & {1} & {0} & {0} & {1} & {0} & {1} \\ {0} & {1} & {1} & {1} & {0} & {0} & {1} & {0} \\ {0} & {1} & {1} & {1} & {0} & {1} & {0} & {0} \\ {0} & {1} & {1} & {1} & {1} & {0} & {0} & {1} \\ {0} & {1} & {0} & {0} & {0} & {0} & {0} & {0} \\ {0} & {0} & {1} & {1} & {0} & {0} & {0} & {1} \\ {0} & {0} & {1} & {1} & {0} & {0} & {1} & {0} \\ {0} & {0} & {1} & {1} & {0} & {0} & {1} & {1} \\ \end{array} } \right]_{10x8}$$

Step 6—Flatten the matrix

0 1 0 1 0 0 0 1 0 1 1 1 0 1 1 1 0 1 1 0 0 1 0 1 0 1 1 1 0 0 1 0 0 1 1 1 0 1 0 0 0 1 1 1 1 0 0 1 0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 1 0 0 1 1 0 0 1 0 0 0 1 1 0 0 1 1

Step 7—Consider 8 bits at a time and convert into equivalent decimal, for every decimal find the value of corresponding ASCII of decimal and store it in ‘P’ until the end of ‘T’. In the Table 3 every binary form is converted into its ASCII value and corresponding character is filled.

Table 3 Conversion table

Crypt analysis

Cryptanalysis is the study of methods for deciphering data that has been encrypted without having access to the secret information typically required to do it. Knowing how the system operates and locating a secret key are typically required. Another name for cryptanalysis is codebreaking or cracking the code. Since the ciphertext is typically the component of a cryptosystem that is simplest to access, it is crucial to cryptanalysis. Cryptologists can use one or more attack models to break a cipher, depending on the information at hand and the type of cipher being examined.

Differential cryptanalysis

Encryption algorithm is analyzed by toggling one bit in the matrix by ASCII converted characters. When the matrix just differ by one bit at different positions generates different cipher texts. This shows the Avalanche Effect. Change in length difference of actual cipher text and new cipher text, mismatched bits obtained by toggling a bit in matrix is shown in the Table 4. For the above case study, the original cipher length is 96, original cipher length bitwise is 768.

Table 4 Differential cryptanalysis

Extensive analysis

Ciphertext-only attack

In cryptography, a cipher text only attack is a type of attack where an attacker tries to decrypt encrypted messages without having access to the plaintext or the encryption key [25, 26]. In a cipher text only attack, the attacker has only the encrypted ciphertext as a starting point and must use statistical analysis, pattern recognition, and other techniques to try to discover the original plaintext. A cipher text only attack is often considered to be one of the most difficult types of attacks, as the attacker has no information about the key or the plaintext. However, it is not impossible, especially if the encryption algorithm is weak or if the attacker has access to a large amount of ciphertext. Such attacks are prevented in the proposed encryption technique due to the use of strong encryption technique where the cipher text is generated after performing the various complex logics on the plain text.

Known-plaintext attack

In cryptography, a known plaintext attack is one in which the attacker possesses both the plaintext and the associated ciphertext [27,28,29]. This information allows the attacker to analyze the relationship between the plaintext and the ciphertext, and potentially discover the encryption algorithm other sensitive information. This attack is prevented as the generated cipher text using encryption is variable in length which is not related to the plain text length.

Brute-force attack

The strength of an encryption algorithm against a brute force attack depends on a number of factors, including structure of the encryption key, the complexity of the algorithm, and the length and structure of the plaintext and ciphertext. As the proposed algorithm perform complex logics on the plain text and there is no relation between the plaintext and the cipher text as the length of plaintext and the ciphertext is vary with random keys. In order to protect against brute force attacks, it is important to use strong encryption algorithms, As the proposed technique is mainly focuses on the light weight device with less resources it is quite robust to the attacks. It is also important to use appropriate key management and storage techniques to prevent unauthorized access to the keys, where this is addressed using randomly generated key.

Performance analysis

Response time

In Table 5 both encryption and decryption times in (milliseconds) for different data size is given. The data size is 1,2,4, …. 512 KB of powers of ‘2’ were considered as it was the standard sizes. Minimum time and Maximum time for both encryption and decryption was considered. For each case the values are calculated by performing 100 times and means were considered.

Table 5 Response time for encryption and decryption

The Times were calculated by creating a framework using python programming language on Windows 10 64-bit operating system with Intel Core i5-1035G, 1 TB hard disk, 8 GB RAM. In Fig. 3 represents Minimum and Maximum encryption response time of the proposed system where x-axis represents the various data sizes (1 KB, 2 KB, 4 KB, 8 KB, …… 512 KB) and y-axis showing the time.

Fig. 3
figure 3

Minimum and maximum encryption response time

In Fig. 4 represents Encryption and Decryption response time of the proposed system where x-axis represents the various data sizes (1 KB, 2 KB, 4 KB, 8 KB, …… 512 KB) and y-axis showing the time. As represented the encryption takes more time than the decryption in proposed algorithm.

Fig. 4
figure 4

Encryption and decryption response time

Compare with the existing systems

In Table 6 compares the suggested method with other techniques that are currently in use. Properties considered for comparison are lengths of plain text and cipher text, Random key generation, type of cipher (block or stream), confusion, diffusion, avalanche effect.

Table 6 Comparison analysis

Conclusion

In cryptography, encryption is the process of encoding information. As encryption has been extensively investigated and examined throughout the years, several approaches and suggestions have been made to address this difficult and complex problem. This paper proposes a homomorphic encryption technique based on ASCII values and matrix rotations of data that resides in the cloud and the information that is generated by IoT devices. The proposed algorithm is robust enough to withstand various attacks, such as the length of cipher text, which is generated using a random key that is unpredictable. In this approach, confusion, diffusion, and avalanche effects were also performed and led to the conclusion that the generated cipher text is merely unbreakable. The response time is also a crucial part in small computing devices like IoT devices, it is also proven that the response time of the proposed algorithm is quite efficient which is preferrable for these devices. The future work involves in the enhancing the key generation phase where it suits not only for the lightweight devices but also for more computational devices by considering the variable key length.