1 Introduction

Internet usage for media content distribution has become a very popular way for nearly all Online-using organizations to exchange digital information. It is, hence, important to get information over open and attack the prone network to guarantee information security [10, 12]. It is critical to get information across open and attack the prone network to ensure significant information security. The patient’s medical details are important and must be safeguarded in storage and transmission between two hospitals, particularly the cloud. This is why the use of cryptography is very important in protecting these data [26]. Cryptography is used to convert information using an algorithm in encryption processes that are unreadable to anyone other than those with special expertise, which is typically referred to as a key. The process result is encrypted data. The other way around is known as decryption. From classic systems like Caesar, Trifid, or Vigenère to modern cipher systems like Diffie-Hellmann, etc. In digital computing, cryptography was built into many different digital formats, including text, video, etc., e.g. we used the chest x-rays images and encrypted them using modified Arnold’s Cat Map algorithm and then saved this data over the cloud [23]. Earlier, the hackers tried to take these images to help detect whether a patient is suffering from Covid-19. These images show the impact of medicine on the lower respiratory tract.

One will hide secret data in different communication mediums using Steganography techniques. The channel wants to hide is named a “Cover Object”. Cover Object is often in any digital form that has the flexibility to cover data like a picture, audio, video, unlike a text within, which cannot hide the existence of secret data. The key data (digital form), we would like to hide within the cover object are often text, video, audio, or an image. Cover Image at the side of the hidden information is understood as a stego image. Steganography that employs an image as a cover object is known as image steganography. The most essential consideration while constructing an Image Steganography technique is that the image’s appearance after hiding the secret message within the cover image may change dramatically, and an untrained eye will notice that the image is indisputably different from the original. An image Steganography technique is claimed to be excellent if the cover image does not show (visually) the changes made to it once concealing secret message (although there may be some statistical analysis that may be performed to find out the changes) [4, 27].

The transform Domain and the Spatial Domain are the two key domains in which Steganography is frequently done. The cover objects are translated to an entirely other frequency domain in the transform domain to induce the transformed coefficients. To conceal sensitive information, the modified coefficients are manipulated. The inverse transformation is applied to coefficients to induce Stego signals. Simultaneously, there is manipulation in the storage and concealment of secret data of a pixel’s intensity value in the spatial domain. Spatial domain techniques, which are more vulnerable to attacks due to changes in actual sample values, differ from transform domain techniques [9].

1.1 Features of Stegnography

  • Imperceptibility: Ought to be such that no intruder will sense the existence of the secret message. (Invisible to a naked eye).

  • Capacity:Must to offer the maximum amount capacity as it can.

  • Security: It is the measure of un-detectability.

  • Robustness: Keep the embedded information intact in the cover object.

Millions and billions of bytes of data are exchanged every day across the internet. Some of this data is confidential and is required to be transferred securely. The healthcare industry also relies on gigantic amounts of data, which is mainly in three forms, namely, tabular (ex. Medical records), images (X-Ray Images), and signals (Electroencephalogram, i.e. EEC data) [3, 14].

With the extensive use of technologies in the healthcare department, the old ways of handling this data have to be changed. This data is private for the individual and can be misused if it gets into the wrong hands, so it needs to be transferred safely and securely to the recipient, that is where cryptography comes into play. Numerous studies [29] have shown that the complexity of solving an “Elliptic-Curve-Discrete-Logarithmic Problem” grows exponentially in terms of the size of the key used. Therefore, Elliptic Curve Cryptography (ECC) is being used over other techniques like RSA in many industries, and even blockchain technology uses ECC to encrypt its data [30].

The “Diffie Hellman key exchange” is a cryptographic mechanism used to securely exchange crypto keys over the publicnetwork in such a way that even if someone tries to overhear communication, the keys will not be revealed. These exchanged keys will be later used for our encrypted communication, as shown in Figs. 1 and 2 [20].

Fig. 1
figure 1

