# Multi-Chaos-Based Lightweight Image Encryption-Compression for Secure Occupancy Monitoring

Authors: Yazeed Yasin Ghadi; Suliman A. Alsuhibany; Jawad Ahmad; Harish Kumar; Wadii Boulila; Mohammed Alsaedi; Khyber Khan; Shahzad A. Bhatti
Journal: Journal of Healthcare Engineering
 (2022)

---

## Abstract

With the advancement of camera and wireless technologies, surveillance camera-based occupancy has received ample attention from the research community. However, camera-based occupancy monitoring and wireless channels, especially Wi-Fi hotspot, pose serious privacy concerns and cybersecurity threats. Eavesdroppers can easily access confidential multimedia information and the privacy of individuals can be compromised. As a solution, novel encryption techniques for the multimedia data concealing have been proposed by the cryptographers. Due to the bandwidth limitations and computational complexity, traditional encryption methods are not applicable to multimedia data. In traditional encryption methods such as Advanced Encryption Standard (AES) and Data Encryption Standard (DES), once multimedia data are compressed during encryption, correct decryption is a challenging task. In order to utilize the available bandwidth in an efficient way, a novel secure video occupancy monitoring method in conjunction with encryption-compression has been developed and reported in this paper. The interesting properties of Chebyshev map, intertwining map, logistic map, and orthogonal matrix are exploited during block permutation, substitution, and diffusion processes, respectively. Real-time simulation and performance results of the proposed system show that the proposed scheme is highly sensitive to the initial seed parameters. In comparison to other traditional schemes, the proposed encryption system is secure, efficient, and robust for data encryption. Security parameters such as correlation coefficient, entropy, contrast, energy, and higher key space prove the robustness and efficiency of the proposed solution.


---

## Body

## 1. Introduction

A fully automatic human occupancy information system has various commercial applications [1], for example, passenger counting, identifying hourly office patterns, and counting shopping center footfall. Researchers have proposed various occupancy measurement solutions through various sensors over the last two decades [1]. These sensors include camera, passive infrared (IR), ultrasonic, CO2, Wi-Fi, and radio frequency (RF) identifiers [2]. However, it is reported that camera-based human occupancy techniques are more accurate when compared to other sensor-based methods. The biggest issue with the camera-based occupancy is monitoring occupancy with privacy preservation [2, 3]. In such scenarios, encryption can play a vital role and can hide the information and identity of individuals during the occupancy process [3]. In video encryption, identity of individuals is concealed and only an authorized person who has correct key information can decrypt the original video contents [4].Images and videos can be encrypted using traditional schemes such AES and DES; however, these schemes are not designed for multimedia data encryption [5–7]. Conventional encryption schemes have some issues such as higher computational complexity as images contain large amount of data and strong correlation among pixels. As a result, traditional encryption schemes fail to satisfy real-time implementation constraints and thus have limited applications in the real-time multimedia applications [8]. To overcome the aforementioned issues, chaotic maps can provide highly secure encryption due to complex dynamics and ergodicity.Mathews introduced the concept of chaos-based encryption algorithms [9], and since then many algorithms using chaos theory have been proposed [10]. For example, a novel image encryption scheme based on Henon and Ikeda chaotic maps and a lattice model based on Arnold coupled logistic map (ACLM) have been proposed in [11, 12]. In the lattice model, the coupling coefficients are generated from the logistic map that is further employed in diffusion and permutation processes. Moreover, ACLM is employed in key generation and an efficient scheme is presented. Saiyma et al. proposed a novel encryption algorithm using Rubik’s cube puzzle and logistic chaotic map for pixel permutation and diffusion [13]. Another encryption scheme that utilizes Rubik’s cube puzzle for the permutation of bits and XOR operation for diffusion was proposed in [14].A key-based block ciphering method was presented in [15] where pixel bytes are encrypted and shuffled using variable block sizes that enhance the diffusion property. Zhao and Ren [16] employed infinite-dimensional hyperchaotic multi-attractor (HCMA) Chen system that was generated by a linear time-delay feedback control for the encryption of digital images. In [17], piecewise linear chaotic map (PLCM) and S-Box transformation are applied on original plaintext image. Furthermore, an XOR operation is applied to the diffused image pixels. Elements for XOR operations were based on mixing of chaotic logistic random sequence. A hybrid chaos-based random stream and blockwise encryption algorithm with a key stretching method for the enhancement of security was presented in [18]. Chai et al. [19] proposed an image compression and encryption scheme by combining a parameter-varying chaotic system, elementary cellular automata (ECA), and block compressive sensing (BCS). Musanna et al. proposed a secure image encryption using multi-chaotic maps and multi-resolution singular value decomposition (MR-SVD) for secure image encryption [20].In [21], fractional Fourier transform (FRFT), DNA sequencing, and chaos theory have been used for image security. However, there are several issues in DNA-based image encryption [22]. These issues were higher computational complexity and inappropriate implementation. In order to address the drawbacks of DNA-coding-based encryption algorithms, a new technique was introduced in [22] which is based on the integer wavelet transform (IWT) and global bit scrambling (GBS) for image encryption. Previously, video and image encryption schemes have been proposed, but they are either insecure or impractical.


## 2. Preliminaries

### 2.1. Chaotic Maps

