Cascading quantum walks with Chebyshev map for designing a robust medical image encryption algorithm

To assess the presented method of ciphering images, we executed it on a PC powered by an Intel \({Core}^{TM}\) 2 Duo CPU 3 GHz and 4GB RAM, utilizing MATLAB software R2016b. The dataset employed comprised of ten medical images in greyscale of different sizes extracted from MedPix dataset33 and labeled PMI01, PMI02, PMI03, PMI04, PMI05, PMI06, PMI07, PMI08, PMI09, and PMI10 (see Figures 3 and 4). The initial parameters for the image ciphering system were established as: N=261, t= 267, \(\sigma\)=\(\pi /2\), \(\theta _{0}\)= \(\pi /6\), \(\theta _{1}\)= \(\pi /3\), \(\theta _{2}\) = \(\pi /4\), \({x}_{0}\)= 0.7585, \(\lambda\)=4, and M= [1100 1001 1011 0100 1110 0101 0101 0101 0001 0110 1111 0010 1010 1011 1001 0101 0010].

Figure 3

The collection of some examined images in which the top two rows depict the pristine images, and the bottom two rows display the ciphered versions of those images.

Figure 4

The collection of other examined images, in which the top row depicts the pristine images and the bottom row displays the ciphered versions of those images.

To assess the effectiveness of the proposed image cipher technique, it is necessary to evaluate its performance in terms of visual quality, the time required to cipher the medical image, and its ability to resist various types of security attacks, including randomness analysis, statistical analysis, differential attacks, key sensitivity, and occlusion attacks. The following subsections will explore these analyses to validate the effectiveness of the proposed cipher mechanism for medical images.

Visual quality

The visual quality of ciphered images refers to the extent to which a ciphered image preserves the visual details of the pristine image after encryption. The visual quality of the ciphered images is shown in Figs. 3 and 4 that are fully noised, in which the naked eye can’t obtain useful information about the pristine image from the ciphered image. To quantitatively assess the quality of the ciphered images, two widely used metrics are applied: PSNR (“Peak Signal-to-Noise Ratio”) and SSIM (“Structural Similarity Index Measure”).

$$\begin{aligned} PSNR\left( PMI,CMI\right) \mathrm{\; }=10\log _{10} \left( \frac{MAX_{PMI} \times P\times Q }{\sum _{x=1}^{P}\sum _{y=0}^{Q}[PMI(x,y)-CMI(x,y)]^{2} } \right) \end{aligned}$$

(32)

$$\begin{aligned} SSIM\left( PMI,CMI\right) =\frac{\left( C_{1} + 2\mu _{PMI} \mu _{CMI}\right) \left( C_{2} + 2\sigma _{PMI,CMI} \right) }{\left( C_{1} + \mu _{PMI}^{2} +\mu _{CMI}^{2} \right) \left( C_{2}+\sigma _{PMI}^{2} +\sigma _{CMI}^{2} \right) } \end{aligned}$$

(33)

where the maximum pixel value of the pristine image PMI is \({MAX}_{PMI}\), and CMI represents its corresponding ciphered image, both of which have dimensions of \(P \times Q\), and \({C}_{1}\), \({C}_{2}\) are constants, \(\mu\) and \(\sigma\) refer to the mean and variance, respectively. PSNR quantifies the intensity difference between the ciphered and pristine images, where lower PSNR values signify that the ciphered image is highly distinct from the pristine. SSIM is another quality metric that assesses perceptual quality by focusing on structural similarity. It measures variations in luminance, variance, and structure between two images, yielding a value from -1 to 1, with values closer to 1 indicating higher similarity. For ciphered images, a low SSIM value is typically desired, as it implies that the encryption has effectively obscured structural details. Table 1 presents the PSNR and SSIM values for ciphered images, where the low values indicate that the proposed cryptosystem generates secure cipher images with minimal visual quality resembling the original.

Table 1 PSNR and SSIM results.

Ciphering-time efficiency

To evaluate the efficiency of the proposed cipher approach in terms of computational cost, we examine it from two perspectives: computational complexity and ciphering time.

