Region of Interest-Based Medical Image Encryption Technique Based On Chaotic S-Boxes
Region of Interest-Based Medical Image Encryption Technique Based On Chaotic S-Boxes
A R T I C L E I N F O A B S T R A C T
Keywords: Block cipher has been one of the most reliable options by which data security is achieved. The strength of block
Medical images cipher against various attacks is purely dependent on its confusion property, which is gained through the S-
Chaos based S-box construction Boxes. In recent years, S-Boxes based on chaotic maps have become popular due to their favorable characteristics
Block cipher
for cryptography. However, vulnerabilities have been discovered in these constructions, leading to concerns
Chaotic systems
DICOM encryption
about their reliability. In this research, we first generate dynamic S-Boxes, and then based on the newly
generated S-Boxes, a ROI-based medical image encryption scheme is proposed to address the challenges posed by
the large size of DICOM images. Rather than encrypting the entire DICOM image, proposed encryption scheme
only encrypts the ROI part where the relevant information is present, while leaving the black background
unencrypted. This approach reduces the size of the encrypted data and improves the efficiency of the encryption
process, while maintaining the privacy and confidentiality of sensitive medical data. The proposed ROI-based
medical image encryption scheme is evaluated using standard performance metrics, including encryption
speed, image quality tests, correlation-coefficient analysis, randomness of encrypted images, key sensitivity
analysis, encryption sensitivity analysis, decryption sensitivity analysis, and resistance against common attacks
such as differential and linear attacks. The proposed dynamic S-Box construction technique is evaluated using
standard S-Box criteria, which include nonlinearity score, bit independence criterion, strict avalanche criteria,
linear approximation probability, and differential approximation probability. Results demonstrate that the
proposed technique gains high levels of encryption efficiency and security, making it a fast solution for secure
medical image transmission in real-world applications.
* Corresponding author.
E-mail addresses: [email protected] (S.S. Jamal), [email protected] (M.M. Hazzazi), [email protected] (M.F. Khan), [email protected]
(Z. Bassfar), [email protected] (A. Aljaedi), [email protected] (Z. ul Islam).
https://doi.org/10.1016/j.eswa.2023.122030
Received 2 June 2023; Received in revised form 3 October 2023; Accepted 3 October 2023
Available online 17 October 2023
0957-4174/© 2023 Elsevier Ltd. All rights reserved.
S.S. Jamal et al. Expert Systems With Applications 238 (2024) 122030
images and highlighted the necessity of implementing robust security the size of the encrypted data and improves the efficiency of the
measures to prevent such breaches. The authors also discuss the chal encryption process.
lenges associated with implementing these measures, such as the pos Primary contribution of this research is summarized as:
sibility of increased processing time. Authors in (Devi & Mohapatra,
2023) propose a secure communication system for DICOM images that a. ROI based image cipher: Instead of encrypting the entire DICOM
ensures confidentiality during transmission through watermarking and image, our proposed method selectively encrypts only the ROI-based
encryption techniques. Their system includes a secure key distribution image where the relevant information is present, while leaving the
mechanism to restrict access to decryption keys to authorized parties, black background unencrypted. This approach reduces the size of the
but this may increase processing time. encrypted data and improves the efficiency of the encryption
Authors in (Bhattacharjee et al., 2022) suggest a system that employs process.
FPGA-based encryption module to provide efficient and secure encryp b. ROI extraction algorithm
tion of medical images, as traditional software-based encryption c. Round Key generation algorithm
methods are time-consuming and resource-intensive. Their proposed d. Overcomes the Single map based S-box constructions Issues
hardware-based encryption technique for DICOM images aims to
address the performance issues of software-based encryption. The au The paper is structured as follows: Section 2 introduces the proposed
thors argue that software-based encryption techniques can cause sig methodology, Section 3 discusses the results and evaluation of the
nificant delays in image transmission and processing, potentially proposed method, and Section 4 gives the conclusion. The entire system
impacting the quality of patient care. Authors in (Prasanalakshmi et al., architecture is depicted in Fig. 1.
2022) suggest a supercomputing-based approach for efficient encryption
of DICOM images, using parallel processing techniques to achieve high- 2. Proposed methodlogy
speed encryption and reduce processing time. To achieve this, the au
thors set up a cluster of high-performance computing nodes to perform Block cipher has been a standout amongst the most reliable option by
encryption operations in parallel. In the first section of the proposed which data security is accomplished. The strength of block ciphers
method, we presented a fusion of the logistic map and tent map, which against various attacks depends on the effectiveness of their substitution
overcomes the limitations and security issues associated with single boxes. It is the responsibility of the substitution box(S-box) to make the
map-based S-box constructions. In the second phase, we proposed a correlation between cipher text and the key as indiscernible as possible
novel medical image encryption technique based on the dynamical S- Over the past decade, substitution boxes based on chaotic maps have
boxes from phase − 1. Instead of encrypting the entire image, we been extensively constructed and designed due to their favorable char
selectively encrypt the only ROI part where the relevant information is acteristics for cryptography (Prasanalakshmi et al., 2022) (Khan,
exists. Black background of the image is left unencrypted, which reduces Ahmed, Saleem, & Shah, 2022). However, in recent years many
2
S.S. Jamal et al. Expert Systems With Applications 238 (2024) 122030
Fig. 2. The first row of the chart shows the bifurcation diagram for three different chaotic maps (a) Logistic map, (b) Tent map (c) LogisticTent map. The second row
displays the Lyapunov spectrum for each map with parameters.
cryptographers have discovered vulnerabilities in single chaotic map 1,) are denoted by xn in Eq. (1). Initial value is denoted as x0 and b lies in
based S-box designs. The ultimate solution of these S-box vulnerabilities between 3.57 and 4. F(x) is a map of xn ∈ (0, 1)→xn+1 ∈ (0, 1). The
are True Randomness. These vulnerabilities include dynamical degra sequence of {x0, x1, x2, …} produced by x0∈(0,1) and its state values
dation (Alharbi et al., 2023) (Fahad Khan et al., 2022) (Siddiqui et al., appear to be irregular or random(0,1). The bifurcation diagram and the
2020), predictability (Fahad Khan et al., 2022) (Siddiqui et al., 2020) Lyapunov spectrum is shown in Fig. 2a. We used following equation to
(Shah et al., 2020), discontinuity in chaotic sequences (Jamal et al., get Lyapunov spectrum.
2019) (Khan, Ahmed, Saleem, & Shah, 2019) (Khan, Ahmed, & Saleem,
2019), a small number of control parameters in chaotic maps (Siddiqui 1 ∑ N− 1
LE = lim ( loge |f′(xn )|) (2)
et al., 2020) (Jamal et al., 2019) (Khan, Ahmed, Saleem, & Shah, 2019), N→∞N
n=0
and finite precision effects (Jamal et al., 2019) (Khan, Ahmed, Saleem, &
Shah, 2019) (Khan, Ahmed, & Saleem, 2019) and frail chaos (Khan, 2.1.2. Chaotic tent map (CTM)
Ahmed, & Saleem, 2019) (Baig et al., 2016) (Sun et al., 2023). These CTM maps a value from an interval to another interval by folding it in
vulnerabilities can be exploited by attackers to identify patterns, reduce half and then reflecting it. The map’s name becomes evident from its
complexity, and determine the key, which undermines the security of tent-shaped structure, which is visible in the bifurcation diagram
the cipher. The proposed technique has two phases: the first is con depicted in Fig. 2b. This map indicates chaos in the range of [2, 4] as can
struction of S-boxes based on chaotic logistic-tent system and the second be seen in Lyapunov Exponent and bifurcation diagrams:
phase is ROI based image cipher. ⎧ zn
⎪
⎨ γ 2 zn < 1/2
⎪
2.1. S-boxes construction based on chaotic logistic-tent system zn+1 = zn ∈ [0, 1] (3)
⎪
⎪ γ(1 − zn )
⎩ zn > 1/2
2
Strength of block ciphers verses many attacks relies only on the
The CLM and CTM systems have some drawbacks. Firstly, limited
effectiveness of their substitution boxes. It is the responsibility of the
range only from 3.57 to 4 and the CTM system having a chaotic
substitution box (S-box) to make the correlation between cipher text and
parameter range b∈(2,4]. Secondly, when b < 4, it is not possible for the
the key as indiscernible as possible. S-box is a m × n mapping
system state value to cover the entire range of (0, 1).
S: {0, 1} m → {0, 1} n, transforming input vector × = [xn-1, xn-2, xn-3
… x0] into output vector y = [yn-1, yn-2, yn-3 … y0].
2.1.3. Chaotic logistic-tent system (CLTSM)
Due to a partial chaotic range of both seed maps i.e. logistic and tent
2.1.1. Chaotic logistic map (CLM)
maps, there is a need for chaotic map whose range is improved as related
CLM is a mathematical model that displays complex, nonlinear
to original seed maps. CLTS is a nonlinear fusion of earlier discussed
behavior. Equation (1) presents the mathematical model of the logistic
maps [15]. The LTS exhibits exceptional complex chaotic properties.
map.
Modules operator is to ensure that the output range of data is in the
xn+1 = f(xn ) = bxn (1 − xn ), b ∈ (0, 4]) (1) range of [0, 1]. By integration of the tuning parameters of the seed maps,
th the expression is written in the form:
The system’s state values at the n discrete time point (where n = 0,
3
S.S. Jamal et al. Expert Systems With Applications 238 (2024) 122030
Table 1
Proposed sample S-Box based on CLTSM.
221 4 77 193 247 219 195 245 58 241 183 38 114 220 202 14
{
zn+1 =
(σ zn (1 − zn ) + (4 − σ)zn /2)mod1zi < 1/2
(4) here ϑ is named as a linear fractional transformation (LFT) and its
(σ zn (1 − zn ) + (4 − σ )(1 − zn )/2 )mod1zi > 1/2 ( )
parameter value is from GF 28 . It is necessary to fulfill the non-
degeneracy condition μσ − πρ ∕ = 0. Due to the nonlinearity of LFT, it
where 0 < σ ≤ 4. The chaotic range interval of the LTS has been
gives us the opportunity to employ this map for byte substitution. For
extended up to an interval of (0,4] and the output sequences are evenly
LFT,μ = 21, π = 8, ρ = 3 and σ = 17 is selected. The outcomes of
distributed in the range of [0, 1] as observed in Fig. 2c. From Property 1,
equation (4) represent the 28 values of the sample S-box as depicted in
it can be inferred that the state values of CLTSM are limited.
the Table 1. For results we generated 15,000 S-boxes and observed that
Properties 1. When a ∈ (0, +∞) and b ∈ [0, a], zn+1 is a mapping
6761 of them had a nonlinearity (NL) of 108 or less, while 3485 had a NL
of.xn+1 ∈ (0, 0.5) ∪ (0.5, 1)
between 109 and 110, and 4754 had a NL between 111 and 112.
Proof. The function’s monotonicity within the given interval can be
Equation (7) is employed for generating the S-boxes. To achieve this, we
demonstrated by examining the sign of its derivative, which is given by
utilized various values for the parameters μ, π, ρ, and σ in order to
the derivative function of f (xn):
generate a distinct set of output values. These parameters control the
⎧
⎪
⎪
4b 2(a − b) behavior of the LFT and, consequently, change the values produced by
⎨ (1 − 2xn ) − , 0 < xn < 0.5, a > 0, 0 ≤ b ≤ a
′ a a ϑ(y).
f (xn ) =
⎪
⎩ 4b (1 − 2xn ) − 2(a − b), 0.5 ≤ xn < 1, a > 0, 0 ≤ b ≤ a
⎪
a a 2.1.5. S-boxes evaluation criteria
(5)
2.1.5.1. Nonlinearity score. The nonlinearity of a function quantified by
Equation (5) implies that:
the number of bits needed to be altered to obtain the nearest affine
⎧
⎪ ′ ′ 4b 2(a − a)
⎪
⎨ f (xn ) > f (xn = 0.5)|b=a = (1 − 2 × 0.5) + = 0, 0 < xn < 0.5, a > 0, 0 ≤ b ≤ a
a a
(6)
⎪
⎩ f′(xn ) < f′(xn = 0)| = 4b (1 − 2 × 0) + 2(a − a) ∕
⎪
= 0, 0.5 ≤ xn < 1, a > 0, 0 ≤ b ≤ a
b=a
a a
While xn is within the interval (0, 0.5),f (xn) monotonically increases function. The proposed S-Box has a nonlinearity score of 112, which is
over this interval due to f ‘(xn) > 0. Therefore, it follows that f(0) < f(xn) equal to or better than the scores of 30 other recently published S-Boxes.
< f(0.5), which implies that 0 < f(xn) < 1. On the other hand, when xn is Table 2 compares the proposed S-Box with other S-Boxes.
within the interval (0.5,1), f(xn) monotonically decreases over this in
terval f ‘(xn) < 0. So this implies that: f(1) < f(xn) < f(0.5) hence, if xn ∈ 2.1.5.2. Strict avalanche criteria (SAC). SAC evaluates the strength of S-
(0, 0.5) ∪ (0.5, 1) then 0 < f(xn) < 1. Box. It requires that changing an input bit causes exactly half of the
output bits to change on average. The SAC score of the proposed S-Box is
2.1.4. Dynamic S-box construction based on CLTSM 0.5017, and it is compared with 30 other S-Boxes in Table 2, showing its
The general linear group GL(n, F) (F represents the field) consists of equal or better performance in achieving secure cryptographic systems.
all invertible square matrices of the same size. The quotient group of
GL(n, F) by its center is a projective general linear group (PGL) of degree 2.1.5.3. Bit independence criterion (BIC). It assesses the statistical in
m over a field F. The group action of Galois field GF(28 ) on the PGL (2, dependence of S-box input and output bits, meaning that knowledge of
GF(28 )) helps to obtain 8 × 8 S-box. This S-box has different 256 values some input bits should not reveal output bit information. The correlation
which help us to obtain confusion in our cryptosystem. Briefly, consider between input and output bits should be as close to zero as possible for
the function g such that: g : PGL(2, GF(28 )) × GF(28 ) →GF(28 )) is given all bit positions. S-boxes meeting this criterion are more resistant to
as: cryptanalysis, making them a critical consideration for cryptographic
algorithms. S-box with higher BIC score is considered more secure.
μy + π
ϑ(y) = (7) Table 2 compares our sample S-Box with 30 other recently published S-
ρy + σ
4
S.S. Jamal et al. Expert Systems With Applications 238 (2024) 122030
Table 2 (a•x = b•S(x)) is the probability that the linear approximation a•x = b•S
Comparative Analysis. (x) holds for randomly chosen a, b and x. 1/2 is the expected probability
S-box Max SAC BIC- BIC- DP LP for a random function to satisfy the linear approximation. Our proposed
Nonlinearity NL SAC S-Box has a Linear Approximation Probability (LP) score of 0.0625.
Proposed S-box 112 0.5017 104 0.4591 30 0.0625 Table 2 compares our sample S-Box with 30 other recently published S-
(Yong & Peng, 112 0.5012 104 0.5056 8 0.0937 Boxes, and the results indicate that our S-Box has a competitive LP value
2012) when compared to other S-Boxes.
(Ahmad et al., 108 0.5034 100 0.4951 10 0.1328
2018)
(Tian & Lu, 108 0.4978 100 0.5029 10 0.1328 2.1.5.5. Differential approximation probability (DP). It is the probability
2016) that a given input difference Δx will produce a given output difference
(Ahmad et al., 108 0.4946 96 0.5018 10 0.1328 Δy after passing through the S-box[19]. It is calculated as: DP(Δx, Δy) =
2015) Prob(S(x) ⊕ S(x ⊕ Δx) = Δy) where S(x) represents the output of the S-
(Alzaidi, Ahmad, 108 0.5034 98 0.498 12 0.1328
Ahmed, et al.,
box for input x. Δx and Δy are input and output differences. x ⊕ Δx
2018) represents the input that differs from x by Δx. S(x) ⊕ S(x ⊕ Δx) repre
(Farah et al., 108 0.4941 98 0.4957 10 0.125 sents the output difference resulting from the input difference Δx. Prob
2017) (S(x) ⊕ S(x ⊕ Δx) = Δy) represents the probability that the output dif
(Ahmed et al., 108 0.4076 98 0.5022 10 0.1328
ference is equal to Δy, given the input difference Δx. Our proposed S-Box
2019)
(Zhang et al., 110 0.5017 100 0.5026 10 0.1328 has a DAP score of 10. Table 2 compares our sample S-Box with 30 other
2018) recently published S-Boxes, and the results indicate that our S-Box has a
(Khan, Saleem, 107 0.5066 96 0.5065 12 0.1445 competitive DP value when compared to other S-Boxes.
Hazzazi, et al.,
2022)
(Alzaidi, Ahmad, 110 0.4976 100 0.5023 10 0.125 2.2. Region of interest based image cipher
Doja, et al.,
2018)
(Khan, Ahmed, 112 0.5058 112 0.504 4 0.0625
The proposed algorithm starts by identifying the ROI in the DICOM
Saleem, & image. ROI extraction algorithm is presented in the following. A 16-bit
Shah, 2019) S-box is generated using a Dynamic S-box Construction based on CLTSM
(Khan, Ahmed, 112 0.4987 112 0.4993 4 0.0625 technique, and each pixel value in the sub-block is mapped to a new
Saleem, &
pixel value using the CLTM based S-box. The image pixel data is con
Shah, 2019)
(Khan, Ahmed, & 112 0.5058 112 0.502 4 0.0625 verted into 8-bit binary which can easily be divided into two sets of 4
Saleem, 2019) bits each i.e. MSBs and the LSBs. These 2 sets of 4 bits are converted into
(Baig et al., 112 0.504 112 0.502 4 0.0625 decimal values so that a specific value from S-box table is obtained for
2016) the process of substitution. Here, it is necessary to mention that MSBs
(Su et al., 2023) 108 0.5026 100 0.5002 12 0.1172
(Attaullah et al., 112 0.5031 112 0.5028 4 0.0625
decimal value indicates the row of CLTM S-box whereas LSBs decimal
2018) value indicates the corresponding column value. In the same manner, all
(Zamli et al., 108 0.4931 102 0.5 10 0.125 the pixel values of digital data are substituted with CLTM S-box to obtain
2023) confusion. The sub-blocks are then combined to form a new block, which
(Sani et al., 110 0.4988 102 0.5010 30 0.125
is further permuted using a 16-bit P-box generated from the same
2023)
(Si et al., 2023) 108 0.5031 96 0.5074 12 0.1484 random encryption key. The substitution process is followed by per
(Wang et al., 112 0.4861 108 0.5020 6 0.0859 mutation for obtaining diffusion. For each image pixel value, the binary
2023) value is changed into decimal. By hobbling the rows and columns of the
(Raj et al., 2023) 110 0.5026 102 0.5026 10 0.1406 substituted data with the help of chaotic CLTSM, the permutation is
(Yang et al., 112 0.4985 98 0.4992 8 0.125
2023)
obtained in accordance with equation 8, given as:
(Artu\uger, 110 0.5073 100 0.502 10 0.1523 {
ISUB (:, l(i)) = ISUB P ( :, i)
2023)
(Gakam Tegue 110 0.5015 98 0.5016 10 0.1484
ISUB (l(i), :) = ISUB P ( i, : )
et al., 2023) (8)
(Muhammad 110 0.4985 98 0.5020 10 0.1328
Waseem & where I_SUB and I_(SUB P) represents the DICOM images after being
Hwang, 2023)
through processes of substitution and permutation respectively. The
(AbdElHaleem 110 0.4995 98 0.4983 10 0.1172
et al., 2022) next step involves dividing the block into non-overlapping 8x8 sub-
(Alharbi et al., 108 0.4943 98 0.4982 10 0.125 blocks, and DCT is computed for each sub-block. A 64-bit key is gener
2023) ated using a formula involving the encryption key and the row and
(Hamza et al., 110 0.4946 94 0.5054 10 0.1328 column indices of the sub-block. The DCT coefficients are divided into
2019)
(Abdullah & 112 0.5 104 0.5052 10 0.125
eight non-overlapping 8x8 sub-blocks, and a round key is generated for
Abduljaleel, each sub-block. Each DCT coefficient is then XORed with the corre
2023) sponding round key, and the inverse DCT is computed for each sub-
block. DCT is itself a linear transformation which is perfectly lossless
and invertible. Information loss only occurs when the DCT coefficients
Boxes, and the results indicate that our S-Box has a competitive BIC
are quantized because in this process transformed values are rounded to
value when compared to other S-Boxes.
a limited set of values. However in our proposed algorithm quantization
phase not involved. The round key algorithm is mentioned in the
2.1.5.4. Linear approximation probability (LP). It is a measure of how following, which takes 16-byte encryption key and produces unique
well a S-box can be approximated by a linear function. A low linear round keys for the desired number of rounds. Finally, the encrypted ROI
approximation probability indicates that a S-box is resistant to linear is combined with the original image to form the final encrypted image.
attacks and provides a high level of security. The formula for linear ROI extraction algorithm only operates on average value of the blocks
approximation probability test is LP(S) = Pr(a•x = b•S(x)) - ½, where Pr and it does not reveal any specific details about the individual pixels of
5
S.S. Jamal et al. Expert Systems With Applications 238 (2024) 122030
Fig. 3. Sample medical images are shown the first row. Encrypted images using the ROI-based technique are shown in the second row. The third row shows fully
encrypted images, in which the same proposed technique is implemented without the ROI.
Fig. 4. The statistical characteristics of the test images (Fig. 3) are plotted after encryption.
6
S.S. Jamal et al. Expert Systems With Applications 238 (2024) 122030
the image or person’s identity. The proposed algorithm ensures the se (continued )
curity of medical images as the encryption key and the generated keys Algorithm: ROI Extraction
for each sub-block are randomized. The entire algorithm is presented in 4. Conduct a row-wise examination of matrix Q. For each row i, identify the first
the following. element with a value of 1, denoting as Q (i, column1) = 1. Similarly, locate the last
element with a value of 1 and denote it as Q (i, column2) = 1. Subsequently,
Algorithm: ROI based Image Encryption designate all elements within the range column1 to column2 in that row as 1,
represented as Q (i, column1:column2) = 1. Maintain a record of the current row i,
Input: A DICOM image I and an encryption key K
column1, and column2 within an array referred to as marking information Target
Output: A ROI encrypted DICOM image I_encrypted
Region(TR) = [TR; i, column1, column2]. If the entire row consist of zeros, skip this
1. Divide the I into non-overlapping blocks of size B × B
row during processing.
2. Compute H = - Σ p * log2(p) for each block
5. Read each chunk image in the chunk_ImageSet collection. Chunk images
3. Identify the block with the maximum entropy Hmax
corresponding to Q (i, j) = 1 are identified as TRs, while those not meeting this
4. Divide the block with Hmax into non-overlapping 4x4 sub-blocks
criterion are categorized as Regions of Non-Interest(RONIs). Transform both TRs
5. For each sub-block compute, Sum of pixel S = Σ I(i,j) & Average pixel value A = S/
and RONIs into one-dimensional sequences.
16
6. Parse the marked TR into a fixed-length binary sequence. For each triplet (i,
6. For each sub-block, compute Si = (Ki % 16) + (i * j) % 16. Lookup a new pixel value
column1, column2), encoding is performed as follows: row number i requires
from a CLTSM S-box using Si to replace each I(i, j) within the sub-block: I’(i,j) = S-
⌈log2⌈M/s + 1⌉⌉ bits, whereas column1 and column2 require ⌈log2⌈N/s + 1⌉⌉ bits
box[Si].
each.
7. Combine all the sub-blocks to form a new block I’
8. Generate a 16-bit P-box using Pi = (Ki % 16) + (i * j) % 16. Permute the pixel values
in the block I’ using the P-box: I’’(i,j) = I’(P(i, j), P(i, j)).
9. Permute the pixel values in the block I’ using the P-box: I’’(i,j) = I’(Pi ⊕ i, Pi ⊕ j)
10. Divide the block I’’ into non-overlapping 8x8 sub-blocks Algorithm: Round Key Generation
11. For each sub-block compute: F(u,v) = 1/4 * C(u) * C(v) * Σ Σ I’’(x,y) * cos[(2x +
1)uπ/16] * cos[(2y + 1)vπ/16] where C(u) = 1/ √2 for u = 0 and C(u) = 1 for u ∕ = 1. Divide the UserEntered_key into 8 segments, each consisting of 2 bytes. Store these
0 segments in the key_segments list.
12. Generate a 64-bit key using K’(i) = (Ki % 64) + (i * j) % 64 2. For each round, repeat required_rounds times
13. Perform DCT[i,j] = [DCT(u,v)] where i*8 ≤ u ≤ (i + 1)8–1& j8 ≤ v ≤ (j + 1)*8–1, 3. Calculate the next value of n using the CLTSM by using the Eq.(4). Where Θ as a
for 0 ≤ i, j ≤ 7 floating-point number, initialized by summing all bytes of UserEntered_key and
14. For each sub-block, generate a 8-bit round key using RK(i) = K’(i) % 256 dividing by 256.
15. Apply XOR on each DCT coefficient and corresponding round key F’(u,v) = F(u,v) 4. Generate a random byte round_byte by converting the current value of n to an
⊕ RK((u-1)*8 + v) integer between 0 and 255: round_byte = int(n * 256)
16. Compute the inverse DCT for each sub-block using I’’’(x,y) = 1/4 * Σ Σ C(u) * C(v) 5. Retrieve the next key segment from the key_segments list based on the current
* F’(u,v) * cos[(2x + 1)uπ/16] * cos[(2y + 1)vπ/16] round, key_segment = key_segments[current_round % len(key_segments)]
17. Combine all the sub-blocks to form a new block I’’’ 6. Iterate over the bytes of round_byte and key_segment in pairs. For each pair of
18. Perform XOR between new block I’’’ & the P-box by using I’’’’(i,j) = I’’’(i,j) ⊕ P bytes, perform a bitwise XOR between the corresponding bytes from round_byte
(Pi ⊕ i, Pj ⊕ j) and key_segment. Then store the result of each XOR operation as a byte in the
19. Combine the encrypted ROI(E) with the original image(O) as: I_encrypted = O ∪ E modified round key.
7. Append the round_key to the round_keys list.
7
S.S. Jamal et al. Expert Systems With Applications 238 (2024) 122030
Fig. 6. R channel histograms for both the plain image of flowers (a) and its encrypted image (b).
Fig. 7. R channel histograms for both the plain image of axial CT (a) and its encrypted image (b).
Fig. 8. R channel histograms for the ROI in the plain image axial CT (a) and its selectively encrypted image (b).
test image after encryption are illustrated in plots which are shown in them successfully. Specifically, the proposed scheme selectively en
Fig. 4. Strength of the proposed technique remains unchanged irre crypts 63 %, 56 %, 65 %, and 77 % of the original images’ ROI. The
spective of whether selective or full encryption is used. However, mul proposed scheme is capable of recovering plain images from their ROI-
tiple standard tests conducted for both ROI and full encryption based encrypted blocks. The encryption algorithm maintains statistical
techniques. We recommend using square blocks with dimensions of 8x8, consistency across all four images, as s = 1002, which records as
denoted as s = 8, and s = 1002 for selective encryption. For grayscale 194871863.16.
images, ’p’ is set at 512, and for color images, ’p’ is set at 1536. In cases
where it is not possible to meet these requirements. If it is not possible to 3.1. Analysis of statistical measures and security
meet these requirements, then encrypt the entire image. The experi
mental results indicate that these blocks have a statistical measure The purpose of this section is to demonstrate the effectiveness of a
significantly exceeding the threshold s = 1002. The proposed scheme is suggested image encryption technique against statistical cryptanalysis
verified to accurately select ROI-based encrypted blocks and decrypt attacks, such as differential and key search attacks. Results shows that
8
S.S. Jamal et al. Expert Systems With Applications 238 (2024) 122030
Fig. 9. Scatter plots of the Flowers image in the RGB channel indicate the correlation-coefficient analysis of randomly chosen adjacent pixels (a) Before encryption
(b) After encryption.
Fig. 10. Scatter plots of the axial CT image in the RGB channel indicate the correlation-coefficient analysis of randomly chosen adjacent pixels (a) Before encryption
(b) After encryption.
Fig. 11. Scatter plots of the selective ROI section of an axial CT image in the RGB channel indicate the correlation-coefficient analysis of randomly chosen adjacent
pixels (a) Before encryption (b) After encryption.
our proposed technique is highly resilient to these types of attacks when encrypted because its ROI encompassed the entire image, while the
r is greater than or equal to 3. Different types of medical images are used Brain image underwent both full and selective encryption, with its ROI
to test the strength of proposed work. We have created tests using a test comprising approximately 80 % of its size. In all tests, r was set to 3. For
image of a flowers as well as medical images such as ultrasound, axial full encryption, the parameter f was set to 512x4 for flowers. For se
CT, X-ray of feet, and brain CT. The entire flowers image is fully lective encryption of Brain, the parameter p is set to 1536. To illustrate
9
S.S. Jamal et al. Expert Systems With Applications 238 (2024) 122030
Table 3
Analysis of correlation coefficients in horizontal, vertical, and diagonal directions.
IMAGES HORIZONTAL VERTICAL DIAGONAL
Table 4
NIST Statistical Randomness Test Results of Encrypted image Flower.
Type of Test P-Value Conclusion
the effectiveness of the suggested image encryption scheme further, encrypted part. G and B, channel histograms show similar patterns but
Fig. 5 displays the plain image of flowers next to its corresponding fully are not added in the paper. From the Figs. 6–8 we can judge that the
encrypted image. The proposed method is very effective in protecting plain image histograms have a discernible structure, while the encrypted
against statistical cryptanalysis attacks, making it a robust alternative image histograms exhibit a uniform distribution (0–255). From histo
for securing medical images. gram analysis we can conclude that the encrypted image histograms do
not show any useful information of plain image.
10
S.S. Jamal et al. Expert Systems With Applications 238 (2024) 122030
Table 5
NIST Statistical Randomness Test Results of Encrypted ROI based axial CT image.
Type of Test P-Value Conclusion
lation coefficient value should be approximately 1 before encryption the both whole images and the selectively encrypted ROI images. The
and approximately 0 after encryption. Fig. 9a and Fig. 10a illustrate the correlation coefficient analysis in the horizontal, vertical, and diagonal
pairs of neighboring pixels of the plain test images flowers and axial CT directions is shown in Table 3.
respectively. Where Figure 9b and Fig. 10b illustrate the pairs of
neighboring pixels of the encrypted test images flowers and axial CT 3.4. Measuring randomness of encrypted images
respectively. 11a and 11b also illustrates the groups of neighboring
pixels in the selective ROI section of an axial CT image. Fig. 11a shows To test how random an encrypted image is, we need to first convert it
the pairs of pixels before encryption, while Fig. 11b shows the pairs of into binary. This process have two simple steps. Firstly, we convert each
pixels after encryption. The correlation coefficient between adjacent pixel in the image to its binary format then the binary values of each
pixels is calculated by using a equation (9) to (11) which takes the xi and pixel concatenated to create a single binary sequence. Secondly this
yi of the two adjacent pixels, N represents total number of pixel groups. sequence is divided into the 2048-bit blocks and then each block is
E(x) and E(y) are the μ of xi and yi[20]. evaluated through NIST statistical test suit. For the results, the encrypted
√̅̅̅̅̅̅̅̅̅̅√̅̅̅̅̅̅̅̅̅̅ flower image and the ROI based axial CT image are tested and the results
rxy = cov(x, y)/( D(x) D(y) (9)
of these tests are presented in Tables 4 and 5, respectively. Both the
entire flower image and the selected axial CT image passed the
1 ∑N
randomness tests and exhibited high-quality randomness, demon
cov(x, y) = (xi − E(x))(yi − E(y)) (10)
N i=1 strating that our proposed scheme is robust and does not contain any
patterns.
1 ∑N
1 ∑N
D(x) = (xi − E(x))2 , E(x) = xi (11)
N i=1 N i=1 3.5. Differential attacks
From Fig. 9b, 10b, and 11b, It is clear that the proposed technique Differential attack refers to a type of attack where the attacker selects
effectively removes the connections between neighboring pixels from the input and observes the resulting output to analyze the differences
11
S.S. Jamal et al. Expert Systems With Applications 238 (2024) 122030
Fig. 12. NPCR and UACI tests for two sets of images. First set is acquired by encrypting an image using two minorly changed secret keys (first row). Second set is
acquired by decrypting an image using two minorly changed secret keys (second row).
between them. The two widely used evaluation metrics for testing the NPCR% of the selective part of the axial CT image is 99.63582. In (12)
resistance against differential attack are the NPCR and the UACI. The and (13), we define both the criterion as follows:
UACI takes original and encrypted image and calculates the mean con [ ⃒ ( ) ( )⃒]
∑⃒E11 x1, y1, − E12 x1, y1, ⃒
centration of variances between them. The strength of cryptosystem UACI =
1
× 100% (12)
against differential attacks is guaranteed if the UACI value/z approxi L1 × W1 x1, y1 255
mately equal to 33.333 %. On the other hand, a high NPCR value in
∑
dicates an increased resistance against plaintext attacks. As the NPCR x1, y1 D1 (x1, y1, )
value approaches 100 %, the system becomes more robust against such NPCR = (13)
L1 × W1
attacks. The UACI% of the encrypted flowers image is 33.67251 and the
{ ( )
UACI% of fully encrypted axial CT image is 33.58321 similarly the UACI ( ) 0, if E11 (x1, y1, ) = E12 ( x1, y1, )
D1 x1, y1, =
% of the selective part of the axial CT image is 33.46321. = E12 x1, y1,
1, if E11 (x1, y1, ) ∕
The NPCR% of the encrypted flowers image is 99.36845 and the
NPCR% of fully encrypted axial CT image is 99.32585 similarly the where L1 and W1 represents the width and height of an image. Moreover,
12
S.S. Jamal et al. Expert Systems With Applications 238 (2024) 122030
Fig. 14. Encryption sensitivity on minor changes in a plain image (axial CT).
Fig. 15. Encryption sensitivity on minor changes in ROI of plain image (axial CT).
E11 and E12 represents two encrypted images. For E11 = E12 , value of decrypting Cipher1 with Key1 and Key2 for each image and compute
D1 = 0 else D1 = 1. NPCR and UACI. The test results are summarized in Fig. 12. The results
indicate that even a minor difference in the decryption key, such as a
distinct secret key or initial values, results in the inability to decrypt.
3.6. Key sensitivity Consequently, the proposed image encryption method displays high key
sensitivity.
For an image encryption technique to be considered effective, it
should exhibit high sensitivity to the secret key, where a minor change in
the key should produce a completely different result. To verify the 3.7. Encryption sensitivity to plain image
strength of the proposed scheme, a sensitivity analysis was conducted
with Key1 and Key2 and one hundred different ciphered images are Suppose Plain1 represents a plain image, and Plain2 is obtained by
tested: Cipher1, Cipher2.. Cipher100. Key sensitivity is being tested by flipping the LSB of a randomly selected byte of Plain1. Similarly,
13
S.S. Jamal et al. Expert Systems With Applications 238 (2024) 122030
Fig. 17. Decryption sensitivity on minor changes in a cipher image (axial CT).
Fig. 18. Decryption sensitivity on minor changes in ROI of cipher image (axial CT).
Cipher1 and Cipher2 represent the sets of cipher images generated by encryption time for the ROI-based Axial CT image is 732.94 ms. The
encrypting Plain1 and Plain2. To measure the sensitivity of the results show that encrypting only the ROI of the Axial CT image is
encryption process, NPCR and UACI are calculated for Cipher1 and Ci significantly faster than encrypting the entire medical image.
pher2. We randomly select a byte in Plain1 and flip its LSB to generate
Plain2. This process is repeated 100 times for each plain image. Results 4. Conclusion
of test images Flowers and Axial CT (fully encrypted) are shown in
Figs. 13 and 14, respectively. Similarly, the ROI-based axial CT results Based on the findings of this research paper, it is evident that the
are shown in Fig. 15. proposed ROI based medical image encryption is a fast and effective
method for secure medical image transmission. The selective encryption
3.8. Decryption sensitivity to plain image reduces the size of the encrypted data and improves the efficiency of the
encryption process. Additionally, the dynamic S-Box construction
Assume that Cipher1 represents an encrypted image generated from technique based on the fusion of logistic map and tent map overcomes
Plain1. Cipher2 is an image generated by flipping a random LSB of Ci the issues associated with single chaotic map based S-box designs,
pher1, and then the Cipher2 image is decrypted. To measure the sensi making it a more secure method of encryption. The evaluation of the
tivity of the decryption process, NPCR and UACI are calculated for proposed method using standard performance metrics and S-box criteria
Plain1 (flowers) and Plain2 (fully encrypted Axial CT image), as shown confirms its high levels of encryption efficiency and security, making it a
in Figs. 16 and 17, respectively. In Fig. 18, the same test results are suitable solution for real-world applications. The results obtained from
shown for the ROI-based axial CT image. These results proved that this study provide valuable insights into the development of secure
proposed is highly sensitive to even small changes made to the cipher medical image encryption methods. In future research, we recommend
image. extending this method to video encryption.
14
S.S. Jamal et al. Expert Systems With Applications 238 (2024) 122030
Acknowledgements Khan, M. F., Ahmed, A., & Saleem, K. (2019). A novel cryptographic substitution box
design using gaussian distribution. IEEE Access, 7, 15999–16007.
Khan, M. F., Ahmed, A., Saleem, K., & Shah, T. (2019). A novel design of cryptographic
The authors extend their appreciation to the Deanship of Scientific SP-network based on gold sequences and chaotic logistic tent system. IEEE Access, 7,
Research at King Khalid University, for funding this work through large 84980–84991.
group Research Project under grant number RGP2/238/44. Khan, M. F., Saleem, K., Alshara, M. A., & Bashir, S. (2021). Multilevel information fusion
for cryptographic substitution box construction based on inevitable random noise in
medical imaging. Scientific Reports, 11(1), 1–23.
References Khan, M. F., Saleem, K., Hazzazi, M. M., Alotaibi, M., Shukla, P. K., Aqeel, M., &
Tuncer, S. A. (2022). Human psychological disorder towards cryptography: True
AbdElHaleem, S. H., Abd-El-Hafiz, S. K., & Radwan, A. G. (2022). A generalized random number generator from EEG of schizophrenics and its application in block
framework for elliptic curves based PRNG and its utilization in image encryption. encryption’s substitution box. Computational Intelligence and Neuroscience, 2022,
Scientific Reports, 12(1), 13278. 1–20. https://doi.org/10.1155/2022/2532497
Abdullah, S. M., & Abduljaleel, I. Q. (2023). Securing speech transmission based on DNA Khan, M. F., Saleem, K., Shah, T., Hazzazi, M. M., Bahkali, I., & Shukla, P. K. (2022).
and S-Box techniques. American Institute of Physics Conference Proceedings, 2591(1). Block cipher’s substitution box generation based on natural randomness in
Ahmad, M., Bhatia, D., & Hassan, Y. (2015). A novel ant colony optimization based underwater acoustics and Knight’s Tour Chain. Computational Intelligence and
scheme for substitution box design. Procedia Computer Science, 57, 572–580. Neuroscience, 2022, 1–17. https://doi.org/10.1155/2022/8338508
Ahmad, M., Doja, M. N., & Beg, M. M. S. (2018). ABC optimization based construction of Magdy, M., Hosny, K. M., Ghali, N. I., & Ghoniemy, S. (2022). Security of medical images
strong substitution-boxes. Wireless Personal Communications, 101, 1715–1729. for telemedicine: A systematic review. Multimedia Tools and Applications, 81(18),
Ahmed, H. A., Zolkipli, M. F., & Ahmad, M. (2019). A novel efficient substitution-box 25101–25145.
design based on firefly algorithm and discrete chaotic map. Neural Computing and Muhammad Waseem, H., & Hwang, S. O. (2023). Design of highly nonlinear confusion
Applications, 31, 7201–7210. component based on entangled points of quantum spin states. Scientific Reports, 13
Alharbi, A. R., Jamal, S. S., Khan, M. F., Gondal, M. A., & Abbasi, A. A. (2023). (1), 1099.
Construction and optimization of dynamic S-boxes based on gaussian distribution. Prasanalakshmi, B., Murugan, K., Srinivasan, K., Shridevi, S., Shamsudheen, S., & Hu, Y.-
IEEE Access, 11, 35818–35829. C. (2022). Improved authentication and computation of medical data transmission in
Alzaidi, A. A., Ahmad, M., Ahmed, H. S., & Solami, E. Al. (2018). Sine-cosine the secure IoT using hyperelliptic curve cryptography. The Journal of Supercomputing,
optimization-based bijective substitution-boxes construction using enhanced 78(1), 361–378.
dynamics of chaotic map. Complexity, 2018. Raj, V., Janakiraman, S., & Amirtharajan, R. (2023). Reconfigurable color medical image
Alzaidi, A. A., Ahmad, M., Doja, M. N., Al Solami, E., & Beg, M. M. S. (2018). A new 1D encryptor using hardware accelerated Chao (S)-box triplets. Journal of Real-Time
chaotic map and $$\backslash$beta $-hill climbing for generating substitution- Image Processing, 20(2), 27.
boxes. IEEE Access, 6, 55405–55418. Sani, R. H., Behnia, S., & Ziaei, J. (2023). Construction of S-box based on chaotic
Artu\uger, F. (2023). A New S-box Generator Algorithm Based on 3D Chaotic Maps and piecewise map: Watermark application. Multimedia Tools and Applications, 82(1),
Whale Optimization Algorithm. Wireless Personal Communications, 1–19. 1131–1148.
Attaullah, J., & Shah, T. (2018). A novel algebraic technique for the construction of Shah, T., Qureshi, A., & Khan, M. F. (2020). Designing more efficient novel S 8 S-BOXES.
strong substitution box. Wireless Personal Communications, 99, 213–226. International Journal on Information Technologies & Security, 12(2).
Baig, F., Khan, M. F., Beg, S., Shah, T., & Saleem, K. (2016). Onion steganography: A Si, Y., Liu, H., & Zhao, M. (2023). Constructing keyed strong S-Box with higher
novel layering approach. Nonlinear Dynamics, 84, 1431–1446. nonlinearity based on 2D hyper chaotic map and algebraic operation. Integration, 88,
Bhattacharjee, T., Maity, H. K., & Maity, S. P. (2022). On FPGA implementation in 269–277.
medical secret image sharing with data hiding. Multimedia Tools and Applications, 81 Siddiqui, G. F., Iqbal, M. Z., Saleem, K., Saeed, Z., Ahmed, A., Hameed, I. A., &
(13), 18755–18781. Khan, M. F. (2020). A dynamic three-bit image steganography algorithm for medical
Devi, H. S., & Mohapatra, H. (2023). A novel robust blind medical image watermarking and e-healthcare systems. IEEE Access, 8, 181893–181903.
using rank-based DWT. International Journal of Information Technology, 15(4), Su, Y., Tong, X., Zhang, M., & Wang, Z. (2023). A new S-box three-layer optimization
1901–1909. method and its application. Nonlinear Dynamics, 111(3), 2841–2867.
Fahad Khan, M., Saleem, K., Alotaibi, M., Mazyad Hazzazi, M., Rehman, E., Afzaal Sun, J., Wang, W., Zhang, H., & Zhang, J. (2023). Color image quantum steganography
Abbasi, A., & Asif Gondal, M. (2022). Construction and optimization of TRNG based scheme and circuit design based on DWT+ DCT+ SVD. Physica A: Statistical
substitution boxes for block encryption algorithms. Computers, Materials & Continua, Mechanics and Its Applications, 617, Article 128688.
73(2), 2679–2696. https://doi.org/10.32604/cmc.2022.027655 Tian, Y., & Lu, Z. (2016). S-box: Six-dimensional compound hyperchaotic map and
Farah, T., Rhouma, R., & Belghith, S. (2017). A novel method for designing S-box based artificial bee colony algorithm. Journal of Systems Engineering and Electronics, 27(1),
on chaotic map and teaching–learning-based optimization. Nonlinear Dynamics, 88 232–241.
(2), 1059–1074. Wang, M., Liu, H., & Zhao, M. (2023). Construction of a non-degeneracy 3D chaotic map
Gaherwar, P., Joshi, S., Joshi, R., & Khengare, R. (2022). SISA: Securing Images by and application to image encryption with keyed S-box. Multimedia Tools and
Selective Alteration. Information and Communication Technology for Competitive Applications, 1–23.
Strategies (ICTCS 2020) ICT: Applications and Social Interfaces, 729–740. Yang, S., Tong, X., Wang, Z., & Zhang, M. (2023). S-box generation algorithm based on
Gakam Tegue, G. A., Nkapkop, J. D. D., Abdel, M. A., Tsafack, N., Musheer, A., hyperchaotic system and its application in image encryption. Multimedia Tools and
Signing, F. V., … Tamba, J. G. (2023). A novel image encryption scheme combining Applications, 1–25.
a dynamic S-box generator and a new chaotic oscillator with hidden behavior. Yong, W., & Peng, L. (2012). An improved method to obtaining S-box based on chaos and
Arabian Journal for Science and Engineering, 1–20. genetic algorithm. HKIE Transactions, 19(4), 53–58.
Hamza, R., Hassan, A., Huang, T., Ke, L., & Yan, H. (2019). An efficient cryptosystem for Zamli, K. Z., Din, F., & Alhadawi, H. S. (2023). Exploring a Q-learning-based chaotic
video surveillance in the internet of things environment. Complexity, 2019, 1625678. naked mole rat algorithm for S-box construction and optimization. Neural Computing
https://doi.org/10.1155/2019/1625678 and Applications, 1–23.
Jamal, S. S., Anees, A., Ahmad, M., Khan, M. F., & Hussain, I. (2019). Construction of Zhang, T., Chen, C. L. P., Chen, L., Xu, X., & Hu, B. (2018). Design of highly nonlinear
cryptographic S-boxes based on mobius transformation and chaotic tent-sine system. substitution boxes based on I-Ching operators. IEEE Transactions on Cybernetics, 48
IEEE Access, 7, 173273–173285. (12), 3349–3358.
15