Encryption process in hybrid schemes (Source: https://cryptobook.nakov.com/asymmetric-key-ciphers/ecc-encryption-decryption)

Fig. 2
figure 2

Decryption process in hybrid schemes (Source: https://cryptobook.nakov.com/asymmetric-key-ciphers/ecc-encryption-decryption)

RSA is one of the prior public-key cryptosystems, and it depends on the math of measured exponentiations and computational trouble of the RSA issue. It can work with different keys lengths: 1024, 2048, 3072, 4096, 8129, 16,384, or even greater than these; generally, key lengths of more than 3072-bits are considered secure. As RSA is deterministic (i.e., has no arbitrary segment), assailants can effectively cause a plain-text assault against it by encoding likely plain-texts with the public key and test if they are equivalent to the ciphertext or not. This probably will not be an issue, yet it is a shortcoming to be considered while picking an encryption scheme. Hybrid encryption plans like RSA-KEM conquers this defect and permits encoding bigger texts [8]. The most adopted standard scheme for signature verification for the RSA signatures is “PKCS#1”.

Algorithms like ECC and RSA are good for encrypting and decrypting the majority of text data, but when it comes to images, the data size skyrockets, and a third party is necessary to validate the keys. As a result, simply implementing the RSA or ECC techniques took a long time [18]. As a result, Arnold’s Cat Map algorithm [6, 19] is one of the better options. The algorithm’s approach entails rotating the image repeatedly until it takes on a recognised yet unknown shape. As a result, we adopt Arnold’s Cat Map algorithm to enhance entropy; the higher the entropy, the more difficult it will be to decrypt the data.

The given model will encrypt the image using the modified Arnold 2D CATMap algorithm. Since every image will have different entropy values, there will be no connection between two different images. The attacker can identify any similarity to decrypt the images, and iterations can also be increased again, making it difficult for the attacker to decrypt the images. Overall, this approach makes the given modelmore secure compared to other techniques in the state of the arts and is faster also.

The rest of the research paper is organized as follows. In Section 2, a literature review and background discussion have been done, while in Section 3, the proposed algorithm is explained. Section 4 shows the results of our model also in comparison with existing other models. In Section 5, the conclusion and future work is discussed.

2 Literature review and background discussion

In the transmission of medical images, security is the most important thing. Since medical pictures are so fragile, they must be secured. The current image security techniques include watermarking, digital fingerprint or signature, encryption. However, there are several disadvantages to all these approaches [1, 17]. The newly proposed approaches would be swift to ensure that no data is discarded. Traditional Internet security procedures are insufficient to ensure that medical photos are not tampered with during data transfer. As a result, we will employ a different encryption approach to ensure that no medical images are harmed.

A simple image (input image) is used to generate a secret key on a device. The secret key, whichis obtained from Eq. 1, has been used to rearrange the image pixels based on our proposed algorithm randomly.

$$ \mathrm{S}.\mathrm{K}.=\left[\left(\mathrm{m}\ \mathrm{x}\ \mathrm{n}\right)+|\left(\mathrm{Q}\ \mathrm{x}\ 103\right)|+|\left(\overline{x}=\frac{1}{\mathrm{n}}\left({\sum}_{\mathrm{i}=1}^{\mathrm{n}}{\mathrm{x}}_{\mathrm{i}}\right)\right)|\right] \operatorname {mod}\ \mathrm{n} $$
(1)

Where m, n = size of the source starting image.

Q = entropy of the source starting imageimage.

S. K. is the secret key which is used to encrypt and decrypt the image.

In Fig. 3, OI is the input image, and EI is the encrypted image, EA: represents the encryption algorithm, and DA: represents the decryption algorithm. In the process of encryption, as discussed above, the RGB colours of the original image were randomly arranged [2, 7].

Fig. 3
figure 3

Encryption and decryption phase

The image is ciphering for the analysis mainly focusedon the image’s RGB pixel values, the secret key extracted from the image. After looking at the original image’s bit values and pixels of the original image there was no change and expansion respectively after the encoding and decoding phase.

To get the ciphered images, pixel values changed from pixel positions, and its RGB values were swapped. This means that the overall change in all pixel values was zero. Therefore, the total image size during the whole cycle has not changed [11, 13].

Another method to secure the medical images hasbeensuggested by Moni Naor and adishamir [22]. In this method, a new technique is used to encrypt images into shares that canbe decrypted only if the corresponding number of shares are stacked together, known as Visual Cryptography. It uses AES as well as visual cryptography [15, 22]. The advantage of the cloud is that we can store data and access any data at any instant of time as needed. It can be used to transfer and recover this data, as shown in Fig. 4.

Fig. 4
figure 4

Showing encryption and decryption phases

The important parameter of visual cryptography (k, n):

  • m - m value is indirectly proportional to the resolution of the pixel.

  • α - Alpha value is proportional to the resolution of the image. Also, it tells about the dissimilarity of the image.

  • k - Minimum number of sharing of the images to build an originalimage. The value of ‘k’ is directly proportional to the clarity of the reorganized image.

  • n - An integer value that tells us about the image is divided into how many “number of shares”.

This method contains the four following phases:

  • In the first phase: The advanced encryption standard technique is used for encryption. In this phase, encryption uses four kinds of transformations and a substitution table. Then the result will fetch to the next phase.

  • Expansion:This phase helped them to divide images into shares using the n out of n VSC techniques. In this phase, they used both VSC and AES by extracting pixels, several shares, making a growth matrix, and adding it with AES, andthen those shares go into the next phase.

  • Collecting data: They used to collect and store data during this phase which can be stored into AWS S3 Bucket.

  • Construction/decryption phase: They take all the collected shares and rejoin them to get the real image and use the AES decryption method.

The authors used different techniques and analyzing methods to check the characteristics of this proposed method and got some amazing results. They conclude that the technique is powerful, and its opposition power is high against many direct attacks. The presented technique easily finds the difference between keys, even if there is only a slight difference between two keys. The quality of the reorganized image is high,and it also tells us about the visual qualityby using Eq. 2:

$$ \frac{\mathrm{Peak}\ \mathrm{Signal}}{\mathrm{noise}\left(\mathrm{decibels}\right)}=\infty $$
(2)

The real and restructured images have the same structure. They confirmed that extracting any information about the real image is difficult after evaluating the histogram. The integrisoated effect of VSC and AES makes this approach much more powerful and reliable.

3 Proposed algorithm

The algorithm clearly states that the images are taken as input and then builds an image object by interpreting each matrix element (line 2). Then the size of the image is calculated (line 3). After the size is calculated, the entropy is calculated (line 4). It should be noted that it is harder for the attacker to find the original image from the encrypted image more the entropy. Calculate the mean of the plain text (line 5). After finding the mean of the plain image, the secrete key (SK) is computed (line 6). The red, green, blue component is extracted from the image as shown (in line 8–10). Image is transformed and reshaped (in lines 11–14). Add the array r, g, b in the same dimension of ‘b’ or ‘r’ or ‘g’ of the original picture. At last, the information will be changed over into a picture format to get the scrambled picture (line 16).

figure a

3.1 Explanation of algorithm

Firstly, we will import the input image into the program then we will compute the size, entropy, and mean of the image to calculate the secret key for encrypting/decrypting the image. The secret key will be obtained by using Eq. 1.

After calculating the secret key of the image, we will extract the green, red, and blue (R,G,B) components of the image, and then we will compute the permutation for each pixel of the original image. To shuffle the pixels of the input image, we will be using a chaotic map. We will perform multiple iterations of this transformation over the input image, giving us the encrypted image. To decrypt the encrypted image, we will perform the inverse of this transformation iteratively until we get the original image.

3.2 Explanation of code

The algorithm used in this research is “Modified Arnold’s Cat Map”. Following are the steps of how algorithms work:

  1. 1.

    The first step is reading the colour pixel value (RGB values) of the image matrix.

  2. 2.

    After the first step, we need to calculate and store the X, Y position of the image pixel that has to be encrypted in a 2D array.

  3. 3.

    In the third step, we perform the random rotation which may call the number of iterations of the RGB pixels of the image so that it becomes non-recognizable.

This map is a chaotic map often used for pixel manipulation. It applies a transform on the image that essentially shuffles the pixels by stretching and folding the image. When an optimal number of iterations of the transformation is implementedover the source image, the output of the image becomes incomprehensible and hence encrypted. The reading of the image, calculating the secrete key, and its implemented code is shown in Figs. 5, 6, 7, and 8, respectively. For this implementation, the transform applied on the image is done using Eq. 3:

$$ \mathrm{R}\left(\left[\mathrm{x},\mathrm{y}\right]\right)=\left[\left(\mathrm{x}+\mathrm{y}\right) \operatorname {mod}\ \mathrm{n},\left(\mathrm{x}+2\mathrm{y}\right) \operatorname {mod}\ \mathrm{n}\right] $$
(3)

where n is the dimensions of the image.

Fig. 5
figure 5

Input and output process

Fig. 6
figure 6

Reading the given input image (Source: https://radiopaedia.org/cases/normal-chest-x-ray)

Fig. 7
figure 7

Calculating the secret key using entropy, mean, and dimensions of the image

Fig. 8
figure 8

Transformation function which is used to encrypt the image

Decryption is known as inverted encryption. The decryption phase is performed by shuffling the pixels using ACM, creating key values using the chaotic map, and eventually reversing the encrypted pixel values to obtain the real image. Since we have been using a chaotic map, i.e. ACM, and we have got a skewed image in the encryption phase using a key-value, as shown in Fig. 9, and at the same time,we have got the source starting image in the decryption processing shown in Fig. 10 as the same key between host and client that was used during the encryption process. Figure 11 shows the image after decryption to get the original image.

Fig. 9
figure 9

Calling the encryption function to encrypt the image

Fig. 10
figure 10

Function used to transform the original source image

Fig. 11
figure 11

Calling the decryption function to decrypt the encrypted image

3.3 Software’s used

Following are the libraries and platforms that have been used in this research:

  1. 1.

    Google Colaboratory

  2. 2.

    Python

  3. 3.

    Multiple Python Libraries

  • 3.1 NumPy

  • 3.2 os

  • 3.3 cv2

  • 3.4 random

  • 3.5 Math

  • 3.6 tqdm

  • 3.7 PIL

4 Result discussion and analysis

Our algorithm is highly secured as the transformation function we used to shuffle the pixel to get the encrypted image is unique and cannot be guessed by any unauthorized party to re-shuffle pixel values to get the original content. Also, our encryption and decryption are based on the number of iterations equivalent to the secret key value, and each image will have a unique secret key as every image has different values of entropy, mean, and size. Hence,it makes our algorithm more secure as iteration value will not be shared with any unauthorized party, as depicted in Fig. 12.

Fig. 12
figure 12

Executing proposed algorithm at stage 2, over a medical image shown at stage 1 and then decrypting at stage 3

Arnold Map Encryption has beenmodified, and there, we tried to introduce more randomness as given in Eq. 4, by introducing randomness, we make sure that it becomes harder for an attacker to decrypt. The logic behind adding randomness is that it increases the entropy of the data and makes it harder for the attacker to decrypt.

$$ \mathrm{S}.\mathrm{K}.=\left[\left(\mathrm{m}\ \mathrm{x}\ \mathrm{n}\right)+\mid \right(\mathrm{Q}\ \mathrm{x}\ \mathrm{random}\left(\mathrm{50,103}\right)\mid +\mid \left(\overline{x}=\frac{1}{\mathrm{n}}\left({\sum}_{\mathrm{i}=1}^{\mathrm{n}}{\mathrm{x}}_{\mathrm{i}}\right)\ \right)\mid \Big] \operatorname {mod}\ \mathrm{n}+\mathrm{random}\left(27,99\right) $$
(4)

Intensity histograms

If we compare Figs. 13 and 14, particularly the pixel intensity, then from the both Figures it is clear that it is harder for the attacker to find the encrypted image. Also, it will be difficult for attacker to find out the keys which is used to encrypt the data.

Fig. 13
figure 13

Intensityhistogram-original image

Fig. 14
figure 14

Intensity histogram-modified arnold cat encryption

4.1 Adjacent pixel autocorrelation

Since images exhibit high information redundancy, it is desirable to have an encryption algorithm that breaks this redundancy. Thus as a metric of encryption performance, we find the correlation (σ) is applied between the adjacent pixels in the various direction such as horizontal, vertical or ina diagonal way. We have considered the horizontal direction.

As shown in Figs. 15 and 16, it clearly shows that pixel correlation in modified Arnold Cat Encryption is too random compared to the source starting image and that’s what makes it harder to guess compared to the source starting image.

Fig. 15
figure 15

Adjacent pixel autocorrelation- original image

Fig. 16
figure 16

Adjacent pixel autocorrelation- modified Arnold cat encryption

4.2 Results comparison with other algorithms

Here, the modifiedArnold Map Encryption is compared to other algorithms such as Hyper Chaotic and SHA-13 in terms of encryption speed as it is indeed an important criterion to select an algorithm for real-world application. If an algorithm is harder to break but takes more time to process, that algorithm is indeed not a good solution. Thus, Fig. 17 and Table 1 clearly show that it is secure and also the speed of encryption is faster compared to other algorithms such as Hyper Chaotic and SHA-13.

Fig. 17
figure 17

Comparison of modified Arnold cat map encryption withhyperchaotic, cat map and SHA-13 in terms of encryption speed

Table 1 Comparison of modified Arnold cat with other state of the art algorithms in terms of encryption speed

As shown in Fig. 18 and Table 2, the NPCR estimates the quantity of pixels change rate in an encoded picture when 1 bit is changed in the source plain picture. Thus, as shown in Fig. 18 NPCR value comparison of modified Arnold cat with ten logistic maps, bakers map, henon map, cross chaos map, and 2D logistic map. It can be seen that the modified Arnold cat outperforms all the other algorithms.

Fig. 18
figure 18

NPCR value comparison of modified Arnold cat with 10 logistic maps, bakers map, henon map, cross chaos map, and 2D logistic map

Table 2 Comparison of modified Arnold cat with other algorithms in terms of NPCR values

From Table 1, it is clear that the encryption speed is much higher in the modified Arnold CATMap algorithm thanin other algorithms. Faster encryption speed makes our suggested algorithm more useful as compared to previously used algorithms.

For differential attack, an attacker changes a specific pixel in the plain image and traces the differences in the analogous encrypted image to find a meaningful relationship. This is also known as a chosen-plaintext attack. A robust encrypted image must be sensitive to minor changes, and even changing one bit in the plain image should result in a wide range of changes in the cipher image. The given Eq. 5 calculates this parameter, and for an ideal encryption algorithm, it is considered 1.

$$ {\displaystyle \begin{array}{l}\mathrm{NPCR}=\frac{1}{m\ast n}\sum \limits_{i=1}^m\sum \limits_{j=1}^nf\left(i,j\right)\ast 100\\ {}\mathrm{f}\left(\mathrm{i},\mathrm{j}\right)=0,\mathrm{if}\ \mathrm{c}1\left(\mathrm{i},\mathrm{j}\right)=\mathrm{c}2\left(\mathrm{i},\mathrm{j}\right)\\ {}\mathrm{f}\left(\mathrm{i},\mathrm{j}\right)=1,\mathrm{if}\ \mathrm{c}1\left(\mathrm{i},\mathrm{j}\right)\ne \mathrm{c}2\left(\mathrm{i},\mathrm{j}\right)\end{array}} $$
(5)

Where c1 and c2 are obtained by encrypting two m × n plain images and one random bit dissimilarity, from Table 2, if we compare the NPCR values,we find that NPCR values are highest at 0,994 in Modifies Arnold 2D CATMap while NPCR values are very less in other algorithms. Higher NPCR values make our algorithm more secure because it will make it difficult to find the decryption key.

Thus, Table 3 clearly explains the importance of Modified Arnold Cat algorithm over conventional approaches such as Attribute-based Cryptography Technique, Identity Based Encryption (IBE), Diffie-Hellman Key exchange, Homomorphic Encryption and Challenge-based Trust Mechanism. It not only supersedes the conventional approaches but suffices the latest approaches such as 10 logistic maps, bakers map, henon map, cross chaos map, and 2D logistic map, hyperchaoticand SHA-13 as shown in Tables 1 and 2, respectively.

Table 3 Comparison of modified Arnold cat with conventional approaches

5 Conclusion and Future Work

A modified Arnold Cat algorithm is an encryption approach that is good enough to safeguard digital documents, particularly pixel security whereas other algorithms are more focused on protecting files or text. The image can be readily safeguarded using the Modified Arnold Cat algorithms without compromising the image’s importance or details. Hence, the proposed scheme may be used to protect the crucial medical image data. In the future, an interface or software can be created to save the medical image in a huge database, ensuring that the encrypted image is securely stored before transmission. We can say that this approach is suitable for operations like the encryption of medical images and the secure transfer of internet content.