In terms of computational complexity, the encryption procedure comprises four main phases: key generation, confusion, block ciphering, and diffusion. The generated key sequence \(\{X\}\) is produced using the proposed cascading system that based on the Chebyshev map and quantum walks. Running quantum walks on an N-vertex has a computational complexity of \(\mathcal {O}(N^2)\), while the cascading system iterates \(P\times Q\) times, where PQ represents the dimensions of the original image. Therefore, the computational complexity of the key generation phase is \(\mathcal {O}(\max (N^2,PQ))\). The confusion phase is based on arranging the elements of sequence \(\{X\}\) and determining the index of each element, with a complexity of \(\mathcal {O}(PQ \log PQ)\). The block ciphering phase involves constructing two permutation boxes, two substitution boxes, and circular shifting of elements, each of which has a fixed computational complexity. The diffusion phase requires performing bitwise XOR operations with a complexity of \(\mathcal {O}(8PQ)\). Combining the computational complexities of each phase, the total complexity of the proposed encryption scheme is \(\mathcal {O}(\max (N^2,8PQ,PQ \log PQ))\).

Regarding ciphering time, the time required to encrypt an image is a key criterion for evaluating the effectiveness of any image cipher system. To demonstrate the time efficiency of the proposed cipher system, Table 2 presents a straightforward comparison of ciphering times between our approach and other related methods. The results in Table 2 confirm that our method achieves an acceptable ciphering time.

Table 2 Comparison of ciphering times (in seconds) between our cipher system and other related systems for grayscale images of different sizes.

Randomness analysis

In order to verify the randomness of the key produced from the cascading system and the constructed cipher images, we conducted NIST SP 800-22 tests, which include fifteen tests applied to a \({10}^{6}\)-bit sequence. Table 3 presents the results of these tests on the key stream (Key) used to cipher the pristine image PMI01 and the resulting cipher image CMI01, both of which passed all the randomness tests.

Table 3 NIST SP 800-22 results.

For more validation of the randomness of the generated sequences from the cascading system, we used the TestU01 suite, known for its comprehensive and rigorous testing capabilities. TestU01 offers several test batteries, including BigCrush, Crush, and SmallCrush. In this work, we used only the Crush (144 tests) and SmallCrush (15 tests) batteries due to the limited storage capacity of our PC. Also, we ran these tests with the default settings37, making no modifications. The outcomes are stated in Table 4, showing that the cascading system sequences successfully passed all tests. The results presented in Tables 3 and 4 confirm the high level of randomness and unpredictability in the sequences generated by the cascading system, indicating that they can be reliably used in contemporary cryptographic systems.

Correlation analysis

Correlation coefficient (CC) of neighboring pixels is a widely used metric for assessing the meaningful of an image. In original images, CC values typically approach 1 in all directions, whereas in ciphered images with a good-designed cipher scheme, it should be close to 0. To assess CC in both the original and ciphered images, we randomly chose \({10}^{4}\) pairs of adjoining pixels per direction. The computation of CC can be carried out using Eq. (34).

$$\begin{aligned} CC=\frac{\sum _{k=1}^{R}\left( c_{k} -\bar{c}\right) \left( p_{k} -\bar{p}\right) }{\sqrt{\sum _{k=1}^{R}\left( c_{k} -\bar{c}\right) ^{2} \sum _{k=1}^{R}\left( p_{k} -\bar{p}\right) ^{2} } } \end{aligned}$$

(34)

with R representing the total number of pairs and \({c}_{k}\) and \({p}_{k}\) representing the values of the adjacent pixels. Table 5 presents the CC results for ciphered images and their corresponding pristine images, indicating that the ciphered image values are nearly zero. Additionally, Fig. 5 illustrates the correlation distribution per direction for the PMI01 image and its cipher counterpart. However, neither the CC values nor the correlation distribution provided any meaningful information about the ciphered image.

Figure 5

Distribution of correlation in each direction for the PMI01 image and its cipher counterpart, in which the foremost row shows the distribution for the PMI01 image while the bottommost row shows the distribution for the CMI01 image.

Differential analysis

