A scanning and shuffling method is employed to encrypt a plain image. However, using a 1D logistic and sine map for encryption has limitations such as low complexity, small key space, and insecurity. To address this, Equations (1)–(3) are modified to produce Equations (13) and (14), which are used during the encryption process. The fuzzy mathematics concept is applied to generate values that manipulate initial keys in each iteration and produce new cipher images. By doing so, image security is improved and better at handling differential attacks.
3.1. Scrambling and Shuffling of Image Pixels
The rearranging, shuffling, and shifting operations in steps 1–3 of the proposed image encryption scheme are used to increase the complexity and randomness of the encryption process. The motivation behind these operations is to make it difficult for an attacker to decipher the encrypted image without knowledge of the secret keys. The scrambling of the image pixels in step 1 ensures that the image data are not in their original form, making it difficult for an attacker to recognize the image. The shuffling of the rows in step 2 and the shifting of the columns in step 3 further increase the complexity of the encryption process by introducing additional randomness. Without these operations, the algorithm may be less effective in ensuring secure transmission of information.
Step 1: Take a grayscale plain image
of size
and divide it into four different equal blocks of
such that
and rearrange those blocks as in
Figure 1.
Step 2: Each block is scrambled by sorting odd columns only and shift them to left side, odd rows and shift them to the top of the image; for example, as illustrated in
Figure 2a, the value 88 at position
is shifted two positions right to
, as seen in
Figure 2b, and in the final stage
Figure 2c, it is shifted one position upwards to
. The process is shown in Algorithm 1.
Algorithm 1. The pseudo code of scrambling and shuffling image P |
Start Obtain plane image of size Convert to decimal array of size - 3.1
Divide into 4 equal blocks - 3.2
In each block, shift the even column right and the odd rows upward. - 3.3
Reposition Blocks
Combine Image Blocks and output new scrambled image Stop
|
Step 3: During this step, the transformation of image pixels occurs by taking each block and interchanging their position diagonally, as illustrated in
Figure 3.
3.2. Diffusion of Image Pixels
The process involved summing up the pixel values from different columns and rows to determine a new value at a specific position. Additionally, a triangular membership function derived from fuzzy mathematics was employed to obtain a manipulation key number. To achieve image diffusion, a hybrid random chaos system was created using three different chaotic maps, namely, the logistic map, the sine map, and the Hénon map.
Step 4: In this step, the manipulation is performed separately on each block,
. If
represents any column to be selected from a square matrix
, where
, then
denotes the selection of a specific column in the matrix
. The summation of two-pixel values from different columns
and two adjacent pairwise rows is performed to derive a new value, as shown in
Figure 4a–d, when Equation (6) is applied. For blocks
, the value of
is 1, whereas for blocks
, the value of
is 123. The process of summation is dependent on the number of iteration processes in each block, which can range from 1 to 4. However, for this study, only three iterations were conducted to increase performance. The top row remains unchanged, which simplifies the decryption process. The pseudo code algorithm of this process is shown in Algorithm 2.
Algorithm 2. The image pixel manipulation
|
Start Input scrambled image of size Select any Column from each block of size Adding two diagonal pixel values in pairwise rows
- 4.1
- 4.2
- 4.3
- 4.4
- 4.5
Repeat Step 4, four times Combine all the blocks - 7.1
Display Stop
|
Step 5: Generation of fuzzy triangular membership for the
value. The functions described in Equation (7) refer to the membership values obtained from the image
, which takes values in the interval [0, 1]. To obtain values close to 0.5, the value
is adjusted piecewise, as shown in Equation (8). This facilitates the determination numbers between 0 and 1 of the sums of all membership values of the plain image and its mean, as illustrated in Equation (9). Here, n represents the total number of pixels in the image
. Additionally, the
value is added to the initial keys of the fuzzy Hénon map and the logistic sine map as illustrated in next step.
Step 6: Generate Cipher
. The initial parameter is adjusted through the utilization of Equation (10). and subsequently integrated into the hybrid chaotic equation of the logistic sine map, as depicted in Equation (11). This incorporation facilitates the generation of a secret cipher key,
, as illustrated in Equation (12). The values of
are −1.2, 1.5, 2.1, 0.5, −0.65, and −0.7, respectively.
Given that
to ensures that the result of the operation is always between 0 and y and
is the array of
values,
is the index of the last element in the array and
is the new
value to be added to the end of the array. Algorithm 3 shows the algorithm for generating secret keys
.
Algorithm 3. Generate cipher key |
Input: Output: K1
|
Step 7: Generate Cipher
. The initial value of the parameter
is adjusted using Equation (13) and incorporated into a hybrid of the Hénon map and the triangular membership function to be used as the initial parameter,
, in Equation (14). The values from
are converted to membership values, as in Equation (16) with the left edge
, peak
and right edge
of the triangle as parameters, and used to find the centroid value
as in Equation (15). Then, the minimum and maximum possible values of
with respect to
are found and normalize the value of
C to the range [0, 0.5] using Equation (16). The resulting value of
represents the normalized crisp value that best represents the input values according to the triangular membership function, and it falls within the desired range. Based on Equation (17), the value of
is then applied to the fuzzy Hénon map. The secret key
is obtained by finding the range of numbers between 0 and
, as shown in Equation (18). The initial value for
,
,
,
,
, and
, respectively.
Algorithm 4 shows the algorithm for generating the randomly sequenced set of secret keys from fuzzy numbers and the Hénon map.
Algorithm 4. Generate cipher key |
Input: Output: K2 - 9.1
- 9.2
|
Step 8: Cipher image
Based on Equation (19), the final step involves conducting an exclusive operation between
to obtain the encrypted image,
. Exclusive operation is used in this step because it transforms intermediary ciphertext into final ciphertext by combining it with a secret key, which makes it difficult for unauthorized users to decrypt the data. The resulting final Ciphertext
is the exclusive operation of the intermediary ciphertext and the secret keys from the logistic sine map and the fuzzy Hénon map.
The flowchart of how the encryption process is shown
Figure 5. The decryption process of this scheme is the inverse of the encryption process from step 8 to step 1 above.
3.3. Decryption Process
The decryption process is an essential component of the overall encryption scheme as it enables the recovery of the original data by reversing the operations performed during encryption. It is acknowledged that certain operations, such as modulo operations, may inherently possess irreversibility. However, within our proposed encryption scheme, these operations are strategically employed in a manner that ensures the feasibility of the decryption process. For instance, the modulo operation utilized in step 4 serves the purpose of constraining the result of the summation operation within a specific range. Although it introduces a level of non-invertibility, it does not impede the decryption process from being successfully executed. The carefully designed application of irreversible operations within our encryption scheme strikes a balance between security and practicality, allowing for a robust decryption process while maintaining the necessary security measures. The following are the steps for the decryption process.
Step 1: perform an exclusive operation between the final image and to obtain an intermediary image of logistic sine map to obtain ;
Step 2: perform an exclusive operation between secret keys from the fuzzy Hénon map and to obtain intermediary image ;
Step 3: divide the intermediary image into four equal blocks and ;
Step 4: reshuffle the position of each block diagonally between and , as well as and ;
Step 4: subtract two diagonal pixel values in paired wise rows, means select two adjacent rows in an image, and subtract the pixel values diagonally across from each other, performing three iterations in each block;
Step 5: shift even columns to the left-side and even rows downwards in each block;
Step 6: reshuffle the position of each block diagonally between and , as well as and ;
Step 7: combine the blocks to obtain the original image .