Any mathematical function that exhibits chaotic behavior is known as chaotic map. A close association between chaos and cryptography has been widely reported in literature since many decades. This close relationship is due to high sensitivity of initial conditions, deterministic dynamics, and attack complexity of chaotic map. Logistic map shown in equation (1) is an example of one-dimensional (1D) chaotic map [23]:(1)Zn+1=μZn1−Zn,where the initial parameters are(2)Z0∈0,1,μ∈0,4.The bifurcation diagram of logistic map is shown in Figure1. It is clear from Figure 1 that the logistic map has chaotic behavior for the range 3.57≤μ≤4. Any variation of μ within this range results in a random output of the logistic map. Range of μ is low and hence an intruder can apply exhaustive key search attack.Figure 1
Bifurcation diagram (μ spacing is 0.0005).The key processes of an image encryption technique are confusion and diffusion. In our proposed scheme, Chebyshev and intertwining chaotic maps are employed in confusion and diffusion processes. Mathematically, Chebyshev map can be defined as [24, 25](3)TkA=cosk×arc cosA,where k is an integer and A∈−1,1. It is proposed that k = 4 for less computation requirements [25].The intertwining map can be written as [26](4)Xn+1=λ×A1×Yn×1−Xn+Znmod1,Yn+1=λ×A2×Yn+Zn1+Xn+12mod1,Zn+1=λ×Xn+1+Yn+1+A3×sinZnmod1,where Xn, Yn, and Zn∈0,1, 0≤μ≤3.999, A1>33.5,A2>37.9,A3>35.7. Key space of intertwining logistic map is 1060≈2200 which reduces the possibility of brute force attack.


### 2.2. Substitution Box

In symmetric key cryptography, substitution is a nonlinear bijective function. Generally,m bits are given as an input to substitution box (S-Box), and as a result, n bit output is produced [27, 28]. In case of digital images, the bijective function F: I⟶S maps each image pixel I to a unique value S as shown in Figure 2. In many traditional algorithms such as AES and DES, S-Box is the only nonlinear part of ciphertext. In our previous research, it has been highlighted that substitution-only image encryption scheme is highly vulnerable to various types of attacks. Thus, the use of a single S-Box in image encryption algorithms is not a good choice due to weaker security. Instead of a single fixed S-Box, we have used three S-Boxes known as AES S-Box [29], Khan’s S-Box [30], and Tayseer’s S-Box [31], respectively. Due to higher nonlinearity and good resistance against different attacks, we have selected these S-Boxes in our proposed scheme. These S-Boxes are outlined in Tables 1–3. In the proposed scheme, S-Box is randomly selected using logistic map. The selection of S-Box is based on logistic map which is further explained in later part of the paper.Figure 2
Bijective mapping of substitution box.Table 1
AES S-Box [29].
991241191232421071111974811034325421517111820213020112525089712401732121621751561641141921832531473854632472045216522924111321649214199351952415051547181282262353917811791314426271109016082592141794122747132832090237322521779110620319057747688207208239170251677751133692492127806015916881163641431461575624518818221833162552432102051219236951516823196167126611009325115961297922034421441367023818420222941121922450581073636921942111729814514922, 121231200551091412137816910886244234101122174818612037462816618019823222111631751891391381126218110272324614975387185134193291582252481521710521714214815530135233206854022314016113713191230661046515345151768418722Table 2
Khan’s S-Box [30].
1291481420620863952198624269254152215531044713893200161752301101331032425110615938167181179312187415515343249057521621442432356110816482117213130992284939121991897813116175581801233194232105226516058454102561966618217121213111518367906415191601782162042487073118100146719820713714194921652022211971272312885252168233682011747681124220173170225166225107145462041122171921874524424722715615710121471792222261121393072210172372532398911935881479783154331491143650176212241201581845187911424623121724142240211229250236125136481902378982729203193120518891245143617796166801421854014011111355281952623420913532186134151126132169223101633419771504425521211095923818Table 3
Tayseer’s S-Box [31].
9472042978208201732317411810977176227154232421739717981921612486160107664913179146254222510122430202181342511921321540102135178184167361051134831141991647621789236551561261597514214758218219738168451752342141864151332212286322511442351625020716310381108882091653112711801941871019812015313298110148010046250253573332151142815052122422521491061395269623717720524382852239190140432031816139238116648344562451257015511832719639230121143352231284212292449011120629314513767141185206233182592262491191601662001972401711772371801719174189222123122112169155193712121242424712921017010425513015224165689919513687539223186341918421118816138216172220695424615711515894


### 2.3. Discrete Cosine Transform

Discrete cosine transform (DCT) is a widely used transform for image compression. The DCT and inverse DCT of a plaintext imageP is shown in equations (5) and (6), respectively. The DCT Δu,v of a plaintext image P is written as [32](5)Δu,v=2A×BΓuΓv∑x=0A−1∑y=0B−1Px,ycos2y+1uπ2A×cos2x+1vπ2B,(6)Px,y=2A×BΓuΓv∑x=0A−1∑y=0B−1Δu,vcos2y+1uπ2A×cos2x+1vπ2B,where n×n is the size of image and Γu and Γv can be written as(7)Γu=Γv=12,foruv=0,1,otherwise.An encryption scheme is divided into two types: (i) full encryption and (ii) partial encryption. In full encryption, the complete image is encrypted, while in partial encryption, only a part of the image is encrypted. Partial encryption effectively reduces computational complexity. When an image is converted to frequency domain such as applying discrete cosine transform (DCT), less attention is given to higher frequency components.


## 2.1. Chaotic Maps

