A new method to encrypt images based on triple encryption methods

Information security has become a significant concern, and the protection of images transmitted over the Internet is vital, which requires a high level of security. The information in these images has been used without permission and, therefore, will have serious consequences, and the images can be secured in several ways. Data encryption and decryption have recently received much attention and development. Strong encryption and decryption is required, which is incredibly difficult to crack. In this paper, an encryption environment consisting of triple encryption methods was used to create a new encryption system, which depends on several stages, including the step involving the process of creating the key using the RSA algorithm and then using this generated key with the same RSA algorithm to encrypt the image, in the second stage using a method "zig_zag" in order to encrypt the image again based on the encrypted pictures generated from the first stage, in the third stage, encrypt the image generated from the second stage using the 2D CAT method. As for the setting of retrieval of the original photos using triple decryption methods in a reverse way, the idea was returned without losing its data. The image quality was excellent.


Introduction
By converting sensitive information into an incoherent format (encryption) that the authorized recipient can only decode, encryption enables secure communication and protects that information (decryption).Unauthorized access is mitigated through various mathematical compromises, including cryptography algorithms [1,2,3].Scrambling encryption, an essential part of picture security, is now a widely investigated image steganography technology.For example, each encryption algorithm has its benefits and drawbacks: Rubik's cube matrix transformation, zig_zag transform, Arnold transform, Hilbert curve transformation, and son.Take, for example, the obfuscation cipher.While just the pixel positions and values are modified, an attacker can still restore it in an all-out attack that doesn't care how long it takes if he tries to decrypt the obfuscated image [4].As a result, rather than using only one sort of scrambling technique, multiple distinct scrambling algorithms or other cryptographic algorithms should be mixed to encrypt an image.A new picture encoding approach based on a combination of the d-zigzag scrambling algorithm, the 2D CAT map, and the RSA algorithm has been developed for this purpose.RSA is an asymmetric block cipher based on number theory (public key).Its safety depends on the difficulty of many prime factors, a well-known mathematical problem with no solution [5].

Algorithms overview
In this part, the most important algorithms used in the proposed method are explained.

2D CAT MAP Method
In the field of ergodic theory, V.I.Arnold was the first to present a 2D Cat map [6,7].The cat map changes the arrangement of pixels in an original image by replacing the pixel points' locations with new coordinates.After numerous rounds, the relationship between adjacent pixels is totally broken, and the image seems distorted and meaningless.However, after many iterations, it will eventually return the original image, showing that the Cat map is periodic.An array relation, P = (x, y) | x, y = 1, 2, 3,..., N), can be utilized in encryption and is written as follows: The inverse array relation for decrypting a 2D Cat map is as follows:

…………….(2)
The pixels in the image created by the previous decoding strategy must be modified [8].

Zig_zag scrambling Method
The zig_zag pattern [3,9,10] refers to the matrix structure of the N2 integers that increases anti-diagonally along the arrays.Figure 1 depicts the various types of zig_zag designs.A parallel zig_zag pattern is a motive wave that goes on a similar trend (see fig. 1) (a).The diagonal zig_zag pattern is a motive wave that goes on a sloping trend (see fig. 1).(b).The proposed approach is based on a similar zig_zag encryption pattern (see Figure 1).(a).

RSA Algorithm
A popular public key cryptography algorithm is the RSA.The first asymmetric algorithm is still widely used today.Rivets, Shamir, and Adelman, are the three mathematicians who developed RSA.This algorithm can be used for data encryption, key exchange, and digital signatures in many software packages.RSA utilizes a variable-sized encryption block and a varying key in this method.[11,12]

* Key generation
RSA employs two distinct key types (A public key and a private key).Everybody has access to the public key, which is used to encrypt messages.Only the secret key can quickly decrypt messages encrypted with the public key.[13,14].The steps below are used to create keys for the RSA algorithm:

Key generation
*RSA encryption and decryption process

The proposed method's general outline
In this part, the architecture of the proposed method will be explained, which is the methodological framework that represents how to encode the color image based on the optimized algorithm and how to retrieve it, as shown in figure 2, which represents a detailed diagram of the proposed method.

