Image Encryption Techniques Using Dynamic Approach : An Article Review

In this study, dynamic encryption techniques are explored as an image cipher method to generate S-boxes similar to AES S-boxes with the help of a private key belonging to the user and enable images to be encrypted or decrypted using S-boxes. This study consists of two stages: the dynamic generation of the S-box method and the encryption-decryption method. S-boxes should have a non-linear structure, and for this reason, K/DSA (Knutt Durstenfeld Shuffle Algorithm), which is one of the pseudo-random techniques, is used to generate S-boxes dynamically. The biggest advantage of this approach is the production of the inverted S-box with the S-box. Compared to the methods in the literature, the need to store the S-box is eliminated. Also, the fabrication of the S-box has a very large key space as it depends on the user's key. The encryption-decryption method allows changing pixel positions with the help of dynamically generated S-boxes, images, videos, etc. Thus, the study shows that a new method of S-boxes for dynamic cipher algorithms can be easily generated and applied to image encryption.


Introduction
Dynamic Encryption is widely used to securely conceal and transmit data over an unsecured network.The algorithms used in encryption form the core component of the encryption system.The cipher system consists of an encryption algorithm, a key, plaintext, and ciphertext [1].In the last century, many methods, such as DES (Data Encryption Standard) and AES (Advanced Encryption Standard), have been developed to encrypt data [2,3].Most cipher algorithms are based on block encryption algorithms.Block cipher algorithms such as AES and DES play a very active role in encrypting text-type data.However, due to the large size of image and video files, using them to encode images is not considered appropriate [4].Nonlinear systems are mainly designed on dynamic models that are sensitive to initial seeds and present randomness keys, which are the best enhancements for developing cryptosystems [2].In contrast, issues such as confidentiality and integrity are core to implementing cipher algorithms.However, there are a huge number of cipher algorithms based on symmetric and asymmetric approaches, which involve two dissimilar types of cryptography algorithms based on stream and block cryptosystems.Block-cipher algorithms occupy a very important place in cryptography today [5].These algorithms use the same key to encrypt and decrypt data.Block cipher algorithms get stronger using dynamic keys.This approach can add hashing capability to prevent cryptographic algorithms, which is the only nonlinear feature [6].Therefore, a well-chosen S-box directly affects the coding result.While designing S-boxes, pseudo-random finite-field inversion, finite-field inversion, and heuristic techniques are used [5].Today, with the widespread use of mobile technologies, ensuring the security of image data is also of crucial importance.This security can be ensured by encrypting the images.Image encryption approaches are grouped into two groups: chaotic and non-chaotic techniques.Dynamic encryption algorithms take parameters from the user for encryption and decryption operations [2].In addition, the key value used in the encryption process changes at each step of the process.If the same user parameter used for encryption is not used in the decoding process, the original image cannot be obtained [6].Image encryption techniques have three basic ideas.In contrast, this method can be applied based on the substitution, value conversion, and permutation techniques as they are used together [7].In image encryption, the current pixel color value is changed using value conversion algorithms.Moreover, in displacement algorithms, the positions of existing pixels are shuffled by moving them to other positions with the help of an algorithm.Thus, the dynamic encryption systems should be explored and examined based on nonlinear equations, some analysis must be calculated to show how the image encryption system is introduced, and the main properties of such systems should be examined.

Materials and Methods
In this section, S-boxes are explored and shown how they are generated dynamically in order to encipher images and in what manner the generated S-boxes are used in the encryption or decryption of the image.

K/DSA Algorithm
Random number permutations, or "shuffles," as they are known in the literature, are frequently used in computer calculations as well as in our daily lives in areas such as card shuffling, numerology, cryptography, and simulation [8].This version of Shuffle Algorithms was published [9] in 1963 and [10] in 1964.But it is known as the Knuth Shuffle and was published in the second volume of The Art of Computer Programming in 1969 [11].K/DSA is designed to mix a group of elements by exchanging them.The ordered integers from 0 to (n-1) are written into the matrix X.Then a random number j is chosen such that 0 j ≤ (n-1).Then the elements X [i] and X [j] are swapped.In the next step, a new random j is selected; this time, 1 j ≤ (n-2), X[j], and X[i-1] elements are replaced.The process continues until the last two digits are swapped.Of course, in the following steps, while the items moved to the right side cannot be moved again, the places of the items moved to the left will be changed frequently [12].Due to the nature of K/DSA, if the initial value is the same for random number generation, the same sequence of X will always be obtained.