Any mathematical function that exhibits chaotic behavior is known as chaotic map. A close association between chaos and cryptography has been widely reported in literature since many decades. This close relationship is due to high sensitivity of initial conditions, deterministic dynamics, and attack complexity of chaotic map. Logistic map shown in equation (1) is an example of one-dimensional (1D) chaotic map [23]:(1)Zn+1=μZn1−Zn,where the initial parameters are(2)Z0∈0,1,μ∈0,4.The bifurcation diagram of logistic map is shown in Figure1. It is clear from Figure 1 that the logistic map has chaotic behavior for the range 3.57≤μ≤4. Any variation of μ within this range results in a random output of the logistic map. Range of μ is low and hence an intruder can apply exhaustive key search attack.Figure 1
Bifurcation diagram (μ spacing is 0.0005).The key processes of an image encryption technique are confusion and diffusion. In our proposed scheme, Chebyshev and intertwining chaotic maps are employed in confusion and diffusion processes. Mathematically, Chebyshev map can be defined as [24, 25](3)TkA=cosk×arc cosA,where k is an integer and A∈−1,1. It is proposed that k = 4 for less computation requirements [25].The intertwining map can be written as [26](4)Xn+1=λ×A1×Yn×1−Xn+Znmod1,Yn+1=λ×A2×Yn+Zn1+Xn+12mod1,Zn+1=λ×Xn+1+Yn+1+A3×sinZnmod1,where Xn, Yn, and Zn∈0,1, 0≤μ≤3.999, A1>33.5,A2>37.9,A3>35.7. Key space of intertwining logistic map is 1060≈2200 which reduces the possibility of brute force attack.


## 2.2. Substitution Box

In symmetric key cryptography, substitution is a nonlinear bijective function. Generally,m bits are given as an input to substitution box (S-Box), and as a result, n bit output is produced [27, 28]. In case of digital images, the bijective function F: I⟶S maps each image pixel I to a unique value S as shown in Figure 2. In many traditional algorithms such as AES and DES, S-Box is the only nonlinear part of ciphertext. In our previous research, it has been highlighted that substitution-only image encryption scheme is highly vulnerable to various types of attacks. Thus, the use of a single S-Box in image encryption algorithms is not a good choice due to weaker security. Instead of a single fixed S-Box, we have used three S-Boxes known as AES S-Box [29], Khan’s S-Box [30], and Tayseer’s S-Box [31], respectively. Due to higher nonlinearity and good resistance against different attacks, we have selected these S-Boxes in our proposed scheme. These S-Boxes are outlined in Tables 1–3. In the proposed scheme, S-Box is randomly selected using logistic map. The selection of S-Box is based on logistic map which is further explained in later part of the paper.Figure 2
Bijective mapping of substitution box.Table 1
AES S-Box [29].
991241191232421071111974811034325421517111820213020112525089712401732121621751561641141921832531473854632472045216522924111321649214199351952415051547181282262353917811791314426271109016082592141794122747132832090237322521779110620319057747688207208239170251677751133692492127806015916881163641431461575624518818221833162552432102051219236951516823196167126611009325115961297922034421441367023818420222941121922450581073636921942111729814514922, 121231200551091412137816910886244234101122174818612037462816618019823222111631751891391381126218110272324614975387185134193291582252481521710521714214815530135233206854022314016113713191230661046515345151768418722Table 2
Khan’s S-Box [30].
1291481420620863952198624269254152215531044713893200161752301101331032425110615938167181179312187415515343249057521621442432356110816482117213130992284939121991897813116175581801233194232105226516058454102561966618217121213111518367906415191601782162042487073118100146719820713714194921652022211971272312885252168233682011747681124220173170225166225107145462041122171921874524424722715615710121471792222261121393072210172372532398911935881479783154331491143650176212241201581845187911424623121724142240211229250236125136481902378982729203193120518891245143617796166801421854014011111355281952623420913532186134151126132169223101633419771504425521211095923818Table 3
Tayseer’s S-Box [31].
9472042978208201732317411810977176227154232421739717981921612486160107664913179146254222510122430202181342511921321540102135178184167361051134831141991647621789236551561261597514214758218219738168451752342141864151332212286322511442351625020716310381108882091653112711801941871019812015313298110148010046250253573332151142815052122422521491061395269623717720524382852239190140432031816139238116648344562451257015511832719639230121143352231284212292449011120629314513767141185206233182592262491191601662001972401711772371801719174189222123122112169155193712121242424712921017010425513015224165689919513687539223186341918421118816138216172220695424615711515894


## 2.3. Discrete Cosine Transform

Discrete cosine transform (DCT) is a widely used transform for image compression. The DCT and inverse DCT of a plaintext imageP is shown in equations (5) and (6), respectively. The DCT Δu,v of a plaintext image P is written as [32](5)Δu,v=2A×BΓuΓv∑x=0A−1∑y=0B−1Px,ycos2y+1uπ2A×cos2x+1vπ2B,(6)Px,y=2A×BΓuΓv∑x=0A−1∑y=0B−1Δu,vcos2y+1uπ2A×cos2x+1vπ2B,where n×n is the size of image and Γu and Γv can be written as(7)Γu=Γv=12,foruv=0,1,otherwise.An encryption scheme is divided into two types: (i) full encryption and (ii) partial encryption. In full encryption, the complete image is encrypted, while in partial encryption, only a part of the image is encrypted. Partial encryption effectively reduces computational complexity. When an image is converted to frequency domain such as applying discrete cosine transform (DCT), less attention is given to higher frequency components.


## 3. The Proposed Real-Time Secure Occupancy Monitoring System

