The picture encryption algorithm utilizing 2D-AST hyperchaotic mapping is often segmented into three components: key generation, clock diffusion, and genetic recombination. The initial sub-algorithm is a key generation, which acquires the starting parameters of the chaotic map from the original image to enable the AST map to create the encryption key. The second part encrypts the pixel values of the image’s three channels using clock diffusion and the generated key. The final sub-algorithm employs a genetic recombination technique to randomize the pixels at the bit level.
4.1. Key Generation
Keys are always crucial in image encryption methods. The complexity of an encryption algorithm’s key directly impacts the security of the image encryption algorithm. This article’s encryption approach utilizes the time series of the AST chaotic map as the key. The chaotic map is highly sensitive to the beginning value in the chaotic state; hence, the initial value of the generated key comes from the initial image. Both the clock technique and the genetic recombination procedure necessitate keys during the subsequent encryption process. To guarantee the security of the encryption algorithm, chaotic keys with varying initial values will be employed at different encryption stages. This study uses SHA-512 to compute the hash value
derived from the plaintext picture to establish the initial value. The precise procedure is outlined as follows:
The hex2dec() function transforms the hash value from hexadecimal to decimal. Three chaotic time series are needed for the encryption procedure of this article. Consequently, for the identical plaintext, three distinct sets of x, y, a, and b must be constructed for temporal diffusion and genetic recombination, respectively. Algorithm 1 utilizes initial values x and y, along with control parameters a and b, to employ the AST chaos map as the iteration core for producing chaotic times and .
The chaotic time series x and y vary in range according to the value of β. In the following research of this article, the value of β is chosen to be 8. The current chaotic sequence is a floating-point number less than β. The chaotic time series will be preprocessed to facilitate its use in the encryption process. The preprocessing formula is as follows:
represents the chaotic time series, n stands for the number of operations needed in the encryption procedure, and q is the encryption key for the final image.
Algorithm 1. Key generation |
Input: , , a, b, k,; Output: , - 1.
Start - 2.
Get , , a, b - 3.
for i = 1:k - 4.
; - 5.
; - 6.
End - 7.
Stop
|
4.2. Clock Spreading Algorithm
Diffusion and scrambling are key encryption techniques in traditional picture encryption systems. In recent years, several diffusion encryption methods, like DNA encoding, have been commonly utilized in the diffusion stage. Their performance at the diffusion stage is commendable. Due to the encoding and decoding procedure, it has some drawbacks in terms of computing time. Hence, we suggest a novel diffusion encoding technique grounded on the concept of the clock. The clock’s hour hand, minute hand, and second hand are represented by R, G, and B, respectively. The rotation amplitude is determined using a key to encrypt pixel values. Its pseudocode is displayed in Algorithm 2.
Algorithm 2. Clock spreading algorithm |
Input: , I; is the chaotic time series produced by AST chaos mapping, and I is the image to be encrypted. Output: , - 1.
Start - 2.
Get , - 3.
[M, N] = size (); - 4.
= (:,:,1); = (:,:,2); = (:,:,3); - 5.
; - 6.
- 7.
End - 8.
Stop
|
The simulation process of clock diffusion is illustrated in
Figure 11. Upon analyzing the image, the following three channels are acquired: R, G, and B. The code lines containing the necessary keys for the diffusion procedure are 4. To minimize gray value correlation among the three channels of a single pixel, the following is implemented: the R channel represents the second hand, the G channel represents the minute hand, and the B channel represents the hour hand. The R channel consistently undergoes a 360-unit rotation, the G channel undergoes a 60-unit rotation, and the B channel undergoes a one-unit rotation. Additionally, since the grayscale value range is [0, 255], the mod() function will be applied subsequent to the rotation process in order to restrict the range of pixel values to a specified region. In summary, this pseudocode executes the clock diffusion algorithm, which encodes pixel values after converting the incoming chaotic sequence into the encryption key of the corresponding channel after operation, and each channel of the image is entered into the corresponding vector to facilitate subsequent operations.
4.3. Genetic Recombination Algorithm
The rearrangement of DNA sequences via the separation and reassembly of chromosomes or chromosome segments is referred to as genetic recombination. Genetic recombination [
26] is the exchange of genetic material between distinct organisms, which results in progeny with a unique combination of characteristics compared to their parents. Genome recombination is a naturally occurring process that expands the genetic diversity of sexually reproducing organisms, thereby enabling them to manifest novel phenotypes. Moreover, each pixel can be represented by an 8-bit binary, and the weights and quantities of information associated with data at various positions vary. The decomposed image of coffee’s photograph is depicted in
Figure 12.
As illustrated in the figure, the R, G, and B channels of the image are initially decomposed. It is evident that as the bit plane decreases, there is a corresponding gradual reduction in the quantity of information contained within the image. Consequently, to achieve a random distribution of bits conveying disparate information within the encrypted image, this work architecturally divides the pixel bits and converts them into queues and stacks. Each process sequentially selects distinct pixel blocks and recombines them based on the key. The algorithm is shown in Algorithm 3. Subsequently, the article performs the following operations: it swaps the high and low three bits of the R channel, exchanges the high and low three bits of the G channel, and finally advances the lowest bit of the B channel to the highest bit. The resulting image retains its original dimensions, but it is evident that a substantial amount of information has been lost. Acquiring corresponding information from images after genetic recombination poses a significant change. The second pseudocode is illustrated in Algorithm 3.
Algorithm 3. Genetic recombination algorithm |
Input: x is the breakpoint of this gene recombination. Output: - 1.
Start - 2.
Get ; - 3.
- 4.
- 5.
= []; = []; - 6.
- 7.
] - 8.
- 9.
- 10.
- 11.
- 12.
End - 13.
Display - 14.
Stop
|
Dec2bin() and bin2dec() in pseudocode 3–4 and 11 are functions that facilitate the conversion of pixel values between decimal and binary formats. The parameter c denotes the storage parameter of the algorithmic process, categorized as
in stack format and
in queue format. The operational procedure is illustrated in
Figure 13. The first and tenth pixels in the plaintext are designated as target factors for recombination via the key, with the chosen recombination point being five. “10000101” and “00101101” represent 8-bit pixel values, respectively. The data are read sequentially from the highest bit and partitioned based on bit 5. Queue Q1 receives “001”, stack S1 receives “10110”, queue Q2 receives “001”, and stack S2 receives “10100”. Utilizing the first-in-first-out principle of queues and the first-in-last-out principle of stacks, we amalgamate the head of the queue with the base of the stack to create composite structures H1 and H2 that maintain identical output sequences. H1 and H2 are sequentially output, and the final decimal results “44” and “105” are reintegrated into the sequence to finalize gene recombination.
4.4. Image Encryption Algorithm
Figure 14 illustrates the execution of a color image encryption algorithm that employs genetic recombination and clock diffusion.
Step 1. Input the M × N × 3 color image into three matrices denoted as and , utilizing the three channels of R, G, and B, respectively. The elements and grayscale values of the corresponding channel pixels in all three matrices are identical.
Step 2. The clock diffusion encryption process necessitates a single key sequence, whereas the succeeding genetic recombination process demands two key sequences. As a result, the encryption procedure described in this study necessitates a total of three key sequences so as to maximize the degree of equality between keys. Three disorganized time series constitute independent key sequences. As initial parameters, we select the fourth and sixth planes of , the seventh and fourth planes of , and the fifth and second planes of , respectively; that is, we obtain three initial (i = 1, 2, 3) by applying Formula (5) to a = 40, 72 and 18.
Step 3. Pass (i = 1, 2, 3) as the initial parameter into the 2D-AST chaos mapping so that it iterates M × N + 100 and M × N × 3 + 1000, respectively, and removes the first 1000 data to ensure the chaos of its time series, and finally obtains two time series with length M × N × 3 and a chaotic time series with length M × N.
Step 4. In step three, chaotic time series of the M × N type are processed using Formula (6). At this moment, the value n = 1 is chosen. The clock key of the R channel is the processed one-dimensional sequence, which is compared to 60 and 360, respectively. By performing a division operation, the keys of G and B can be obtained. The acquired key is appended to the corresponding channel and maintained within its valid range using the mod() function. The three newly acquired vectors , , and represent the encrypted pixels.
Step 5. Formula (6) is applied to the M × N × 3 chaotic time series acquired in step 3. The values n = M × N × 3 and 8 are subsequently chosen to represent the breakpoint coordinates and index coordinates of genetic recombination, respectively. Convert the three vectors , , and to unit8 form and combine them into a one-dimensional vector. To obtain a new one-dimensional vector I, select the exchange point using the index key, break the link, and reorganize the breakpoint key. The final encrypted sequence is as follows.
Step 6. The one-dimensional vector I should be converted to a decimal matrix of size M × N × 3 before being output. This matrix represents the encrypted final image.
The process of decrypting the image is the exact opposite of the encryption operation.