S-Box Production with K/DSA
Using the K/DSA method, which is detailed above, the S-Box that will be used for encryption of the images, is dynamically obtained.Dynamically getting the S-box and not storing it is an important feature of image encryption and decryption [13].Because producing S-boxes suitable for encryption and decryption is only possible if the correct key is known.The S box consists of 256 different integers.So, since its maximum length will be nmax =256, the probability of making the correct S-Box can be computing by the following equation: The probability of obtaining an inverted S-box in one trial is the same as in Equation 1. Creating an inverted S-box with an S-box significantly reduces the decoding time.The flow chart for obtaining an S-Box is shown in Figure 1.

Figure 1.
Obtaining an S-Box [13] i =255, 0, -1 i=0, 15, +1 S-boxes are 16×16 in size and consist of 256 values.With the help of K/DSA, 256 integers are shuffled according to the initial value set by the user [13,14].Starting with the first element of the randomly shuffled array, the hexadecimal equation ( 16) is taken for each value.The hexadecimal equivalents are placed line by line, starting with the first cell in the 16×16 matrix.One of the S-boxes obtained by K/DSA.isshown in Fig. 2.  The resulting S-box is used to produce the inverted S-box.The inverted S box is obtained as follows: For example, in the S-box shown in Figure 2, the value of AB is at the intersection of the sixth row and column D. The value AB will be accepted as column A. Row B. In the inverted S-box, the value in Sbox, 6D, will be written at this intersection.This process is applied to all values in the S-box.Getting  Only one Flipped S-Box can be obtained from each S-Box.Getting the Flipped S-Box depends on creating the S-Box.

Images Cryptographic Process
Given today's technology, it is inevitable that image encryption will be applied to color images.Color images are composed of three primary colors, RGB (Red, Green, and Blue).With the RGB space, all colors in nature can be obtained by mixing these three primary colors in certain proportions.In this method, color images in bmp and jpg formats with a depth of 24 bits are used.In the first step of the encryption process, the RGB values of each pixel are obtained from the original image.The hexadecimal equivalent is taken for each color value.The first value of the hexadecimal equivalent obtained is accepted as a row, and the second value is accepted as a column.The value at the intersection of the row and column values in the S-box obtained with K/DSA is processed as new color values.This process is applied separately to the RGB values of each pixel.For example, suppose the RGB values for a pixel are R=59, G=167, and B=218.The hexadecimal equivalents are R=3B, G=A7, and B=DA.Given a possible S-box produced with K/DSA in Fig. 2, new R = CB for row 3, column B, new G = 76 for row A, column 7; new B = E6 for row D, column A. Acquired.The method examined is more robust; the newly obtained RGB values are XORed with a hexadecimal value at random coordinates in the S-box.A pseudo-random number generator (PRNG) is used to generate the random numbers.
PRNGs are types of algorithms that produce a series of numbers that are not easily associated with their elements [13].The main purpose of these number generation methods is actually to generate a series of numbers based on a particular mathematical function.By hiding the mathematical function used during number generation, an attempt is made to prevent estimation of the numbers produced.In number generation using PRNG, the same number sequence is always obtained with the help of an initial value.Therefore, the base value specified by the user is used as the initial value of the PRNG used in the method.Two hexadecimal numbers are generated by PRNG to represent the row and column for each RGB value.Since the initial value is the user's private key, the coordinates of the S-box generated by PRNG will always be the same.Specifying a different user key will result in different coordinates.The new RGB values after the XOR operation represent the new pixel values of the encoded image.The flowchart performing the encryption process to represent the original image before encryption is shown in Figure 5.The same random numbers will always be generated unless the user key is changed.This operation is performed separately for each value of R, G, B. The hexadecimal value in the S box and the R, G, and B values obtained from the encrypted image are XORed.For each of the new R, G and B values obtained after the XOR operation, the points where the corresponding row and column values intersect in the inverted S-box provide the pixel value of the original image.For example, suppose the new value of R obtained after the XOR operation is AB.Looking at row A and column B in the inverted S-box in