The proposed scheme uses multi-chaos for the encryption of real-time frames obtained from an overhead 2.0 megapixels Logitech camera installed at a height of 1.7 m above the floor in T10 office at Glasgow Caledonian University, United Kingdom. Figure3 shows real-time frames with one, two, and three occupants, respectively. In order to protect these frames from eavesdropper, a novel lightweight secure occupancy monitoring system is proposed. Flowchart of the proposed encryption-compression system is depicted in Figure 4. It can be seen from Figure 4 that after discrete cosine transformation (DCT), a block starting from direct coefficient (DCT-DC) is selected and then encrypted through confusion (scrambling) and diffusion (substitution) processes. A part of DCT values is selected and then encrypted. Let the output after DCT be η and the selected block be λM×N; then, it is multiplied with an orthogonal matrix ψ and the result is stored in Φ. The values obtained in Φ are forwarded to the confusion and diffusion stage. Due to the lightweight nature of Chebyshev and intertwining maps, they are deployed in the confusion and diffusion process of encryption. After the encryption-compression phase, encrypted pixels are transmitted over the channel.Figure 3
Real-time video frames with different number of occupants. (a) One person. (b) Two persons. (c) Three persons.
(a)(b)(c)Figure 4
Flowchart of the proposed encryption-compression scheme.Let the size of a plaintext imageP be A×B. In this work, k represents iteration number and ranges from k=1 to N, where N is the total number of iteration. When k = 1, the secure hash algorithm (SHA-512) is applied to the plaintext image P for the generation of initial keys for the Chebyshev map. Detailed steps of the proposed scheme are outlined as follows:(1)
Apply DCT on plaintext imageP to get η.(2)
Select DCT coefficients fromη, staring from the DCT-DC coefficient to get λ. The dimensions of the selected coefficients matrix can be same or different as compared to the original image. Let the size of λ be M×N.(3)
Iterate aM×N Chebyshev map to get random matrix Λ.(4)
Apply the Gram–Schmidt algorithm to the random matrixΛ to get an orthogonal matrix Φ.(5)
Multiplyλ and Φ and get a new matrix ϕ. Repeat steps from 3 to 5 for N times. In each iteration, values of initial conditions are slightly changed and σ is added in original initial value, where σ=0.001.(6)
Apply inverse DCT and map the values to the 0–255 range to getω.(7)
Iterate a intertwining mapM×N times to get a random row vector f.(8)
Multiply the row vectorf with 1014 and apply mod operation using the following equation:(8)α=1014×fmod256,where⋅ is the absolute value. Reshape row matrix α into M×N and get β.(9)
Perform XOR operation betweenω and β to get a new matrix ζ.(10)
Randomly select a S-Box using logistic map and apply S-Box onζ to get the final ciphertext C. The output of logistic map is multiplied with a factor 1014 to get ψ and apply Mod 3 operator to get Ψ. If the value in Ψ is 0, 1, and 2, then AES S-Box, Khan’s S-Box, and Tayseer’s S-Box are selected, respectively.Decryption is the reverse process of encryption and all steps can be applied in the reverse process to get the original plaintext image.


## 4. Security Analyses

Results of the proposed encryption scheme are shown in Figures5–8. In the first test (Figure 5), the size of DCT block is the same as plaintext image size, and hence both plaintext and ciphertext image frames have same sizes. From Figure 5, one can see that the proposed scheme hides the original contents of the frame and hence the number of occupant information is also concealed. The decryption results are shown in Figure 6. In the second test, the size of DCT block is selected as M×N/2×2, and as a result, the size of encrypted image is 4 times less than the plaintext size. The encryption and decryption results are shown in Figures 7 and 8, respectively. In Figure 7, it can be seen that size of ciphertext is 4 times smaller than the plaintext image and still correct decryption (see Figure 8) is possible. This type of compression is not possible in traditional encryption. From the visual inspection in Figures 5 and 7, it is evident that the proposed scheme encrypts the original information; however, the security of an encryption algorithm should be statistically proved.Figure 5
Real-time encryption with DCT size same as plaintext size. (a) One person. (b) Two persons. (c) Three persons.
(a)(b)(c)Figure 6
Decryption results of Figure5. (a) One person. (b) Two persons. (c) Three persons.
(a)(b)(c)Figure 7
Encryption results with DCT sizeM×N/2×2. (a) One person. (b) Two persons. (c) Three persons.
(a)(b)(c)Figure 8
Decryption results with DCT sizeM×N/2×2. (a) One person. (b) Two persons. (c) Three persons.
(a)(b)(c)


### 4.1. Correlation Coefficient

Degree of similarity between two variables can be measured via correlation coefficient metric. In image processing, correlation is the degree of similarity between two images. One can also check the correlation between two adjacent pixels (horizontal, vertical, and diagonal) through selection of random pairs. The lower the value of correlation coefficient, the higher the security of image encryption scheme.The correlation coefficient can be computed using the following mathematical formula:(9)r=Covariancex,ySx×Sy,where Sx and Sy are standard deviation at pixel positions x and y, respectively. Covariance is written as(10)covx,y=1N∑i=1Nxi−Exyi−Ey,Sx=Variancex,Sy=Variancey.In order to check the strength of the proposed encryption scheme, we evaluated correlation coefficients in horizontal, vertical, and diagonal directions, for Figures3 and 5, respectively. Correlation plots in diagonal direction are shown in Figure 9. From these plots, it can be seen that original images have correlated distribution in diagonal direction but encrypted images have uncorrelated distribution for all test images. Similar results were obtained for horizontal and diagonal directions. The correlation values between −1 and 1 are shown in Table 4. From the table, it is clear that when compared to the plaintext image, encrypted image has low correlation values.Figure 9
Plot of correlation coefficients in diagonal direction. (a) Original image (Figure 3(a) correlation plot). (b) Encrypted image (Figure 5(a) correlation plot). (c) Original image (Figure 3(b) correlation plot). (d) Encrypted image (Figure 5(b) correlation plot). (e) Original image (Figure3(c) correlation plot). (f) Encrypted image (Figure 5(c) correlation plot).
(a)(b)(c)(d)(e)(f)Table 4
Correlation coefficient values for horizontal, diagonal, and vertical directions.
ImagesPlaintext imageEncrypted imageH-DD-DV-DH-DD-DV-D10.90490.83470.90680.0108−0.01340.008520.90810.86310.94800.01900.02530.017930.95800.90200.94670.0212−0.0268−0.0108