Encryption Process Decryption Process
Figure 2 Suggested approach's general layout

Implementation of the proposed method
This section will go over the actions taken to implement the proposed technique, broken down into three stages and depicted in Figure 3 below.Then we use the resulting image as an input to the ZIG_ZAG encoding method after converting the image into RGB arrays, as shown in figure 4.

Figure 4 Zigzag process
And the last step, we use the resulting image as an input to the 2D CAT method after converting the image into RGB arrays.

The Decryption Process
This part indicates reversing the encoding process, but requires knowledge and the decryption key to retrieve the original image.As a result, an attacker will have difficulty detecting or guessing the key and the change in pixel positions caused by 2D CAT MAP and Zig zag methods.

The Practical Aspect of the Proposed Method
This part will clarify the implementation of the proposed method in the application according to the steps described in figure 10, which shows how to encode and retrieve the original image.Figure 5 depicts the interface for generating keys using the RSA algorithm: Figure 5 The suggested method-key generation interface After that, as shown in Figure 6, click "input photo" to add a picture.

Figure 6 upload image
The original image is uploaded at this stage, after which you must click next to begin the encryption process: The first algorithm is the RSA algorithm; select RSA encryption to encrypt the input image, then select Next, as illustrated in Figure 7.  Click the Decryption process at the receiving side image to decrypt the image, then uploads the encrypted image to decode the image using 2D CAT MAP, as shown in figure 10. then, as seen in figure 11, the image will be decrypted using zig_zag method.

Figure 11 Decryption process using the zig_zag method
Finally, as shown in Figure 12, the image will be decrypted using the RSA algorithm and a private key.

Figure 12
Decryption process using RSA algorithm

Results and discussion
In this paper, we used two scales to assess the quality of cryptographic and security analysis methods (statistical and differential attacks).The first is differential measures, which employ two standard measures, NPCR and UACI.Any modification to the conventional image will significantly impact how well the encrypted image can resist a differential attack.While UACI calculates the average intensity of distinctions between two images, NPCR measures the pixel value variance.The algorithm's sensitivity should always be reflected by NPCR values in the 99% band and UACI values of 33%.[15,16].

……….(3) ………(4)
Values for C1(i, j) and C2(i, j) grid pixels (i,j).D(i, j) is determined by C1(i, j) and C2(i, j).D(i, j) equals 1 if C1(i, j) and C2(i, j) are equal, else it equals 0. Differential assaults are worthless because the cipher picture might diverge greatly from the original image, even when only marginally changed.Ideal encryption techniques favor higher NPCR values.The UACI values must fall between 33% and 35%.[15].The second metric is the correlation coefficient.The analysis evaluates the image's relationship to its encryption variables.It demonstrates the proposed encryption algorithm's resistance to statistical attacks.As a result, the encrypted image must differ significantly from the original [10].The equations are used to calculate the correlation coefficient.[15,16]: C.C: correlation coefficient ……….. (6) x and y: the gray-scale pixel values of the unencrypted and encrypted images.The original image's correlation coefficient is often high (nearly one).When the correlation coefficient of the encrypted image is lower, the method operates more effectively.[15].

Conclusion
In terms of communication security, the encryption algorithm is crucial.We encrypt the image with RSA, apply Zig_zag transformation, and finally use the 2D CAT MAP method, which is simple to implement and has low time complexity.It may also successfully shift data's initial position and is often used to process digital photographs.In addition, it can modify the suggested method to encompass multiple media such as video, audio, and so on.

Figure 3
Figure 3 Method Implementation Steps Proposed

Figure 7
Figure 7Encryption process using the RSA algorithm Then, as shown in Figure8, click next to encrypt the output image using the zig_zag method.

Figure 8 9 Figure 9
Figure 8 Encryption process using the zig_zag methodThen click next to encrypt the output image by the 2DCAT MAP method, as shown in figure9

Figure 10
Figure 10 Decryption process using the 2DCAT MAP method.

Table 1
Presents the NPCR and UACI values for the three images obtained using the proposed method

Table 2
Displays the results of the C.C values of the three images calculated using the proposed method The correlation coefficient can be seen in the table.Image values are shallow.