Results and Discussion
This section discusses the security analysis of the method detailed above.For this purpose, the results obtained by performing graph, correlation, and principal space analyses are presented below.

Correlation Analysis
Statistical correlation is a measure of the strength of a linear relationship between two random variables.
In an array containing n elements, where x and y are random variables, the correlation coefficient can be calculated with the following equation [14].( 15 ) , RND ( 15 (3) The correlation coefficient is supposed to carry values confined between one positive and one negative (an integer).If this is the case, this means that the correlation between pixels is strong.If the correlation is close to absolute zero, this indicates a weak pixel correlation.
From the results and figures of the following two tables, it is clear that: -The correlation between the main images is close to one.
-The correlation between the coded images is close (to a very high degree) to zero.Conclusion: ((The method of encrypting the image using S-box makes the relationship between neighboring pixels close to 0 and gives successful results).

SSIM Structural Similarity Test
This test is a guide or method for measuring and determining the degree of similarity between images.You can also set the quality (image quality) as well.The following equation illustrates this [15,16].
To interpret the results, it can be said: -The two pictures are similar = the value is one or closes to it.
-There is no similarity = zero value or close to it.
The following table demonstrates this: From Table 3, we can conclude the following: -The similarity between the image (which has already been decrypted) and the original images is 100%.
-The percentage of similarity between the original images and the encrypted image is very low.
-No loss of pixels in the decrypted process.

Entropy Test
Entropy is the randomness and disorder in a system.It is calculated according to the equation below: Here, (  ) represents the   probability states of tokens in a message, and M × N represents the total number of tokens [17,18].In a random message, the ideal entropy value is 8, and in messages with less randomness, the entropy value is less than 8.If the entropy value is much less than 8, a security threat can be expected [16].
Given that the encryption images are composed of random pixel values, the ideal entropy value is expected to be 8.The entropy test can be applied to gray-level images.In color images, the entropy test is applied separately for each RGB channel.5, it is evident that the entropy values of the encrypted images are very close to 8. Therefore, it can be said that the method is quite resistant to attacks.In addition, the fact that the entropy values of the original and decrypted images are the same indicates that there is no data loss in the encryption and decryption processes.

Conclusion
In this study, dynamic encryption techniques are explored and studied to encrypt and decrypt images using dynamically generated S-boxes.The S-boxes are dynamically generated based on the user key.When different user keys are used, different S-boxes are dynamically obtained.Therefore, it has a very large key area.Since the encryption and decryption processes are based on S-boxes, obtaining the original image will only be possible if you know the correct user key.In addition, when the PRNG equation to be used in the method is kept secret, the probability of obtaining the original image is greatly reduced.It is very important that the original image can be recovered from an encrypted image.Considering the experimental results, it has been observed that the method allows restoring the original image with the correct key value without any data loss.Consistent with the results obtained from all the experimental results, it seems possible to use the method for the purpose of image encryption.

Figure 2 .
Figure 2. Possible S-BOX created with the help of K/DSA[13]

Figure 5 .
Figure 5. Flowchart of the encryption process

Figure 4 ,
Figure 4, it will be seen that the corresponding value is 6D.When these operations are applied to the R, G, and B values of each pixel after the XOR operation, the pixel values of the original image are reached.The flowchart illustrating the decoding process to represent the encoded image I is shown in Figure6.

Table 3 .
Test results / Structural similarity

Table 5
shows the entropy test results for the original, encoded, and decoded RGB color images.

Table 4 .
Entropy test results