### 4.2. Entropy

The term entropy refers to statistical measure of randomness or uncertainty. In image processing, entropy calculates the distribution of gray values. For a gray scale image with 256 gray levels, ideally the information entropy must be 8 bits for a complete random image. Mathematically, entropy is defined as(11)Hm=∑i=0L−1pmilog21pmi,,where L=2g. The value of g is 8 for gray images. The entropy values of plaintext and ciphertext images are shown in Table 5. When an image is encrypted using the proposed scheme, the entropy value is close to 8.Table 5
Entropy analysis.
ImagesOriginal imageEncrypted image16.67767.996026.84347.996237.10177.9966


### 4.3. Encryption Quality

One of the important aspects in image security evaluation is to check the quality of encryption. One can check the quality of encryption via visual inspection; however, the security of encryption scheme should be mathematically proved. To check the quality of encryption, a wide range of attributes must be considered during the designing stage of an encryption scheme. Most of the attributes are outlined in our previous work [33–36]. An image encryption is considered good if it hides a wide range of those attributes. Out of many attributes, deviation in pixel values between the original and encrypted images is a robust parameter to evaluate the quality of encryption. Encryption quality is better if deviation between plaintext and ciphertext is maximum and irregular. Three different parameters can be considered to check the deviation of pixels, i.e., maximum deviation (MD), irregular deviation (ID), and deviation from uniform histogram (DUH).


#### 4.3.1. Maximum Deviation (MD)

MD measures the deviation between original and encrypted images. A higher value of maximum deviation indicates higher deviation. Maximum deviation is calculated in three steps:(1)
Calculate histograms for the original plaintext imageP and the encrypted image C.(2)
Compute the histogram differenceHD where HD is the absolute deviation (difference) between the histograms calculated in Step 1.(3)
Finally, compute MD as given below:(12)MD=HD0+HDN−12+∑i=1N−2HDi,whereHDi is the difference histogram at index i.


#### 4.3.2. Irregular Deviation (ID)

ID reveals how much of the deviation induced by the encryption algorithm on the ciphertext image is irregular. Lower value of irregular deviation indicates good encryption quality. Steps involved in the calculation of irregular deviation are given as follows:(1)
Compute the average sum of histogram values.(2)
Take the absolute difference (AD) between the average sum of histogramAvg and amplitude of histogram at index ihi. Mathematically, it is written as(13)AD=Avg−hi.(3)
Finally compute ID as(14)ID=∑i=0N−1AD.


#### 4.3.3. Deviation from Uniform Histogram (DUH)

A uniform histogram of an encrypted image is desired for good encryption quality. Less deviation from uniform histogram shows better quality of encryption. For gray scale images, ideal histogram (ID) and the deviation from uniform histogram (DUH) are measured as [37](15)IHi=A×B256,0≤Ci≤255,0,elsewhere.Using the above concept, Abd El-Samie et al. proposed a new metric [37] (DUH) for measuring the quality of encrypted images. DUH is calculated as [37](16)DUH=∑i=0255IHi−HCA×B,where HC is the actual histogram value of ciphertext image.The MD, ID, and DUH are shown in Table6. All values confirm the higher security of the proposed scheme.Table 6
Encryption quality analyses.
ImagesMDIDDUH15.8515×104400460.025325.9088×104376580.029234.8168×104366220.0280


### 4.4. Energy

Gray-level co-occurrence matrix (GLCM) is a statistical analysis of texture measurement that reflects the spatial property of image pixels. A squared sum of GLCM elements is energy. For plaintext images, some pixels have large values in gray-level co-occurrence matrix due to which the energy values are high but for ciphertext images, the values of energy are smaller because of the distributed energy values. The energy analysis can be done using the following equation.(17)E=∑i,jpi,j2,where pi,j is the position of pixels in gray-level co-occurrence matrix. For a constant image, energy value is equal to 1. Lower values indicates higher randomness in image pixels. The energy values of the plaintext images and the corresponding ciphertext images are shown in Table 7 which shows that the energy values of the ciphertext images are very small.Table 7
Energy analysis.
ImagesOriginal imageCiphertext image10.26310.015620.24870.015630.21590.0156


### 4.5. Contrast

Contrast measures the variation in GLCM. With the help of contrast, a viewer can differentiate between the different objects of an image. A higher value of contrast is required for an encrypted image. For a constant image, the value of contrast is 0. Contrast of an image is measured as(18)C=∑i,ji−j2×pi,j,where pi,j indicates the number of GLCM. The values of contrast for plaintext images and ciphertext images are tabulated in Table 8 which clearly indicates that the contrast values of the ciphertext images are very large as compared to the contrast values of plaintext images.Table 8
Contrast analysis.
ImagesOriginal imageCiphertext image10.427410.480820.604710.544030.343510.6562