Two tests, namely UACI (“Unified Average Changing Intensity”) and NPCR (“Number of Pixels Change Rate”), are conducted to assess how sensitive the plain image is to even the slightest modifications. These tests can be expressed mathematically as follows:

$$\begin{aligned} \begin{array}{l} {NPCR=\frac{\sum _{m;n}f(m,n) }{R} \times 100\% ,} \\ {f(m,n)=\left\{ \begin{array}{c} {0\, \, if\, \, CM1(m,n)=CM2(m,n)} \\ {1\, \, if\, \, CM1(m,n)\ne CM2(m,n)} \end{array}\right. } \end{array} \end{aligned}$$

(35)

$$\begin{aligned} UACI=\frac{1}{R} \left( \sum _{m,n}\frac{\left| CM1(m,n)-CM2(m,n)\right| }{255} \right) \times 100\% \end{aligned}$$

(36)

with the total number of pixels in the image is symbolized by R and CM1, CM2 are two ciphered images generated from a single pristine image, wherein a minor bit variation is introduced in one pixel. The findings of the UACI and NPCR tests are presented in Table 6, which confirm that even the slightest alterations in the pristine image can result in significant disparities in the resulting cipher image.

Table 6 Findings of the UACI and NPCR tests.

Histogram analysis

In order to demonstrate the distribution of pixels within an image, we employed the histogram tool, which requires that the histograms of various encrypted images be similar to one another, while the histograms of various pristine images should contrast from each other. Figure 6 depicts the histograms for plain and encrypted images, where the histograms of the ciphered images are indistinguishable from each other. However, as histogram is a subjective test, we also needed a quantitative test to assess the frequency of pixel distribution within the image. For this purpose, we utilized the chi-square (\(\chi ^{2}\)) test, which can be expressed as shown in Eq. (37).

$$\begin{aligned} \chi ^{2} =\sum _{k=0}^{255}\frac{\left( y_{k} -z_{k}\right) ^{2} }{z_{k}} \end{aligned}$$

(37)

where the frequency of pixel k is denoted by \({y}_{k}\), and zk represents the expected frequency under a uniform distribution. Assuming a significance level of 0.05, \(\chi _{0.05}^{2}(255)\) is calculated to be 293.2478. If the \(\chi ^{2}\) value for a given image is less than 293.2478, it indicates that the image has a uniform distribution of pixel frequencies. The \(\chi ^{2}\) test results are presented in Table 7, where it can be observed that all cipher images have \(\chi ^{2}\) values lower than 293.2478. Hence, the proposed cipher mechanism is capable of withstanding histogram attacks.

Figure 6

Histograms for plain and cipher images.

Table 7 \(\chi ^{2}\) test findings.

Entropy analysis

Global Shannon entropy is a statistical tool that assess the distribution of pixel values in an image, which can be calculated as follows:

$$\begin{aligned} E(X)=-\sum _{k=0}^{255}r(x_{k} )\log _{2} \left( r(x_{k} )\right) \end{aligned}$$

(38)

with \(r(x_{k})\) is the probability of \(x_{k}\). For a greyscale image, there are \({2}^{8}\) possible values, and the ideal entropy value is equivalent to 8-bit. To approve the efficacy of the proposed cipher system, the entropy value of the encrypted images should be close to 8. However, global entropy alone cannot determine the true randomness of ciphered images. Consequently, local entropy can be computed by calculating the mean of global entropies for non-overlapping blocks, each containing 1936 pixels. Table 8 shows the values of local and global entropies for both pristine and encrypted images, where all entropy values for encrypted images are very close to 8-bit. Thus, the proposed cipher system is secure against entropy analysis.

Table 8 Outcomes of global and local entropies.

Keyspace and key sensitivity analyses

Keyspace refers to the range of possible keys available within a cryptosystem, essential for evaluating resilience against brute-force attacks. The proposed cryptosystem employs initial parameters (N, t, M, \(\sigma\), \({\theta }_{0}\), \({\theta }_{1}\), \({\theta }_{2}\), \({x}_{0}\), and \(\lambda\)) for operating quantum walks and iterating the cascading system. Although analyzing only the M parameter might suggest an infinite keyspace, the keyspace must be finite for practical implementation. Assuming the computational precision of digital devices is \({10}^{-16}\), the keyspace of the proposed cryptosystem is \({10}^{144}\), which is sufficiently large for use in modern cryptosystems.

Key sensitivity ensures that even slight modifications in the encryption key result in a significantly different encrypted image. In order to assess the key sensitivity of the mechanism being presented, slight variations in the ciphered keys were used to decipher the CMI01 image, as depicted in Fig. 7. To quantitatively assess key sensitivity, we employed the NPCR test, with results provided in Table 9. Based on the outcomes in Fig. 7 and Table 9, the proposed cryptosystem demonstrates a high sensitivity to small variations in key parameters.

Figure 7

Visual effects of key sensitivity.

Table 9 Quantitative results of key sensitivity.

Noise and data loss attacks analyses

Noise and data loss attacks can occur during data transmission over communication channels, such as a network or the Internet. These attacks can introduce noise or lead to the loss of portions of the transmitted data, potentially compromising its integrity and security. To mitigate such risks, encryption algorithms should be designed to be robust, capable of withstanding occlusion attacks and enabling data recovery without loss of information. In the context of the proposed cryptosystem, the effectiveness of the cipher technique against these attacks was tested by removing portions of the cipher image or adding Salt & Pepper noise, then attempting to recover the original image from the flawed ciphered image. The results, shown in Figs. 8 and 9, demonstrate that the cryptosystem successfully retrieved the original image without any loss of information in the modified sections.

Figure 8

Effects of data loss attacks, in which the highest row shows the flawed ciphered images resulting from the removal of some of their slices, while the bottom row depicts the corresponding deciphered images.

Figure 9

Effects of noise attacks with different Salt & Pepper noise densities, where the images shown are the deciphered results of the flawed ciphered images at each specified Salt & Pepper noise density.

Discussion

This paper presented a new medical image cipher mechanism based on cascading quantum walk with Chebyshev map, which the main goal of the cascading system is to prevent the generation of periodic orbits in the resulting sequence. To fulfill a high sensitivity of the plain image for the presented cipher mechanism, the hashing algorithm SHA256 is executed on the plain medical image, and the resulting hash value is utilized to update initial parameters. By using these updated parameters, we act quantum walks to produce a probability distribution vector, which is then used along with the updated initial condition to iterate the Chebyshev map and produce a chaotic sequence that relies on quantum walks and the pristine image. This sequence is used for the confusion phase of the pristine image, as well as for ciphering the blocks of the confused image and performing the diffusion phase for the ciphered blocks. Our simulation outcomes and numerical analyses have demonstrated that this cipher mechanism is both secure and highly efficient.

To evaluate the effectiveness of the proposed image encryption technique, its performance is assessed in terms of visual quality, computational cost, and resilience to various types of security attacks, including randomness analysis, statistical analysis, differential attacks, key sensitivity, and occlusion attacks. In what follows, will explore the results of these analyses to validate the effectiveness of the proposed cipher mechanism for medical images.

From the perspective of visual quality, which refers to the extent to which a ciphered image preserves the visual details of the pristine image after encryption, The visual quality of the ciphered images was shown in Figs. 3 and 4 that are fully noised, and the naked eye can’t obtain useful information about the pristine image from the ciphered image. To quantitatively assess the quality of the ciphered images, two metrics were applied: PSNR and SSIM. Table 1 presented the PSNR and SSIM values for ciphered images, where the low values indicate that the proposed cryptosystem generates secure cipher images with minimal visual quality. From the perspective of computational cost, the presented cryptosystem was evaluated from two viewpoints: computational complexity and ciphering time. The computational complexity of the proposed encryption scheme is \(\mathcal {O}(\max (N^2,8PQ,PQ \log PQ))\), which is acceptable for modern cryptosystems. To demonstrate the time efficiency of the proposed cipher system, Table 2 presented a straightforward comparison of ciphering times between our approach and other related methods. The computational cost results confirm that our method achieves a satisfactory ciphering time plus acceptable computational complexity.

Regarding resilience to various types of security attacks, several analyses were conducted, including randomness analysis, statistical analysis, differential attacks, key sensitivity, and occlusion attacks. To verify the randomness of the key generated by the cascading system, Table 3 presents the results of NIST SP 800-22 tests on the keystream used to encrypt the original image PMI01 and the resulting ciphered image CMI01, both of which passed all randomness tests. For further validation of the randomness of the sequences generated by the cascading system, we used the TestU01 suite, with results shown in Table 4, indicating that the cascading system sequences successfully passed all tests. The results presented in Tables 3 and 4 confirm the high level of randomness and unpredictability in the sequences generated by the cascading system, demonstrating that they can be reliably used in contemporary cryptographic systems. The correlation coefficient of neighboring pixels is a widely used statistical metric for assessing the structure of an image. In original images, CC values typically approach 1 in all directions, whereas in ciphered images with a well-designed cipher scheme, it should be close to 0. Table 5 presented the CC results for ciphered images and their corresponding pristine images. The average values of CC per direction are -0.00015, -0.00028, 0.00000, indicating that the ciphered image values are nearly zero. Additionally, Fig. 5 illustrates the correlation distribution per direction for the PMI01 image and its cipher counterpart. However, neither the CC values nor the correlation distribution reveal any meaningful information about the ciphered image. To assess the sensitivity of the plain image to minor modifications, two differential tests were used: UACI and NPCR. Table 6 provides the outcomes of these tests. The average values of UACI and NPCR are 33.48095% and 99.62984%, respectively, confirming that even the slightest alterations in the pristine image can lead to significant differences in the resulting ciphered image. To illustrate the pixel distribution within an image, we used the histogram tool. Figure 6 showed the histograms for both the plain and ciphered images, where the histograms of the ciphered images appear indistinguishable from each other. However, since the histogram is a visual test, we also employed the \(\chi ^{2}\) test. Table 7 provides the \(\chi ^{2}\) test results, showing that all encrypted images have \(\chi ^{2}\) values lower than 293.2478, indicating a uniform distribution of pixel frequencies in the encrypted images. Thus, the proposed encryption mechanism is capable of withstanding histogram attacks. To assess the randomness of pixel values within encrypted images, we utilized local and global entropy measurements. Table 8 presents the local and global entropy values for both the original and encrypted images, showing that all entropy values for the encrypted images are very close to the maximum 8-bit value. This indicates that the proposed encryption system is secure against entropy analysis. Keyspace and key sensitivity are essential metrics to evaluate the security of any image cryptosystem. The keyspace of the proposed cryptosystem is \({10}^{144}\), which is sufficiently large for use in modern cryptosystems. For assessing the key sensitivity, slight variations in the ciphered keys were used to decipher the CMI01 image, as depicted in Fig. 7. To quantitatively assess key sensitivity, we employed the NPCR test, with results provided in Table 9. Based on the outcomes in Fig. 7 and Table 9, the proposed cryptosystem demonstrates a high sensitivity to small variations in key parameters. To assess the effectiveness of the proposed cryptosystem against occlusion attacks, portions of the ciphered image were removed at various sizes, or Salt & Pepper noise was added at different densities, and then an attempt was made to recover the original image from the altered ciphered image. The results, shown in Figs. 8 and 9, demonstrate that the cryptosystem successfully retrieved the original image without any information loss in the modified sections.

When evaluating the effectiveness of an encryption mechanism, it is important to compare its performance against other similar cryptosystems. This permits us to decide if the proposed system is indeed an improvement over existing systems and whether it provides adequate security for the intended application. Table 10 provides a comparative analysis of the presented cipher mechanism against other related cipher systems. It presents the average values of several metrics, including Chi-square, UACI, NPCR, information entropy, and correlation, which are commonly utilized to estimate the effectiveness of cipher algorithms. By comparing the average values of these metrics for the presented cipher algorithm with those of other related cryptosystems, the efficacy of the proposed system can be inferred.

Table 10 Comparative analysis of the presented cipher technique against other related cipher systems.

Leave a Comment