### 4.6. Homogeneity

Another parameter that can be deduced from GLCM is homogeneity. Homogeneity is the closeness of element distribution in the GLCM. For an efficient image encryption algorithm, the homogeneity values should be low. For determination of homogeneity, the equation used is(19)HOM=∑i,jpi,j1+i−j,where pi,j represents the gray-level co-occurrence matrices in GLCM. The homogeneity values of the test images are shown in Table 9. It is clear from Table 9 that the proposed scheme provides higher security for plaintext images as the values of homogeneity are lower for encrypted images.Table 9
Homogeneity analysis.
ImagesOriginal imageCiphertext image10.93510.389220.92100.389430.93940.3875


### 4.7. Structural Content and Average Difference

To determine the similarity between plaintext image and its corresponding ciphertext image, the structural content test can also be applied. It indicates their level of similarities. When the two images are totally different from one another, the value of structural content is 0 and a value of 1 means identical images. In case of image encryption, the value of structural content should be near 0. Mathematical expression for structural content is(20)SC=∑i=1M∑j=1NOi,j2∑i=1M∑j=1NEi,j2,where Oi,j is the original image and Ei,j is the encrypted image. Values of structural content can be observed from Table 10.Table 10
Structural content and average difference analysis.
ImagesSCAD10.8228−2.691421.01049.511931.111916.8750


### 4.8. Key Space Analysis

The strength of an encryption technique is hidden in secret key parameter. Therefore, key is the most critical feature of a cryptosystem. Smaller key space may lead to expose the full key or a part of key. In digital image encryption, larger key space indicates resistance against the brute force attack. In this work, we have used three chaotic maps and total initial conditions are 8, and as a result, key space (KS) is written as(21)KS=1015×1015×1015×1015×1015×1015×1015×1015=10120≈2400.From the above KS analysis, one can see that the proposed scheme provides sufficient larger key space and hence it is resistant to a number of exhaustive key search attacks and brute force attacks.


### 4.9. Computational Complexity Analysis

The proposed scheme is tested and implemented in MATLAB R2019b on a PC with 2.70 GHz CPU and 8 GB RAM. When the size of selected DCT block and plaintext image is same, encryption takes approximately 0.063 seconds. Decryption is the reverse process of encryption and it also takes 0.063 seconds. It is clear from Table11 that when size of DCT block reduces, encryption time also reduces. In other traditional encryption schemes, the aforementioned feature is not available. However, one can see from Figure 10 that when size of DCT block reduces, decryption quality also reduces.Table 11
Encryption/decryption time analysis with different DCT sizes.
DCT sizeEncryption time (sec)M×N/2×20.0212M×N/4×40.0117M×N/8×80.0095M×N/16×160.0092Figure 10
Effect of different DCT sizes. (a) DCT sizeM×N/2×2. (b) DCT size M×N/4×4. (c) DCT size M×N/8×8. (d) DCT size M×N/16×16.
(a)(b)(c)(d)


## 4.1. Correlation Coefficient

Degree of similarity between two variables can be measured via correlation coefficient metric. In image processing, correlation is the degree of similarity between two images. One can also check the correlation between two adjacent pixels (horizontal, vertical, and diagonal) through selection of random pairs. The lower the value of correlation coefficient, the higher the security of image encryption scheme.The correlation coefficient can be computed using the following mathematical formula:(9)r=Covariancex,ySx×Sy,where Sx and Sy are standard deviation at pixel positions x and y, respectively. Covariance is written as(10)covx,y=1N∑i=1Nxi−Exyi−Ey,Sx=Variancex,Sy=Variancey.In order to check the strength of the proposed encryption scheme, we evaluated correlation coefficients in horizontal, vertical, and diagonal directions, for Figures3 and 5, respectively. Correlation plots in diagonal direction are shown in Figure 9. From these plots, it can be seen that original images have correlated distribution in diagonal direction but encrypted images have uncorrelated distribution for all test images. Similar results were obtained for horizontal and diagonal directions. The correlation values between −1 and 1 are shown in Table 4. From the table, it is clear that when compared to the plaintext image, encrypted image has low correlation values.Figure 9
Plot of correlation coefficients in diagonal direction. (a) Original image (Figure 3(a) correlation plot). (b) Encrypted image (Figure 5(a) correlation plot). (c) Original image (Figure 3(b) correlation plot). (d) Encrypted image (Figure 5(b) correlation plot). (e) Original image (Figure3(c) correlation plot). (f) Encrypted image (Figure 5(c) correlation plot).
(a)(b)(c)(d)(e)(f)Table 4
Correlation coefficient values for horizontal, diagonal, and vertical directions.
ImagesPlaintext imageEncrypted imageH-DD-DV-DH-DD-DV-D10.90490.83470.90680.0108−0.01340.008520.90810.86310.94800.01900.02530.017930.95800.90200.94670.0212−0.0268−0.0108


## 4.2. Entropy

The term entropy refers to statistical measure of randomness or uncertainty. In image processing, entropy calculates the distribution of gray values. For a gray scale image with 256 gray levels, ideally the information entropy must be 8 bits for a complete random image. Mathematically, entropy is defined as(11)Hm=∑i=0L−1pmilog21pmi,,where L=2g. The value of g is 8 for gray images. The entropy values of plaintext and ciphertext images are shown in Table 5. When an image is encrypted using the proposed scheme, the entropy value is close to 8.Table 5
Entropy analysis.
ImagesOriginal imageEncrypted image16.67767.996026.84347.996237.10177.9966


## 4.3. Encryption Quality

One of the important aspects in image security evaluation is to check the quality of encryption. One can check the quality of encryption via visual inspection; however, the security of encryption scheme should be mathematically proved. To check the quality of encryption, a wide range of attributes must be considered during the designing stage of an encryption scheme. Most of the attributes are outlined in our previous work [33–36]. An image encryption is considered good if it hides a wide range of those attributes. Out of many attributes, deviation in pixel values between the original and encrypted images is a robust parameter to evaluate the quality of encryption. Encryption quality is better if deviation between plaintext and ciphertext is maximum and irregular. Three different parameters can be considered to check the deviation of pixels, i.e., maximum deviation (MD), irregular deviation (ID), and deviation from uniform histogram (DUH).


### 4.3.1. Maximum Deviation (MD)

MD measures the deviation between original and encrypted images. A higher value of maximum deviation indicates higher deviation. Maximum deviation is calculated in three steps:(1)
Calculate histograms for the original plaintext imageP and the encrypted image C.(2)
Compute the histogram differenceHD where HD is the absolute deviation (difference) between the histograms calculated in Step 1.(3)
Finally, compute MD as given below:(12)MD=HD0+HDN−12+∑i=1N−2HDi,whereHDi is the difference histogram at index i.


### 4.3.2. Irregular Deviation (ID)

ID reveals how much of the deviation induced by the encryption algorithm on the ciphertext image is irregular. Lower value of irregular deviation indicates good encryption quality. Steps involved in the calculation of irregular deviation are given as follows:(1)
Compute the average sum of histogram values.(2)
Take the absolute difference (AD) between the average sum of histogramAvg and amplitude of histogram at index ihi. Mathematically, it is written as(13)AD=Avg−hi.(3)
Finally compute ID as(14)ID=∑i=0N−1AD.


### 4.3.3. Deviation from Uniform Histogram (DUH)

A uniform histogram of an encrypted image is desired for good encryption quality. Less deviation from uniform histogram shows better quality of encryption. For gray scale images, ideal histogram (ID) and the deviation from uniform histogram (DUH) are measured as [37](15)IHi=A×B256,0≤Ci≤255,0,elsewhere.Using the above concept, Abd El-Samie et al. proposed a new metric [37] (DUH) for measuring the quality of encrypted images. DUH is calculated as [37](16)DUH=∑i=0255IHi−HCA×B,where HC is the actual histogram value of ciphertext image.The MD, ID, and DUH are shown in Table6. All values confirm the higher security of the proposed scheme.Table 6
Encryption quality analyses.
ImagesMDIDDUH15.8515×104400460.025325.9088×104376580.029234.8168×104366220.0280


## 4.3.1. Maximum Deviation (MD)

MD measures the deviation between original and encrypted images. A higher value of maximum deviation indicates higher deviation. Maximum deviation is calculated in three steps:(1)
Calculate histograms for the original plaintext imageP and the encrypted image C.(2)
Compute the histogram differenceHD where HD is the absolute deviation (difference) between the histograms calculated in Step 1.(3)
Finally, compute MD as given below:(12)MD=HD0+HDN−12+∑i=1N−2HDi,whereHDi is the difference histogram at index i.


## 4.3.2. Irregular Deviation (ID)

ID reveals how much of the deviation induced by the encryption algorithm on the ciphertext image is irregular. Lower value of irregular deviation indicates good encryption quality. Steps involved in the calculation of irregular deviation are given as follows:(1)
Compute the average sum of histogram values.(2)
Take the absolute difference (AD) between the average sum of histogramAvg and amplitude of histogram at index ihi. Mathematically, it is written as(13)AD=Avg−hi.(3)
Finally compute ID as(14)ID=∑i=0N−1AD.


## 4.3.3. Deviation from Uniform Histogram (DUH)

A uniform histogram of an encrypted image is desired for good encryption quality. Less deviation from uniform histogram shows better quality of encryption. For gray scale images, ideal histogram (ID) and the deviation from uniform histogram (DUH) are measured as [37](15)IHi=A×B256,0≤Ci≤255,0,elsewhere.Using the above concept, Abd El-Samie et al. proposed a new metric [37] (DUH) for measuring the quality of encrypted images. DUH is calculated as [37](16)DUH=∑i=0255IHi−HCA×B,where HC is the actual histogram value of ciphertext image.The MD, ID, and DUH are shown in Table6. All values confirm the higher security of the proposed scheme.Table 6
Encryption quality analyses.
ImagesMDIDDUH15.8515×104400460.025325.9088×104376580.029234.8168×104366220.0280


## 4.4. Energy

Gray-level co-occurrence matrix (GLCM) is a statistical analysis of texture measurement that reflects the spatial property of image pixels. A squared sum of GLCM elements is energy. For plaintext images, some pixels have large values in gray-level co-occurrence matrix due to which the energy values are high but for ciphertext images, the values of energy are smaller because of the distributed energy values. The energy analysis can be done using the following equation.(17)E=∑i,jpi,j2,where pi,j is the position of pixels in gray-level co-occurrence matrix. For a constant image, energy value is equal to 1. Lower values indicates higher randomness in image pixels. The energy values of the plaintext images and the corresponding ciphertext images are shown in Table 7 which shows that the energy values of the ciphertext images are very small.Table 7
Energy analysis.
ImagesOriginal imageCiphertext image10.26310.015620.24870.015630.21590.0156


## 4.5. Contrast

Contrast measures the variation in GLCM. With the help of contrast, a viewer can differentiate between the different objects of an image. A higher value of contrast is required for an encrypted image. For a constant image, the value of contrast is 0. Contrast of an image is measured as(18)C=∑i,ji−j2×pi,j,where pi,j indicates the number of GLCM. The values of contrast for plaintext images and ciphertext images are tabulated in Table 8 which clearly indicates that the contrast values of the ciphertext images are very large as compared to the contrast values of plaintext images.Table 8
Contrast analysis.
ImagesOriginal imageCiphertext image10.427410.480820.604710.544030.343510.6562


## 4.6. Homogeneity

Another parameter that can be deduced from GLCM is homogeneity. Homogeneity is the closeness of element distribution in the GLCM. For an efficient image encryption algorithm, the homogeneity values should be low. For determination of homogeneity, the equation used is(19)HOM=∑i,jpi,j1+i−j,where pi,j represents the gray-level co-occurrence matrices in GLCM. The homogeneity values of the test images are shown in Table 9. It is clear from Table 9 that the proposed scheme provides higher security for plaintext images as the values of homogeneity are lower for encrypted images.Table 9
Homogeneity analysis.
ImagesOriginal imageCiphertext image10.93510.389220.92100.389430.93940.3875


## 4.7. Structural Content and Average Difference

To determine the similarity between plaintext image and its corresponding ciphertext image, the structural content test can also be applied. It indicates their level of similarities. When the two images are totally different from one another, the value of structural content is 0 and a value of 1 means identical images. In case of image encryption, the value of structural content should be near 0. Mathematical expression for structural content is(20)SC=∑i=1M∑j=1NOi,j2∑i=1M∑j=1NEi,j2,where Oi,j is the original image and Ei,j is the encrypted image. Values of structural content can be observed from Table 10.Table 10
Structural content and average difference analysis.
ImagesSCAD10.8228−2.691421.01049.511931.111916.8750


## 4.8. Key Space Analysis

The strength of an encryption technique is hidden in secret key parameter. Therefore, key is the most critical feature of a cryptosystem. Smaller key space may lead to expose the full key or a part of key. In digital image encryption, larger key space indicates resistance against the brute force attack. In this work, we have used three chaotic maps and total initial conditions are 8, and as a result, key space (KS) is written as(21)KS=1015×1015×1015×1015×1015×1015×1015×1015=10120≈2400.From the above KS analysis, one can see that the proposed scheme provides sufficient larger key space and hence it is resistant to a number of exhaustive key search attacks and brute force attacks.


## 4.9. Computational Complexity Analysis

The proposed scheme is tested and implemented in MATLAB R2019b on a PC with 2.70 GHz CPU and 8 GB RAM. When the size of selected DCT block and plaintext image is same, encryption takes approximately 0.063 seconds. Decryption is the reverse process of encryption and it also takes 0.063 seconds. It is clear from Table11 that when size of DCT block reduces, encryption time also reduces. In other traditional encryption schemes, the aforementioned feature is not available. However, one can see from Figure 10 that when size of DCT block reduces, decryption quality also reduces.Table 11
Encryption/decryption time analysis with different DCT sizes.
DCT sizeEncryption time (sec)M×N/2×20.0212M×N/4×40.0117M×N/8×80.0095M×N/16×160.0092Figure 10
Effect of different DCT sizes. (a) DCT sizeM×N/2×2. (b) DCT size M×N/4×4. (c) DCT size M×N/8×8. (d) DCT size M×N/16×16.
(a)(b)(c)(d)


## 5. Comparison with Other Traditional Image Encryption Schemes

In this section, the proposed encryption scheme is compared with other state-of-the-art encryption algorithms. As cameraman (shown in Figure11) image is most widely used in the area of image processing and image security, we have considered cameraman image in this section. The size of the cameraman image is 256×256 in this paper. Table 12 shows that the proposed technique outperforms other encryption techniques in all security metrics except MD and ID where the MD and ID are in favor of reference [38]. However, only these two metrics are not sufficient for the security. Results of all other security metrics show that the proposed technique is secure and real-time applicable.Figure 11
Cameraman image.Table 12
Security comparison.
Security parameterReference [39]Reference [40]Reference [38]ProposedCorrelation coefficient0.1156−0.00120.49520.0010Entropy7.70157.98847.28257.9969Maximum deviation6.8×1045.6×1048.1×1046.2×104Irregular deviation3.9×1043.6×1046.0×1043.7×104Deviation from UH0.26290.04070.46900.0273Energy0.01740.01590.05940.0156Contrast8.94739.97971.625610.5064Homogeneity0.45870.39730.62170.3890


## 6. Conclusion

A novel chaos-based encryption scheme is presented in this paper which can be deployed in the application of camera-based real-time secure occupancy monitoring system. The system initially transforms plaintext image to DCT coefficients and then a block from the coefficients is selected for confusion-diffusion processes. The ciphertext image size is obviously much smaller than the plaintext size, and hence the compressed ciphertext can be transmitted over a bandwidth-constrained channel. Experimental results reveal that the proposed encryption-compression system reduces overhead for channels and the ciphertext is also highly secure. Moreover, the quality of reconstructed plaintext image reduces with the size reduction of DCT coefficients. Comparison with other schemes highlighted that the proposed scheme is highly secure against a number of attacks.



---

*Source: 7745132-2022-11-08.xml*