mathematics Article Neural Attractor-Based Adaptive Key Generator with DNA-Coded Security and Privacy Framework for Multimedia Data in Cloud Environments Hemalatha Mahalingam 1 , Padmapriya Velupillai Meikandan 2 , Karuppuswamy Thenmozhi 3 , Kawthar Mostafa Moria 4 , Chandrasekaran Lakshmi 3 , Nithya Chidambaram 3, * and Rengarajan Amirtharajan 3, * 1 2 3 4 * Citation: Mahalingam, H.; Velupillai Meikandan, P.; Thenmozhi, K.; Moria, K.M.; Lakshmi, C.; Chidambaram, N.; Amirtharajan, R. Neural Attractor-Based Adaptive Key Generator with DNA-Coded Security and Privacy Framework for Department of Electrical and Computer Engineering, Faculty of Engineering, King Abdulaziz University, Jeddah 22254, Saudi Arabia; [email protected] Department of Computer Sciences, Marquette University, Milwaukee, WI 53233, USA; [email protected] School of Electrical & Electronics Engineering, SASTRA Deemed University, Thanjavur 613401, India; [email protected] (K.T.); [email protected] (C.L.) Department of Computer Science, Faculty of Computing and Information Technology, King Abdulaziz University, Jeddah 22254, Saudi Arabia Correspondence: [email protected] (N.C.); [email protected] (R.A.) Abstract: Cloud services offer doctors and data scientists access to medical data from multiple locations using different devices (laptops, desktops, tablets, smartphones, etc.). Therefore, cyber threats to medical data at rest, in transit and when used by applications need to be pinpointed and prevented preemptively through a host of proven cryptographical solutions. The presented work integrates adaptive key generation, neural-based confusion and non-XOR, namely DNA diffusion, which offers a more extensive and unique key, adaptive confusion and unpredictable diffusion algorithm. Only authenticated users can store this encrypted image in cloud storage. The proposed security framework uses logistics, tent maps and adaptive key generation modules. The adaptive key is generated using a multilayer and nonlinear neural network from every input plain image. The Hopfield neural network (HNN) is a recurrent temporal network that updates learning with every plain image. We have taken Amazon Web Services (AWS) and Simple Storage Service (S3) to store encrypted images. Using benchmark evolution metrics, the ability of image encryption is validated against brute force and statistical attacks, and encryption quality analysis is also made. Thus, it is proved that the proposed scheme is well suited for hosting cloud storage for secure images. Multimedia Data in Cloud Environments. Mathematics 2023, 11, 1769. https://doi.org/10.3390/ Keywords: chaos key generator; adaptive key generator; DNA encoding; image ciphering; neural networks; cloud storage math11081769 Academic Editor: Catalin Stoean MSC: 94A60 Received: 8 March 2023 Revised: 30 March 2023 Accepted: 3 April 2023 1. Introduction Published: 7 April 2023 In recent decades, the world of computing has grown tremendously. The revolution in modern gadgets is completely rebuilding information sharing and storing in the public sector. In reflection, the security and privacy of information sharing have become a challenge [1]. Additionally, the incremental impact of data storage platforms such as cloud [1], fog [2], edge [3], etc., has led to development in the field of information technology (IT). The rapid increase in Internet of Things-centric engineering applications also demands platforms such as cloud and edge [4,5]. However, information security is a significant concern during transit, and the rest of the multimedia data are shared in the public domain. Confidentiality, integrity, authentication and nonrepudiation are security components that structure the security solutions to share and store multimedia data. The cloud paradigm has recently enabled worldwide organisations to host and run their business applications Copyright: © 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/). Mathematics 2023, 11, 1769. https://doi.org/10.3390/math11081769 https://www.mdpi.com/journal/mathematics Mathematics 2023, 11, 1769 2 of 23 and IT services in cloud environments (public, private and hybrid). The consistent growth of the cloud paradigm makes it a cornerstone for efficient and affordable multimedia data storage for various applications. Owing to the multitenant nature of the cloud, addressing the security and privacy concerns of multimedia data is essential. Authentication is one solution to ensure the tightest security for confidential and customer data. Images are a significant segment of multimedia data. Multimedia data are captured and transmitted to geographically distributed cloud environments. One such solution is proven and potential image encryption. Cloud computing plays a commendable role in shaping the IT infrastructure [6]. Cloud computing is the consolidated, centralised/federated, automated and shared computing model representing IT industrialisation. Due to the shared environment, anybody can access cloud services globally to host their data. The pay-per-usage model has created a string of newer possibilities and opportunities for business houses, IT service providers, governments and other establishments across the globe. The cloud environment offers infrastructure, a platform and storage as a service. Storage is the superior service and backbone for e-commerce and online finance applications (e.g., Salesforce CRM and Netflix) [7]. However, security and privacy are unbeatable challenges for the cloud storage environment, particularly for images as multimedia data. In addition, tamper resistance and data protection are significant challenges [8]. The new shape for image encryption schemes is vital in this concern. Ciphering images is the solution to protect the images in the public cloud storage area. The art of the image encryption approach is to make the image unreadable by unauthorised users. Due to the uniqueness of the image, such as high correlation among neighbouring pixels, conventional crypto solutions cannot be advised for image ciphering [9]. Chaos theory supports image encryption to break neighbouring pixels’ correlation after encryption. Chaotic maps [10], attractors [11], etc. have specific properties such as periodicity, greater keyspace, sensitivity to initial parameters, etc. [12], which played a commendable role in the substitution and transposition process of image encryption [13]. Ponuma et al. proposed compressive sensing-based image encryption with the key matrix generated from the chaotic measurement approach [14]. 2. Related Works The confusion process using a chaotic Arnold’s cat map (ACM) has a flaw: the specific number of rotations fetches the original image again [15]. Along with ACM, the diffusion process using chaotic nature keys increases impulsiveness [16]. Belazi et al. proposed a new 1D map for a permutation-substitution network attained through chaotic linear fractional transformation (LFT) along with the interleaved diffusion process [17]. Huang et al. suggested plain image-dependent encryption through N-dimensional chaotic maps [18]. Broumandnia experimented with image ciphering using multidimensional nonlinear chaos equations to enhance the keyspace [19]. Finally, Chen et al. proposed an image ciphering technique which tolerates brute-force attacks. Nonlinear fractional Tchebyshev moments are used to achieve the fractal permutation to enrich the security level of a colour image [20]. DNA blended image encryption has become a remarkable strategy for data privacy [21]. Substitution rules of DNA coding agree that chaos offers better diffusion in image encryption, which increases the keyspace and entropy, and the correlation results are meagre [22]. Hu et al. suggested a spatiotemporal chaos system constructed using a logistic-sine system (LSS) in the coupled map lattice (CML) for diffusion and DNA-based shuffling in the encryption process and obtained good entropy [23]. Chai et al. experimented with the DNA blended chaos-based grey image encryption where 1D chaotic maps and cipher block chaining approaches are used to obtain near-zero correlation and maximum entropy [24]. Enayatifar et al. proposed DNA XORing for diffusing the image followed by confusion through three-dimensional logistic maps. Still, the diagonal correlation of the encrypted image is near zero compared to the vertical and horizontal correlation of the same. Additionally, the entropy value needs to be improved [25]. Mathematics 2023, 11, 1769 3 of 23 A multidimensional hyperchaotic system generates the random key for colour image encryption blended with a DNA-based diffusion process at block and bit levels [26,27]. Wenjie et al. experimented with plaintext-specific key generation for image encryption. The SHA-512 hash value is generated for every plain image as a random key for bit-level scrambling and diffusion [28]. Pavithran et al. suggested DNA-based image encryption using a hyperchaotic key generator [29]. Yousif et al. experimented with an image encryption algorithm comprising bit-level permutation and diffusion using DNA addition to improve the resistivity against known attacks in the cryptosystem [30]. Qin et al. suggested a fully homomorphic encryption (FHE) scheme for image encryption linked with cloud storage where complexity and overhead are very high, even for small images [31]. Chidambaram et al. proposed the DNA blended chaos-based image encryption to offer a secure image repository in the public cloud. Due to coupled chaos and cipher block chaining approaches, the image entropy after encryption was increased, but the keyspace was small, which may not be entertained [32]. Zhang et al. proposed an image encryption algorithm for the Internet of Multimedia Things (IoMT), a combination of Arnold transform-based scrambling followed by XORbased diffusion using the key generated through cascade chaotic maps [33]. The neuralbased works have concluded that it is well suited for all images, namely grey, colour and medical images, which are more feasible for cloud-based storage. In cloud storage, the user is not restricted from uploading these types of images. In addition, neural-based works contribute metrics equivalent to the chaos and attractors [34–37]. It is observed from the literature that the image encryption approaches [38–53] linked with cloud storage have become essential, and there are few such algorithms in the literature. Utility-specific algorithms to offer multimedia security to cloud storage demand cloud computing. This proposed algorithm can be a solution for secure image storage in the public cloud network. This security framework experimented with DNA coding blended with chaotic maps to cipher grey images before storing them in a public repository. Any authenticated user can download the decrypted image from the cloud. Later, with the valid keys, the image is decrypted to attain the original image, with confidentiality and authentication. The proposed algorithm is an enhanced approach for managing cloud repositories with utmost image security. From the survey, offering security for sharing information in the public domain is essential. The uniqueness of the proposed encryption scheme has been enriched with adaptive key generation and chaos key generation for image encryption. As all multimedia data are unique, including their dimensions, value range, nature of the value, properties of the data, randomness and redundancy, at the same time, the key should be random, and it should not be predicted easily. With consideration, the proposed scheme has been inaugurated with adaptive key generation using the back propagation neural (BPN) model, which should be a supervised learning model. As the input of the neural network should be extracted from the features of the multimedia data, such as images and outputs, the initial seed has limited chaotic range. Future prediction is an inherent property of the artificial neural network. The BPN model includes precise selection for the adaptive key generation; during the training, BPN can learn about the randomness and redundancy nature of the image from the extracted image features. After the training, BPN can adapt to any image, producing the adaptive key. The proposed security framework mainly focuses on securely sharing and storing images in the cloud. The significant contributions of the proposed solution are: 1. 2. 3. 4. 5. 6. Neural–DNA–chaos permutation-based image encryption. Adaptive key generation based on plain image. Neural-based confusion of grey image. Establishment of a public cloud interface with the security framework. Validation of user authenticity to access the cloud-ciphered image. Improved protection for image sharing in multimedia communication. Mathematics 2023, 11, 1769 4 of 23 3. Pre-Requisites 3.1. DNA Approach Nucleic acid bases A (adenine), C (cytosine), G (guanine) and T (thymine) form a DNA sequence. It produces a DNA-coded value for every two-bit binary value, i.e., 00, 01, 10, 11. Based on Watson and Crick’s complementary rule, A complements T and G complements C. Thus, the possible combinations of DNA coding and operations result in 24 DNA rules in which only 8 rules are appropriate for image encryption, as shown in Table 1. Table 1. DNA encoding rules. Binary Stream (DNA Rules) 00 01 10 11 I II III IV V VI VII VIII A A T T C C G G C G G C A T A T G C C G T A T A T T A A G G C C In DNA space, addition, subtraction and XORing operations are carried out to offer diffusion. DNA XORing reflects the binary XOR operation rule in DNA space. DNA addition and subtraction are performed as follows: DNAX(OUT) = mod((DNAX(IN1) + DNAX(IN2)), 4) DNAX(OUT) = DNAX(IN1) − DNAX(IN2); if DNAX(IN1) − DNAX(IN2) = (4 + DNAX(IN1)) − DNAX(IN2); else DNAX(OUT) is the output DNA value in the ruleset X after addition/subtraction. DNAX(IN1) and DNAX(IN2) are the input values in DNA space at the rule set X. 3.2. Chaotic System The chaotic system offers a good impact in ciphering the images due to its properties of ergodicity, keyspace and chaotic behaviour. The proposed work used 1D logistic and tent chaotic maps. The initial parameters for the chaotic maps X0 and Y0 vary from 0 to 1. The control parameter for the 1D logistic map is 3.57 ≤ α ≤ 4 and, for the tent map, 2 ≤ µ ≤ 4. The chaotic equations for a 1D logistic map and tent map are expressed through (1) and (2). F (α, Xn+1 ) = (α × Xn ) × (1 − Xn ) (1) µYn ; Yn < 0.5 2 F (µ, Yn+1 ) = µ(1 − Yn ) ; Yn ≥ 0.5 2 (2) The Suitability of Chaotic Sequences for the Image Encryption Algorithm The chaotic system consistently exhibits disordered behaviour due to chaos properties. In addition, it shows a direct relation with properties expected for cryptographic functions, namely confusion and diffusion [38]. Even if there is a slight change in the initial condition value, the chaos sequences will diverge to the extreme after some iteration. The ergodicity property in the diverged sequences will give uncorrelated neighbouring values, making the chaos system genuinely dynamic. Regarding the property of sensitivity to initial condition value, two very close initial condition values, such as 0.949 and 0.950, have been taken as input and iterated 20 times, as illustrated in Figure 1. condition value, the chaos sequences will diverge to the extreme after some iteration. The ergodicity property in the diverged sequences will give uncorrelated neighbouring values, making the chaos system genuinely dynamic. Regarding the property of sensitivity to initial condition value, two very close initial condition values, such as 0.949 and 5 of 23 0.950, have been taken as input and iterated 20 times, as illustrated in Figure 1. Mathematics 2023, 11, 1769 Chaotic values Random series for two different initial conditions Initial condition = 0.949 Initial condition = 0.950 Iterations Figure 1. Random series for two for different initial conditions. Figure 1. Random series two different initial conditions. 3.3. Hyperchaotic HNN 3.3. Hyperchaotic HNN The presented work employed a four-node HNN. All the nodes are interconnected The presented work employed a four-node HNN. All the nodes are interconnected with all others, along with self-connection. Every node produces the output based on its with all others, along with self-connection. Every node produces the output based on its previous state and the external bias input. The connection paths between the nodes are previous state and the external bias input. The connection paths between the nodes are weighted, and the updated weights depend on the Hebb rule with a hyperbolic activation weighted, and the updated weights depend on the Hebb rule with a hyperbolic activation function, which exhibits the desired chaotic behaviour. Since the proposed HNN has four function, which exhibits the desired chaotic behaviour. Since the proposed HNN has four nodes, there are 16 weight values, namely W1 –W16 (3). nodes, there are 16 weight values, namely W1–W16 (3). w1 w2 w3 w4 w w4 w w w5 w61 w7 2 w8 3 Wij = (3) w ww w w w8 105 11 6 12 7 w9 w (3) Wijw= 13 w14 w15 w16 w 9 w 10 w 11 w 12 compared to the Converged weight values decide the accuracy of obtained output w w w w integer/floating 13 14 15 16 actual output. Based on the activation function, the weight values can be decimal values. The HNN generates random sequences chaoticoutput behaviour using to the Converged weight values decide the accuracy with of obtained compared Equations (4) and (5). actual output. Based on the activation function, the weight values can be integer/floating 4 decimal values. The HNNx generates random sequences with chaotic behaviour (4) using i+1 = −ci xi + ∑ wij vj Equations (4) and (5). j=1 vix= tanh = −(xci )x i +1 i 4 i + w ij v j j=1 (5) (4) where Ci is constant and C1 = C2 = C3 = 1; C4 = 100; Xi is the previous state and wij is the weight matrix. vi = tanh (xi ) (5) Nonlinearity analysis of HNN The proposed hyperchaotic HNN weight matrix is given below: where Ci is constant and C1 = C2 = C3 = 1; C4 = 100; Xi is the previous state and wij is the weight matrix. 1 0.5 −3 −1 Nonlinearity analysis ofHNN 0 2+p 3 0 The proposed hyperchaotic HNN weight matrix is given below: wij = 3 −3 1 0 100 0 0 170 where p is the control parameter. 3 100 −3 1 0 0 0 170 where p is the control parameter. 6 of 23 The weight matrix must be asymmetrical, and the control parameter p = 0.3 is fixed to achieve the chaotic behaviour. With control parameter p = 0.3, the chaotic behaviour is The weight matrix must be asymmetrical, and the control parameter p = 0.3 is fixed depicted using Figure 2. The chaotic behaviour shown in Figure 2 depends on the initial to achieve the chaotic behaviour. With control parameter p = 0.3, the chaotic behaviour is seed Xi, weight values andusing theFigure control parameter p. shown in Figure 2 depends on the initial depicted 2. The chaotic behaviour Mathematics 2023, 11, 1769 seed Xi , weight values and the control parameter p. (a) (b) (c) (d) (e) (f) Figure 2. Chaotic behaviour with p = 0.3. (a–c) Between nodes all other three nodes. Figure 2. Chaotic behaviour of HNN withofpHNN = 0.3. (a–c) Between nodes X1Xand other three 1 andall (d,e) Between nodes X2 with X3 and X4 . (f) Between nodes X3 and X4 . nodes. (d & e) Between nodes X2 with X3 and X4. (f) Between nodes X3 and X4. 4. Proposed Approach 4. Proposed ApproachThe proposed approach consists of transposition followed by two DNA-based diffusion process stages. For the confusion and diffusion processes, keys are vital. In this proposed The proposedframework, approach consists of transposition followed bythetwo diffutwo key generator modules are available to generate keys,DNA-based which are random is to changeand the pixels’ positionprocesses, in an image, and theare othervital. is to change the prosion process stages.sequences. For theOne confusion diffusion keys In this pixel’s value. A neural attractor-based key is generated specifically for the images, so no two posed framework, non-identical two key generator modules are available to generate the keys, which images have the same key for transposition. A chaotic-based key generation are random sequences. One to change pixels’ an image, and the other is generates the is random numbersthe through whichposition image pixelin values are diffused. First, the adaptive key is generated through neural networks for the confusion process. to change the pixel’s value. A neural attractor-based key is generated specifically for the Second, features extracted from the plain image influence the key generation. Hence, images, so no two generated non-identical haveThe the same key transposition. A chaotickeys are images image specific. advantage is thatfor cryptanalysis cannot guess the key without knowing image features and features unique to theimage images. pixel Third, the based key generation generates thethe random numbers through which values Hopfield neural network confuses the image irrespective of the modality or pixel intensity are diffused. of the plain image; the knowledge database of the confusion model is updated to the plain First, the adaptive isimage-specific generated confusion throughis carried neuralout; networks for the redundancy confusionis proimage. key Hence, as a result, interpixel removed, which enhances the resistance against statistical attacks. cess. Second, features extracted from the plain image influence the key generation. Hence, generated keys are image specific. The advantage is that cryptanalysis cannot guess the key without knowing the image features and features unique to the images. Third, the Hopfield neural network confuses the image irrespective of the modality or pixel intensity of the plain image; the knowledge database of the confusion model is updated to the plain Mathematics 2023, 11, 1769 is removed, which enhances the resistance against statistical attacks. Adaptive key generation can be implemented with supervised learning, the BPN model. The model training data set is considered a significant feature of the image and required range of chaotic seeds. The proposed model enhances security using artificial intelligence. Firstly, adaptive key generation using the BPN model and image confusion 7 of 23 with the Hopfield neural attractor are carried out. The BPN model is a multilayer feedforward architecture that can be learned through back propagating the error and with the gradient descent method. The Hopfield neural attractor is a recurrent random auto-assokey generation canneural be implemented with supervised learning, thethen BPN ciatorAdaptive architecture. The Hopfield attractor is stimulated with initial inputs, model. Theremoved model training data set is considered feature of the image and inputs are and the attractor moves towardsa asignificant stable state. With the initial input, required range of chaotic seeds. proposed enhances security artificial the Hopfield neural attractor has The a finite numbermodel of pseudo-random states.using The pseudointelligence. key process generation using the model and image confurandom statesFirstly, govern adaptive the confusion adaptively. TheBPN proposed method is a hybrid sion with the Hopfield attractor are carried out. The BPN model is a multilayer technique which creates neural artificial intelligence-assisted DNA blended security. feedforward that can be block learned through backpixels propagating the error and Diffusionarchitecture stages are called cipher chaining, where are ciphered sequenwith method. The Hopfield attractor a recurrent random tially.the Thegradient diffusiondescent operation uses the random keysneural generated by theischaos key generator. auto-associator architecture. Theinto Hopfield neural is in stimulated with initial inputs, The encrypted image is pushed a storage areaattractor available the public cloud environthen areberemoved theoriginal attractor moves a stablekey(s). state. With the initial mentinputs and can retrievedand as the only withtowards the encryption The proposed input, the Hopfield neural attractor a finite number pseudo-random framework establishes secure storage has of grey images in theofcloud, as shown instates. FigureThe 3. pseudo-random states govern the confusion process adaptively. proposed method The proposed security framework for the cloud-based grey imageThe repository consists ofis avarious hybridphases technique which creates artificial intelligence-assisted DNA blended security. in the image encryption process, namely, Diffusion stages are cipher block chaining, where pixels are ciphered sequenPhase I: Adaptive keycalled generator. tially.Phase The diffusion uses the random keys generated by the chaos key generator. II: Chaosoperation key generator. The encrypted image is neural pushednetwork-based into a storageconfusion area available in the public cloud environPhase III: Hopfield process. mentPhase and can retrieved the original only with the encryption key(s). The proposed IV: be Cipher blockas chaining-based diffusion process. framework establishes grey images in the cloud, as shown in Figure 3. Phase V: Interfacingsecure cloudstorage and theof security framework. The proposed framework for theblock cloud-based image repository consists of Phase VI: security Image decryption—cipher chaining grey process. various phases the image encryption process, namely, Phase VII: in Image decryption—Hopfield-based reassembling. Figure Proposed Security Security Framework. Framework. Figure 3. 3. Proposed Phase I: Adaptive key generator. 4.1. Image Ciphering and Deciphering Process Phase II: Chaos key generator. The various phases neural incorporated in the image ciphering and deciphering process are Phase III: Hopfield network-based confusion process. givenPhase below: IV: Cipher block chaining-based diffusion process. Phase V: Interfacing cloud and the security framework. Phase VI: Image decryption—cipher block chaining process. Phase VII: Image decryption—Hopfield-based reassembling. 4.1. Image Ciphering and Deciphering Process The various phases incorporated in the image ciphering and deciphering process are given as Algorithms 1–4 below: Mathematics 2023, 11, 1769 8 of 23 Algorithm 1: Adaptive random sequence generation using discrete Hopfield attractor Input: Multiplicative identity matrix (B)[4,4] , sampling rate Tw , random initiator h[1,4] Output: Nonlinear random sequence Ω Initialise wij ← [w w/2 σ − w; Ψ 2w 3w 0; 3w φ w 0; mw 0 0 nw] ← [1 0.5 −5 −1; −0.37 2 3 0; 3 −13 1 0; 100 0 0 170] Update the wij with new σ, Ψ, φ Get H(0) ← [h]T Repeat f ( H (r )) = tanhH (r )H(r + 1) = (1 − BTw ) H(r ) + Tw w f (H(r )) Dh = |(H(r + 1) − b |H(r + 1)| c ) | Set r ← r + 1 Until r ≤ (Image size/4) Initialise Ω ← {} for f ← 1 to 16,384 for i ← 1 to 4 Ω ((4 × (f − 1)) + i) = Dh(i) end end Return (Ω) Algorithm 2: Chaos key generator Input: Initial parameters (KLD (0), KT (0)) control parameters (γ, µ) and image size N 3.4 ≤ α2 ≤ 4; 0 ≤ γ ≤ 2; 0 ≤ KLD (0) and KT (0) ≤ 1 Output: Chaos sequence KLDM and KTM as key for size N and DNA rule selectors R1 , R2 1D tent map-based sequence as key for Diffusion I Initialise KTM = { }; θ = 1/2 for i ← 1 to N do if KT (i − 1) ≥ θ then Set KT (i) ← (µ × (1 − KT (i − 1))) else Set KT (i) ← (µ × KT (i − 1)) Set KTM (i) ← mod (KT × 1014 , 256) end Return (KTM ) 1D logistic map-based sequence as key for Diffusion II Set KLD (1) ← (γ × KLD (0)) × (1 − KLD (0)) Initialise KLDM = { } for i ← 2 to N do Set KLD (i) ← (γ × KLD (i −1)) × (1- KLD (i − 1)) Set KLDM (i) ← mod (KLD × 1014 , 256) end Return (KLDM ) Algorithm 3: Image encryption—Hopfield based permutation Input: Original image I of size (X) [M, N], Nonlinear random sequence Ω Output: Scrambled image matrix C Get [ R, ∀] ← sort (Ω , ‘ascend’) where R is the ascending order of key stream Ω; ∀ is the index of the sorted key stream Ω Repeat Set C ( j) ← I (∀( j)) Set j ← j + 1 Until j < (M × N) Return (C) Mathematics 2023, 11, 1769 9 of 23 Algorithm 4: Image encryption—cipher block chaining process Input: Shuffled image C, Key sequences KTM , KLDM , rule for DNA encoding R1 , R2 and 8-bit secret key K1 Output: Encrypted image E Set E(1) ← C(1) ⊕ K1 for i← 2 to N do Cd (i) ← C(i) ⊕ E(i − 1) Diffusion Stage I: R 1 Set CdDNA (i) ←− DNAEncode (Cd (i)) R 1 Set KTMDNA (i) ←− DNAEncode (KTM (i)) Set List ← [0, 2, 4, 6] for j ← 1 to 4 do Set n ← List[j] Set Cd1 (i)[n:n + 1] ← mod ((CdDNA (i) [n:n + 1] + KTMDNA (i) [n:n + 1]), 4); end Diffusion Stage II: R 2 Set Cd1DNA (i)←− DNAEncode (Cd1 (i)) R 2 Set KLDMDNA (i) ←− DNAEncode (KLDM (i)) Set List ← [0, 2, 4, 6] for j ← 1 to 4 do Set n ← List[j] Set E(i)[n:n + 1] ← Cd1DNA (i) [n:n + 1] ⊕ KLDMDNA (i) [n:n + 1] end end Return (E) The aim is to store the secure image in a public repository called the cloud. So, the ciphered images are uploaded into the private storage area allotted by Amazon’s public cloud, availed with access privileges and credentials. Algorithm 5 pseudo-code describes the security framework and cloud storage interface. First, the authenticity verification process is carried out with invalid credentials. Algorithm 5: Authenticated cloud access process Input: Encrypted image E of size X, login credentials of AWS, identity and access management (IAM) key pairs Output: Uploaded encrypted image E in the cloud storage Set AWS login credentials: username ← “username” and password←“password” emphSet IAM key pairs: access key ← “AAAAAAA” and secret key ← “SSSSSSS” if (username = “username” && password = “password”) then if (access key = “AAAAAAA” && secret key = “SSSSSSS”) then captcha = randomgen (captcha) and user expect to type it on the screen if captcha matched then Access = “Access Granted” Push S3: Bucket ← Encrypted images else Return (“Invalid CAPTCHA”) else Return (“Invalid Credentials”) else Return (Access = “Access Denied”) The cloud is accessed to download the ciphered images with valid credentials. Then, the ciphered images are decrypted using the algorithms described in Algorithms 6 and 7. Mathematics 2023, 11, 1769 10 of 23 Algorithm 6: Image decryption—cipher block chaining process Input: Encrypted image of size (E) [M, N], key sequences KTM , KLDM , rule for DNA encoding R1 , R2 and 8-bit secret key K1 Output: Shuffled image C Diffusion Stage I: R 2 Set EDNA (i) ←− DNAEncode (E(i)) R 2 Set KLDMDNA (i) ←− DNAEncode (KLDM (i)) Set List ← [0, 2, 4, 6] for j ← 1 to 4 do Set n ← List[j] Set Cd1 (i)[n:n + 1] ← EDNA (i) [n:n + 1] ⊕ KLDMDNA (i) [n:n + 1] end Diffusion Stage II: R 1 Set Cd1DNA (i) ←− DNAEncode (Cdi (i)) R 1 Set KTMDNA (i) ←− DNAEncode (KTM (i)) Set List ← [0, 2, 4, 6] for j ← 1 to 4 do Set n ← List[j] Set Cd (i)[n:n + 1] ← mod ((Cd1DNA (i) [n:n + 1] − KTMDNA (i) [n:n + 1]), 4) end Set C(1) ← Cd (1) ⊕ K1 for i ← 2 to N do Set C(i) ← Cd (i) ⊕ Cd (i − 1) end Return (C) Algorithm 7: Image decryption—Hopfield-based reassembling Input: Scrambled image matrix C of size (X) [M, N], nonlinear random sequence Ω Output: Original image I Get [R, A] ← sort (Ω, “ascend”) where R is the ascending order of key stream Ω; A is the index of the sorted key stream Ω Repeat Set I (A(j)) ← C(j) Set j ← j + 1 Until j < (M × N) Return (I) 4.2. Security Framework Interface with Public Cloud In this proposed approach, the S3 service from Amazon Web Services (AWS) is used as a public repository to store the grey images in encrypted form. The proposed approach offers third-level authentication because one of the contributions of the work is improved protection for image sharing in multimedia communication over public repositories. A user registers with AWS to obtain the S3 service and credentials as a cloud user. Every registered user is provided with a username and password as a level 1 authentication credential. At level 2 authentication, the secret key pairs validate the user’s identity. Third-level authentication employs CAPTCHA verification. During data access, the user’s authenticity is verified. If the credentials fail to be correct at any level of authentication, the user access is denied with the warning “Invalid credentials”. The interface between the proposed framework and the AWS is illustrated in Figure 4a. Figure 4b illustrates the uploading process of cipher images into AWS S3 storage. The view of the S3 bucket with uploaded ciphered images is shown in Figure 5. Mathematics 2023, 11, 1769 level authentication employs CAPTCHA verification. During data access, the user’s au thenticity is verified. If the credentials fail to be correct at any level of authentication, th user access is denied with the warning “Invalid credentials”. The interface between th proposed framework and the AWS is illustrated in Figure 4a. Figure 4b illustrates the up of 23 loading process of cipher images into AWS S3 storage. The view of the S311bucket wit uploaded ciphered images is shown in Figure 5. (a) (b) Mathematics 2023, 11, x FOR PEER REVIEW 12 o Figure 4. (a) Block diagram Storingciphered ciphered image S3 bucket. (b) diagram Block diagram view Figure 4. (a) Block diagram view: view: Storing image in S3inbucket. (b) Block view: Retrieving ciphered S3bucket bucket with three-tier authentication. Retrieving cipheredimage imagefrom from S3 with three-tier authentication. 5. Viewimage of thein ciphered in AWS S3 bucket. Figure 5. View of Figure the ciphered AWS S3image bucket. 5. Results and Discussion 5. Results and Discussion The performance ofperformance the proposedofencryption approach wasapproach analysedwas using different The the proposed encryption analysed using diffe grey images of size [256, 256] with the Waterloo image databases (https://links.uwaterloo. grey images of size [256, 256] with the Waterloo image databases (https://links.uwa ca/Repository.html (accessed on 8 December 2022)). It was implemented using the Lab- using loo.ca/Repository.html (accessed on 8 December 2022)). It was implemented VIEW platformLabVIEW on an Intel Core i5 system configured with a 2.5 GHz CPU, 500 GBCPU, of 500 G platform on an Intel Core i5 system configured with a 2.5 GHz main memory and 4 GB of RAM. The ability of the encryption approach against atta such as brute force, statistical and chosen plaintext was analysed. The proposed sche is influenced by adaptive key generation using the BPN model, which generates the ad tive key based on the randomness and redundant nature of the images. Furthermore, Mathematics 2023, 11, 1769 12 of 23 main memory and 4 GB of RAM. The ability of the encryption approach against attacks such as brute force, statistical and chosen plaintext was analysed. The proposed scheme is influenced by adaptive key generation using the BPN model, which generates the adaptive key based on the randomness and redundant nature of the images. Furthermore, the security framework resists known plaintext attacks due to image-specific key generation for transposition. In addition, encryption quality analyses were carried out to prove the fitness of the proposed image encryption algorithm for secure image storage in the cloud. 5.1. Brute Force Attack 5.1.1. Keyspace Analysis According to Kerckhoff’s cipher principle, the key must be vital and secure even if the encryption algorithm is public access. Keeping a longer key for the encryption process increased the key searching space, increasing the time to find the correct key [25]. In this security framework, six keys were generated adaptively with a precision of 1014 . Hence, 10112 is the keyspace for keys generated through the HNN. For the diffusion process, three different keys, K1, K2 and K3, are used of which two keys have chaotic behaviour, requiring four initial parameters, with precision of 1014 and one key is a fixed 8-bit key. Thus, the total keyspace is 102 × 1014 × 1014 × 1014 × 1014 × 10112 = 10170 . In our earlier research on DNA blended chaos-based image encryption [24], the keyspace was 1086 . Compared to earlier work, this proposed approach exhibits greater keyspace, making the brute force attack even more complex. 5.1.2. Key Sensitivity Analysis Chaotic sequence generators such as a hyperchaotic HNN and logistic and tent maps are used in the proposed security framework because they are sensitive to the initial conditions. Furthermore, an independent and adaptive key for each image makes the key search complex. Image features used to generate the adaptive keys through the HNN make the search even more complex. For example, a change in one bit out of 256 × 256 × 8 bits in the diffusion stage II key produces an entirely different image due to the chaotic behaviour of the key generated through the 1D logistic map. This is evident for the anti-brute force attack Mathematics 2023, 11, x FOR PEER REVIEW of 23 before and approach of the proposed security algorithm. Figure 6 shows the Lena13image after encryption with correct and incorrect keys as evidence of the key sensitivity analysis. (a) (b) (c) (d) (e) (f) Figure 6. Key sensitivity analysis through various various images: (a) Plain; (b) (E1); (c) ciphered Figure 6. Key sensitivity analysis through images: (a)ciphered Plain; (b) ciphered (E1); (c) ciphered (one-bit change in original key) (E2); (d) E1 XOR E2; (e) decrypted E1 with correct key; (f) decrypted (one-bit change in original key) (E2); (d) E1 XOR E2; (e) decrypted E1 with correct key; (f) decrypted E1 with an incorrect key. E1 with an incorrect key. 5.2. Statistical Attack Analysis Images with statistical properties are subject to vulnerability when stored in public environments such as the cloud. The images before their storage are expected to have zero correlation to avoid such a security breach. The resistivity of the encryption algorithm against statistical attacks is tested through histogram, correlation and entropy analysis. (d) Mathematics 2023, 11, 1769 (e) (f) Figure 6. Key sensitivity analysis through various images: (a) Plain; (b) ciphered (E1); (c) ciphered (one-bit change in original key) (E2); (d) E1 XOR E2; (e) decrypted E1 with correct key; (f) decrypted E1 with an incorrect key. 13 of 23 5.2. Statistical Attack Analysis with statistical 5.2.Images Statistical Attack Analysisproperties are subject to vulnerability when stored in public environments suchstatistical as the cloud. The images before storage when are expected have zero Images with properties are subject to their vulnerability stored intopublic correlation to avoid such a security breach. The resistivity of the encryption algorithm environments such as the cloud. The images before their storage are expected to have zero against statistical attacks through correlation and entropy analysis. correlation to avoid suchisa tested security breach.histogram, The resistivity of the encryption algorithm against statistical attacks is tested through histogram, correlation and entropy analysis. 5.2.1. Histogram Analysis 5.2.1. Histogram Analysis The intensity of pixels in the greyscale must be distributed uniformly over the image The intensity of pixels in the greyscale must be distributed uniformly over the image plane for any encrypted image. However, due to the proposed DNA diffusion process, plane for any encrypted image. However, due to the proposed DNA diffusion process, the the histogram obtained for the test images is flat in response. Thus, an image’s unpredicthistogram obtained for the test images is flat in response. Thus, an image’s unpredictability ability is proved. The histogram analysis the test images of the proposed method is is proved. The histogram analysis for the testfor images of the proposed method is illustrated illustrated in Figure 7. Figure 7 shows that the pixels are uniformly distributed in Figure 7. Figure 7 shows that the pixels are uniformly distributed after encryption, after and encryption, andofhistograms of plain andare cipher imagesdifferent. are completely different. histograms plain and cipher images completely Plain Hist(Plain) Cipher Hist(Cipher) Figure 7. Representation of Histogram for Plain and Cipher images. 5.2.2. Neighbouring Pixel Correlation Analysis The co-located pixels in the original image are extremely correlated. Ideally, the correlation is zero for an encrypted image, i.e., a near-zero correlation [25]. After employing the proposed encryption algorithm on the images, the randomness of co-occurring pixels is high. Randomness in the encrypted images is calculated using a relation among co-located pixels. The dependency among the pixels is measured using the following expressions ((6)–(8)): covariance Yi , Yj Corr Yi , Yj = (6) σYi × σYj where standard deviation σEi is obtained by σYi v u u =t 1 M×N (Yi -mean(image))2 M × N i∑ =1 (7) Co-variance of an image is computed by Co-variance Yi , Yj = 1 M×N (Yi -mean(image)) × Yj -mean(image) M × N i∑ =1 (8) Barbara Mathematics 2023, 11, 1769 House Test Image (Lena) Ref. [25] 0.0198 0.0132 0.0032 Plain 0.8319 0.9483 0.7880 Proposed −0.0072 0.0002 0.0088 Ref. [12] −0.0187 −0.0016 0.0001 Ref. [16] −0.0212 −0.0161 −0.0110 14 of 23 Ref. [17] −0.0033 −0.0269 −0.0121 Plain 0.9782 0.9529 0.9361 where Yi and Yj are two nearby pixel values of the ciphered Proposed 0.0062 −0.0014 image. The correlation 0.0074 among neighbouring pixels in all three directions of plain and encrypted images is illustrated in Ref. [12] −0.0339 0.0186 −0.0001 Figure 8. Figure 8 reveals that the correlation with the adjacent pixel values of the ciphered Ref. [13] 0.01659 0.01531 0.00034 image is very low. Thus, the proposed neural-based adaptive key generation used for Ref. [16] 0.0023 −0.0187 −0.0225 confusion offers near-zero correlation among the neighbouring pixels compared to other Ref. [17] −0.0095 −0.0259 −0.0094 state of the art works shown in Table 2, which proves the ability of attack mitigation in the spatial domain. Horizontal Correlation Diagonal Correlation Vertical Correlation Plain Cipher Figure 8. Pixel distribution in horizontal, vertical and diagonal directions. Table 2. Correlation analysis of Proposed versus Existing methods. Correlation Direction Test Images Method Lena Plain Proposed Ref. [12] Ref. [13] Ref. [16] Ref. [17] Ref. [19] Arnold Cat Map Ref. [19] 2D Modular Chaotic Map Ref. [19] 3D Modular Chaotic Map Ref. [25] Ref. [28] Ref. [39] Ref. [40] Ref. [41] Ref. [42] Ref. [43] Ref. [44] Ref. [45] Ref. [46] Ref. [47] Ref. [48] Horizontal Vertical Diagonal 0.9106 0.0003 0.0011 0.00352 −0.0066 −0.0048 0.0003 0.0287 0.0269 0.0023 0.0028 −0.0287 0.0054 − 0.0126 0.0070 −0.0042 −0.002153 0.0090266 −0.0067 0.001348 0.0018 0.9507 0.0042 0.0098 0.00648 −0.0089 −0.0112 0.0145 0.0217 0.0038 0.0019 −0.0027 0.0071 −0.0073 − 0.0048 −0.0180 -0.0028 −0.0000901 −0.0059255 −0.0038 0.00016 0.0028 0.8849 −0.0049 −0.0227 0.00355 0.0424 −0.0045 0.0841 0.0179 0.0094 0.0011 −0.0032 0.0007 0.0021 0.0054 −0.0033 0.0027 −0.0006059 0.0055227 0.0063 0.002236 0.0016 Mathematics 2023, 11, 1769 15 of 23 Table 2. Cont. Test Images Correlation Direction Method Horizontal Vertical Diagonal Ref. [49] Ref. [50] Ref. [51] Ref. [52] Ref. [53] 0.0049 0.0015 0.0016 0.0003 0.000033 −0.0022 −0.0021 −0.0034 −0.0021 −0.000295 −0.0042 −0.0020 −0.0032 −0.0030 −0.000085 Baboon Plain Proposed Ref. [13] Ref. [14] Ref. [25] 0.8423 0.0050 0.00083 0.0003 0.0059 0.8213 0.0022 0.00660 −0.0162 0.0041 0.7408 −0.0048 0.00159 0.0134 0.0028 Cameraman Plain Proposed Ref. [12] Ref. [13] Ref. [16] Ref. [17] Ref. [25] 0.9303 −0.0055 −0.0047 0.00954 0.0063 −0.0095 0.0198 0.9590 0.0073 −0.0195 0.01908 −0.0142 −0.0170 0.0132 0.9048 −0.0072 0.0279 0.00568 0.0168 −0.0119 0.0032 Barbara Plain Proposed Ref. [12] Ref. [16] Ref. [17] 0.8319 −0.0072 −0.0187 −0.0212 −0.0033 0.9483 0.0002 −0.0016 −0.0161 −0.0269 0.7880 0.0088 0.0001 −0.0110 −0.0121 House Plain Proposed Ref. [12] Ref. [13] Ref. [16] Ref. [17] 0.9782 0.0062 −0.0339 0.01659 0.0023 −0.0095 0.9529 −0.0014 0.0186 0.01531 −0.0187 −0.0259 0.9361 0.0074 −0.0001 0.00034 −0.0225 −0.0094 The neighbouring correlation values in Table 2 prove that the neural-based confusion model breaks the correlation between the adjacent pixels and the desired level. Due to neural-based adaptive confusion, all the images are equally confused, and pixels are dislocated repeatedly until the expected correlation is achieved. 5.2.3. Information Entropy After encryption of an image, robustness and randomness are analysed using information entropy [25]. Global Shannon entropy E(s) is obtained using the following expression (9): 256 E(s) = − ∑ I(si ) log2 I(si ) (9) i=1 where I(Si ) is the probability of symbol (Si ). The pixel bit depths for grey images are always 8, so the entropy exists in the range [0 to 8]. For an ideally encrypted image, the entropy is always 8 [25]. This proposed neural-assisted DNA-based image encryption algorithm makes the pixel distribution over an image plane highly random. Therefore, the entropy value of an encrypted image is very close to 8. If the entropy value is less than 8 or close to 0 then the randomness effect in the encrypted image is significantly less and the vulnerability to attack is high. Table 3 shows that the proposed neural-based image encryption algorithm results in an entropy of almost eight, irrespective of the input image. The entropy value of the proposed encryption is compared with other state of the art works and exhibits the maximum unpredictability of the plain image. Mathematics 2023, 11, 1769 16 of 23 Table 3. Entropy Analysis of Proposed versus Existing methods. Test Images Lena Peppers Baboon Boat Cameraman Barbara House Plain 7.48183 7.9970 7.9965 7.99802 7.9951 7.9975 NA 7.9975 7.9973 7.9914 7.60129 7.9973 7.9958 7.99852 7.9965 7.9958 NA 7.9972 7.9972 NA 7.23399 7.9976 NA 7.99712 NA 7.9938 7.9972 NA 7.9972 7.9914 7.26437 7.9972 7.9959 NA 7.9960 7.9941 7.9962 NA 7.9972 NA 7.12881 7.9977 7.9964 7.99662 7.9955 7.9939 7.9972 7.9973 7.9974 NA 7.51504 7.9973 7.9957 NA 7.9937 NA 7.9969 NA 7.9972 NA 6.49614 7.9973 7.9952 7.99781 7.9978 NA NA 7.9973 7.9970 7.9914 Cipher Proposed Ref. [12] Ref. [13] Ref. [16] Ref. [25] Ref. [28] Ref. [31] Ref. [32] Ref. [39] * NA—Not Available. 5.3. Encryption Quality Analysis 5.3.1. Chi-Square Test The chi-square test measures pixel distribution in ciphered images [18]. The variation in the histogram is quantitatively obtained using a statistical metric called chi squared (χ2 ), which is expressed as follows: (PI(i) − 256)2 256 i=0 255 χ2 = ∑ (10) where PI is the pixel intensity value in the interval of 0 to 255. “i” is the intensity value in the encrypted pixels. The chi-square values that were found for encrypted images are verified with the distribution probability for 1% and 5% significance levels. The critical values for the 1% and 5% significance level with a degree of freedom of 255 are 310.457 and 293.2478, respectively. Therefore, the χ2 value must be lower than the critical values for the ideally encrypted image. Table 4 reveals the uniform distributions of pixels in an encrypted image through low chi-square values compared to essential values. Table 4. Chi-square test: Pixel distribution test. Plain Test Image Airplane Baboon Barbara Boat Cameraman Girl House Lena Peppers Splash Cipher χ2 Value H0 Test χ2 Value H0 Test 168,463 58,247.8 35,001.2 85,621.8 97,215.8 93,817.1 300,852 37,973 30,024.6 86,407.1 Fail Fail Fail Fail Fail Fail Fail Fail Fail Fail 258.172 213.781 242.57 255.305 212.992 240.836 242.477 276.633 248.867 269.953 Pass Pass Pass Pass Pass Pass Pass Pass Pass Pass 5.3.2. Histogram Maximum Deviation The histogram maximum deviation is a measure of diffusion efficiency and encryption quality. Histogram maximum deviation is the difference in histogram values between the ciphered and plain image at every pixel intensity [17]. For an ideally encrypted image, the value must be close to the total size of the image. A histogram maximum deviation Mathematics 2023, 11, 1769 17 of 23 value close to the size of an image proves the randomness of pixel distribution through the encryption process. Histogram maximum deviation (HM) is obtained using the following Equation (11): HM = 254 dif(0) + dif(255) + ∑ dif(j) 2 j=1 (11) where dif(j) is the difference between the plain and cipher image histogram at the jth index. After encryption, the histogram deviation between the plain and cipher image is high, as shown in Table 5. From Table 5, it is proven that the strength of the encryption algorithm is well suited for secure image sharing and storing compared to other state of the art works. This is because, after ciphering the image, its statistical properties do not reveal any significant detail about the plain image. Table 5. Histogram Maximum Deviation. Histogram Maximum Deviation Test Image/Method Proposed Ref. [12] Ref. [16] Ref. [17] Ref. [28] Ref. [31] Barbara Boat Cameraman Lena Peppers 40,694.5 17,944 19,384 18,148 NA 158,258 53,452.5 25,367 25,193 25,442 NA 148,597 60,413 16,674 16,803 18,007 64,119 64,300 40,921.5 20,811 19,931 21,339 41,458 NA 36,169 22,648 22,966 22,935 36,391 NA * NA—Not Available. 5.3.3. Irregular Deviation Encryption quality is analysed using irregular deviation. The linearity of the pixel distribution may be reflected in a differential attack. In any image encryption algorithm, the pixel intensities are expected to be uniformly distributed in the cipher image [17]. The irregular deviation is calculated through Equations (12)–(14), given below: d = imhist(abs((P) − (C))) (12) The mean for the histogram of the difference in pixel intensities between the plain and cipher images (d) is calculated through the following expression: Md = 1 255 di 256 i∑ =0 (13) where di is the ith element in the array d. Irregular deviation (HI ) is obtained using Equation (14). 255 HI = ∑ |di − Md | (14) i=0 Table 6 reveals that the proposed encryption algorithm distributes the pixel intensities uniformly without bias in the plain image. Mathematics 2023, 11, 1769 18 of 23 Table 6. Irregular Deviation. Test Image/Method Proposed Ref. [12] Ref. [16] Ref. [17] Ref. [28] Ref. [31] Irregular Deviation Barbara Boat Cameraman Lena Peppers 43,446 42,556 43,014 42,708 NA 129,765 46,218 36,124 36,220 36,226 NA 137,793 39,020 39,380 39,414 39,244 38,959 39,668 44,748 40,820 40,768 40,480 44,465 NA 41,394 34,824 34,706 35,088 41,184 NA 5.3.4. Deviation from Ideality Deviation from ideality must be minimal after encryption to prove the algorithm is promising for attacks [17]. Deviation of the originally encrypted image histogram from ideally encrypted images is estimated by the following Equation (15): HDI = ∑255 i=0 |imhist(Idealcipher)i − imhist(Originalcipher)i | M×N (15) where M × N is the total size of the image. Near-zero HDI proves the quality of the encryption algorithm. Table 7 depicts the existence of a very low deviation from ideality between plain and ciphered images. Thus, the proposed encryption algorithm produces low deviation from ideality compared to the existing literature, as shown in Table 7. Table 7. Deviation from Ideality. Test Image/Method Proposed Ref. [12] Ref. [16] Ref. [17] Ref. [28] Ref. [31] Deviation from Ideality Barbara Boat Cameraman House Lena Peppers 0.04834 0.0928 0.1012 0.0976 NA 0.0522 0.05002 0.0985 0.0995 0.0958 NA 0.0528 0.04437 0.092 0.1065 0.0942 NA 0.0502 0.05182 0.0934 0.1001 0.0994 0.0468 NA 0.04916 0.0977 0.0979 0.0917 0.0496 NA 0.04889 0.0994 0.1141 0.0882 0.0485 NA 5.4. Chosen Plaintext Attack Diffusion employed in the encryption through XOR alone as an operation is subject to a chosen plaintext attack. The chosen plaintext attack results in the key used for diffusion; the encryption algorithm is compromised. Any encryption algorithms against the chosen plaintext attack need to satisfy the following condition: P1 ⊕ P2 6= E1 ⊕ E2 Any two plain grey images, as P1 and P2, are XORed. Similarly, the encrypted versions of P1 and P2 as E1 and E2 are XORed. If both the XORed values are equal, it is vulnerable to chosen plaintext attack. Otherwise, breaking the image encryption algorithm is impossible, and its fitness against the chosen plaintext attack is proved. The ability of this security algorithm is analysed and it is shown that the DNA diffusion approach acts against the chosen plaintext attack. Figure 9a shows the XORed result of two plain images; the encrypted version of the same plain images is XORed, as shown in Figure 9b. Figure 9a,b are not identical, which indicates that the proposed diffusion process is not vulnerable to the chosen plaintext attack. A known plaintext attack becomes unviable in the proposed security framework due to the image-specific adaptive key generation using a neural network. Mathematics 2023, 11, 1769 ity of this security algorithm is analysed and it is shown that the DNA diffusion approach acts against the chosen plaintext attack. Figure 9a shows the XORed result of two plain images; the encrypted version of the same plain images is XORed, as shown in Figure 9b. Figure 9a,b are not identical, which indicates that the proposed diffusion process is not vulnerable to the chosen plaintext attack. A known plaintext attack becomes unviable in 19 of 23 the proposed security framework due to the image-specific adaptive key generation using a neural network. (a) (b) Figure Figure9.9.(a) (a)P1 P1⊕ ⊕P2; P2;(b) (b)E1 E1⊕ ⊕ E2. E2. 5.5.Bit BitDistribution DistributionAnalysis AnalysisatatPlane PlaneLevel Level 5.5. Thepotency potencyofofthe thediffusion diffusionprocess processisisfurther furtheranalysed analysedusing usingthe theequality equalitytest testover over The every bit plane. For any encrypted image, the distribution of zeros and ones in each bit every bit plane. For any encrypted image, the distribution of zeros and ones in each bit plane must be equal, i.e., 50% of zeros and ones must be present in each plane to prove plane must be equal, i.e., 50% of zeros and ones must be present in each plane to prove theunpredictability unpredictabilityofofthe theplain plainimage imageafter afterencryption. encryption.The Thediffusion diffusionstrategy strategyproposed proposed the in the algorithm outfit for the image encryption are shown, where the bits 1 and an in the algorithm outfit for the image encryption are shown, where the bits 1 and 00ofofan encrypted image are equally distributed and tabulated in Table 8. Table 8 shows the bit encrypted image are equally distributed and tabulated in Table 8. Table 8 shows the bit “1” percentage in each plain and encrypted test image’s bit plane. Table 8 shows that each “1” percentage in each plain and encrypted test image’s bit plane. Table 8 shows that each plane’s bit “1” in an encrypted image is equally distributed. So, the proposed DNA-based plane’s bit “1” in an encrypted image is equally distributed. So, the proposed DNA-based diffusion offers strong enough image encryption. diffusion offers strong enough image encryption. Table 8. Bit distribution analysis at plane level. Table 8. Bit distribution analysis at plane level. PlanesTest Test Images Planes Images P P Airplane Airplane E E 11 50.383 50.383 50.191 50.191 22 49.817 49.817 50.134 50.134 33 49.355 49.355 49.817 49.817 44 51.842 51.842 50.22 50.22 55 53.865 53.865 49.763 49.763 66 24.394 24.394 50.531 50.531 77 78.969 78.969 50.034 50.034 88 81.544 81.544 49.969 49.969 Baboon P E 50.247 49.834 50.075 50.006 50.378 50.09 50.563 49.844 53 50.102 55.841 50.092 44.63 49.715 53.096 49.782 Barbara P E 49.928 50.041 49.916 50.259 50.075 49.825 50.272 50.356 48.856 50.066 48.956 49.71 47.932 49.623 35.727 50.128 Boat P E 49.924 49.889 50 50.281 49.974 49.783 49.364 50.168 50.856 49.977 39.584 49.974 22.548 49.911 67.471 49.98 Cameraman P E 49.841 50.145 49.379 49.895 50.844 49.931 52.199 49.965 42.644 49.867 50.958 50.336 18.71 49.782 60.005 50.058 Girl P E 50.175 49.586 50.787 49.832 50.722 49.916 49.904 49.887 46.37 49.77 50.824 50.003 26.7 50.111 8.197 49.713 House P E 50.035 49.921 49.631 50.359 52.985 50.259 65.085 49.77 67.981 49.988 71.492 50.05 52.217 49.829 48.505 50.122 Lena P E 50.009 50.247 50.108 49.968 49.728 49.486 49.901 49.768 49.777 50.113 50.337 50.005 41.794 50.536 51.187 50.444 Peppers P E 49.979 49.925 49.715 50.201 49.796 49.954 49.933 50.281 53.462 49.966 46.248 49.78 44.778 50.204 47.327 50.194 P—Plain image; E—Encrypted image. Mathematics 2023, 11, 1769 20 of 23 5.6. Computational Complexity The overhead of the proposed security framework includes significant operations called key generation, confusion and DNA-based diffusions. The greyscale image used in this research is of size [M, N], where M = N = 256. The random number generated using the HNN takes the complexity of O {n(M × N)}. The transposition process complexity is O {M × N}. The proposed algorithm contains two DNA-based diffusion stages, which take O {4(M × N)}. So, the total computational complexity of the proposed framework takes O {(n + 5)(M × N)}. Table 9 compares the proposed system and other state of the art works with various aspects such as system configuration, tool used for implementation, the approach suggested and execution time. This proposed work has been implemented using the LabVIEW platform on an Intel Core i5 system configured with a 2.5 GHz CPU, 500 GB of main memory and 4 GB of RAM. Total execution time taken by this proposed approach, including key generation and cipher block chaining encryption, is calculated as 219.5 ms, comparable with Ref. [32]. The file is pushed into the AWS S3 bucket via a Wi-Fi network with 144.4 Mbps speed, which takes an uploading time of 0.4056 sec. Network speed influences propagation delay, which means they are inversely proportional. Table 9. Computational complexity comparison with existing literature. Parameters Tool Used for Implementation System Configuration Proposed Approach Execution Time (s) Ref. [17] MATLAB Intel Core i3-3227U 1.9 CPU and 4 GB of RAM LFT-based S-box using a new chaotic map, P-S network 0.095 Ref. [18] MATLAB R2011b Intel(R) Core (TM) i3–2350, 2.30 GHz CPU Plain image-dependent keystream using 2D logistic map 0.0343 Ref. [19] MATLAB R2017a Intel Core i7–7500 U, 3.5 GHz CPU, 4GB RAM 3D modular chaotic map permutation process for image encryption 0.8271 Ref. [25] MATLAB 8 Intel Core i7, 2.3 GHz CPU, 8 GB RAM Logistic chaos system, DNA encoding and operations. 0.281 Ref. [30] MATLAB 2013a Intel Core i3, 2.4 GHz CPU and 4 GB RAM Bit-level permutation and diffusion using DNA addition 0.54 Ref. [32] Virtual instrumentation tool Core i5, 2.5 GHz CPU, 4 GB RAM Chaos-based key generation system, DNA encoding and operations for secure image storage in the cloud 0.2188 Ref. [33] MATLAB2011b AMD A6-3420M and 2 GB RAM Secure sampling through cascade chaotic map followed by confusion using Arnold transform and single-stage XOR-based diffusion 1.663661 Proposed Virtual instrumentation tool Core i5, 2.5 GHz CPU, 4 GB RAM Neural attractor-based image-specific key generation and chaos key generation for image scrambling and DNA-based diffusion 0.2195 Existing Work 5.7. Discussion The proposed algorithm is tested with ten test images of size [256, 256]. The algorithm achieves average entropy of 7.996098 and offers better entropy when compared to Refs. [12,16,39] and is comparable with [40–53]. The near-zero correlation offered by the proposed algorithm is better than the previous works, which is also given in the findings. The obtained average bit distribution at the plane level for the test images is 50.00364 and shows that the encrypted images are highly randomised. Therefore, the proposed image Mathematics 2023, 11, 1769 21 of 23 encryption is cryptographically efficient and can withstand statistical and chosen plaintext attacks. Furthermore, the presented work can restore useful images from captured versions of images under various environmental conditions. The suggested methodology is the best for analysing an image across a wireless medium and is sufficiently robust to interference. 6. Conclusions Cloud storage is trendy and inevitable in many applications. However, data stored in the cloud are always under threat due to their multitenancy. So, it is essential to construct a security solution to ensure the security of cloud-hosted data. The proposed Hopfield attractor-based permutation blended DNA diffusion provides tightened security for grey images hosted in public cloud storage during when at rest, in transit and used by other applications. The proposed security framework exhibits greater potency to defend against various attacks. This proposed work uses a Hopfield attractor and chaotic maps, resulting in the keyspace of 10170 . The key generated for the confusion process is adaptive and image specific; hence, attackers cannot find the key using a chosen plaintext attack and a known plaintext attack. The proposed security algorithm yielded an average entropy value of 7.9973 and an average correlation value of 0.0008; hence, attackers cannot find the plain image using a statistical attack. This framework can be enhanced in future by using a reconfigurable hardware platform. Author Contributions: Conceptualisation, H.M., N.C. and R.A.; methodology, C.L., N.C. and P.V.M.; software, C.L., N.C. and P.V.M.; validation, P.V.M., K.M.M. and K.T.; formal analysis, K.M.M. and P.V.M.; investigation, N.C., P.V.M. and K.M.M.; resources, P.V.M.; data curation, N.C., P.V.M. and K.T.; writing—original draft preparation, H.M., K.T. and R.A.; writing—review and editing, H.M., K.M.M. and R.A.; visualisation, P.V.M.; supervision, R.A. and K.T.; project administration, H.M., K.T. and R.A.; funding acquisition, HM and R.A. All authors have read and agreed to the published version of the manuscript. Funding: Institutional Fund Projects under grant no. IFPIP: 965-144-1443. Ministry of Education and King Abdulaziz University, DSR, Jeddah, Saudi Arabia. Data Availability Statement: Not applicable. Acknowledgments: The authors gratefully acknowledge the technical and financial support provided by the Ministry of Education and King Abdulaziz University, DSR, Jeddah, Saudi Arabia. Conflicts of Interest: The authors declare no conflict of interest. References 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. Singh, A.; Chatterjee, K. Cloud security issues and challenges: A survey. J. Netw. Comput. Appl. 2017, 79, 88–115. [CrossRef] Yang, R.; Xu, Q.; Au, M.H.; Yu, Z.; Wang, H.; Zhou, L. Position based cryptography with location privacy: A step for Fog Computing. Future Gener. Comput. Syst. 2018, 78, 799–806. [CrossRef] Shahzadi, S.; Iqbal, M.; Dagiuklas, T.; Qayyum, Z.U. Multi-access edge computing: Open issues, challenges and future perspectives. J. Cloud Comput. 2017, 6, 30. [CrossRef] Huh, J.H.; Seo, Y.S. Understanding edge computing: Engineering evolution with artificial intelligence. IEEE Access 2019, 7, 164229–164245. [CrossRef] Eom, S.; Huh, J.H. The opening capability for security against privacy infringements in the smart grid environment. Mathematics 2018, 6, 202. [CrossRef] Tao, M.; Ota, K.; Dong, M. Ontology-based data semantic management and application in IoT- and cloud-enabled smart homes. Future Gener. Comput. Syst. 2017, 76, 528–539. [CrossRef] Asadi, S.; Nilashi, M.; Husin, A.R.C.; Yadegaridehkordi, E. Customers perspectives on adoption of cloud computing in banking sector. Inf. Technol. Manag. 2017, 18, 305–330. [CrossRef] Singh, S.; Jeong, Y.S.; Park, J.H. A survey on cloud computing security: Issues, threats, and solutions. J. Netw. Comput. Appl. 2016, 75, 200–222. [CrossRef] Kumari, M.; Gupta, S.; Sardana, P. A Survey of Image Encryption Algorithms. 3D Res. 2017, 8, 37. [CrossRef] Wang, B.; Xie, Y.; Zhou, C.; Zhou, S.; Zheng, X. Evaluating the permutation and diffusion operations used in image encryption based on chaotic maps. Optik 2016, 127, 3541–3545. [CrossRef] Alsaedi, M. Colored image encryption and decryption using multi-chaos 2D quadratic strange attractors and matrix transformations. Multimed. Tools Appl. 2017, 76, 24527–24547. [CrossRef] Mathematics 2023, 11, 1769 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 22 of 23 Hua, Z.; Zhou, Y.; Pun, C.M.; Chen, C.L.P. 2D Sine Logistic modulation map for image encryption. Inf. Sci. 2015, 297, 80–94. [CrossRef] Diaconu, A.V. Circular inter-intra pixels bit-level permutation and chaos-based image encryption. Inf. Sci. 2016, 355–356, 314–327. [CrossRef] Ponuma, R.; Amutha, R. Compressive sensing based image compression-encryption using novel 1D-chaotic map. Multimed. Tools Appl. 2018, 77, 19209–19234. [CrossRef] Abbas, N.A. Image encryption based on Independent Component Analysis and Arnold’s Cat Map. Egypt. Inform. J. 2016, 17, 139–146. [CrossRef] Wang, X.; Liu, L.; Zhang, Y. A novel chaotic block image encryption algorithm based on dynamic random growth technique. Opt. Lasers Eng. 2015, 66, 10–18. [CrossRef] Belazi, A.; Abd El-Latif, A.A.; Belghith, S. A novel image encryption scheme based on substitution-permutation network and chaos. Signal Process. 2016, 128, 155–170. [CrossRef] Huang, X.; Ye, G. An image encryption algorithm based on irregular wave representation. Multimed. Tools Appl. 2018, 77, 2611–2628. [CrossRef] Broumandnia, A. Designing digital image encryption using 2D and 3D reversible modular chaotic maps. J. Inf. Secur. Appl. 2019, 47, 188–198. [CrossRef] Duan, C.F.; Zhou, J.; Gong, L.H.; Wu, J.Y.; Zhou, N.R. New color image encryption scheme based on multi-parameter fractional discrete Tchebyshev moments and nonlinear fractal permutation method. Opt. Lasers Eng. 2022, 150, 106881. [CrossRef] Zhang, Q.; Liu, L.; Wei, X. Improved algorithm for image encryption based on DNA encoding and multi-chaotic maps. AEU Int. J. Electron. Commun. 2014, 68, 186–192. [CrossRef] Wang, X.Y.; Zhang, Y.Q.; Bao, X.M. A novel chaotic image encryption scheme using DNA sequence operations. Opt. Lasers Eng. 2015, 73, 53–61. [CrossRef] Hu, T.; Liu, Y.; Gong, L.H.; Guo, S.F.; Yuan, H.M. Chaotic image cryptosystem using DNA deletion and DNA insertion. Signal Process. 2017, 134, 234–243. [CrossRef] Chai, X.; Chen, Y.; Broyde, L. A novel chaos-based image encryption algorithm using DNA sequence operations. Opt. Lasers Eng. 2017, 88, 197–213. [CrossRef] Enayatifar, R.; Abdullah, A.H.; Isnin, I.F.; Altameem, A.; Lee, M. Image encryption using a synchronous permutation-diffusion technique. Opt. Lasers Eng. 2017, 90, 146–154. [CrossRef] Wang, S.; Peng, Q.; Du, B. Chaotic color image encryption based on 4D chaotic maps and DNA sequence. Opt. Laser Technol. 2022, 148, 107753. [CrossRef] Alarood, A.A.; Alsolami, E.; Al-Khasawneh, M.A.; Ababneh, N.; Elmedany, W. IES: Hyper-chaotic plain image encryption scheme using improved shuffled confusion-diffusion. Ain Shams Eng. J. 2022, 13, 101583. [CrossRef] Zhou, W.; Wang, X.; Wang, M.; Li, D. A new combination chaotic system and its application in a new Bit-level image encryption scheme. Opt. Lasers Eng. 2022, 149, 106782. [CrossRef] Pavithran, P.; Mathew, S.; Namasudra, S.; Srivastava, G. A novel cryptosystem based on DNA cryptography, hyperchaotic systems and a randomly generated Moore machine for cyber physical systems. Comput. Commun. 2022, 188, 1–12. [CrossRef] Yousif, S.F.; Abboud, A.J.; Alhumaima, R.S. A new image encryption based on bit replacing, chaos and DNA coding techniques. Multimed. Tools Appl. 2022, 81, 27453–27493. [CrossRef] Qin, Z.; Weng, J.; Cui, Y.; Ren, K. Privacy-Preserving Image Processing in the Cloud. IEEE Cloud Comput. 2018, 5, 48–57. [CrossRef] Chidambaram, N.; Raj, P.; Thenmozhi, K.; Rajagopalan, S.; Amirtharajan, R. A cloud compatible DNA coded security solution for multimedia file sharing & storage. Multimed. Tools Appl. 2019, 78, 33837–33863. Zhang, Y.; He, Q.; Xiang, Y.; Zhang, L.Y.; Liu, B.; Chen, J.; Xie, Y. Low-Cost and Confidentiality-Preserving Data Acquisition for Internet of Multimedia Things. IEEE Internet Things J. 2018, 5, 3442–3451. [CrossRef] Bigdeli, N.; Farid, Y.; Afshar, K. A robust hybrid method for image encryption based on Hopfield neural network. Comput. Electr. Eng. 2012, 38, 356–369. [CrossRef] Lakshmi, C.; Thenmozhi, K.; Rayappan, J.B.B.; Amirtharajan, R. Hopfield attractor-trusted neural network: An attack-resistant image encryption. Neural Comput. Appl. 2020, 32, 11477–11489. [CrossRef] Lakshmi, C.; Thenmozhi, K.; Venkatesan, C.; Seshadhri, A.; Rayappan, J.B.B.; Amirtharajan, R. Mutated cleavages of images for stealth disclosure: A hopfield neural network attractor (HNNA) approach. Neural Process. Lett. 2021, 53, 907–928. [CrossRef] Lakshmi, C.; Thenmozhi, K.; Rayappan, J.B.B.; Rajagopalan, S.; Amirtharajan, R.; Chidambaram, N. Neural-assisted imagedependent encryption scheme for medical image cloud storage. Neural Comput. Appl. 2021, 33, 6671–6684. [CrossRef] Dhall, S.; Pal, S.K.; Sharma, K. A chaos-based probabilistic block cipher for image encryption. J. King Saud Univ. Comput. Inf. Sci. 2022, 34, 1533–1543. [CrossRef] Patel, S.; Thanikaiselvan, V.; Pelusi, D.; Nagaraj, B.; Arunkumar, R.; Amirtharajan, R. Colour image encryption based on customised neural network and DNA encoding. Neural Comput. 2021, 33, 14533–14550. [CrossRef] Jiang, Z.; Liu, X. Image Encryption Algorithm Based on Discrete Quantum Baker Map and Chen Hyperchaotic System. Int. J. Theor. Phys. 2023, 62, 22. [CrossRef] Wang, W.T.; Sun, J.Y.; Zhang, H.; Zhang, J. Quantum cryptosystem and circuit design for color image based on novel 3D Julia-fractal chaos system. Quantum Inf. Process. 2023, 22, 64. [CrossRef] Mathematics 2023, 11, 1769 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 23 of 23 Wang, H.K.; Xu, G.B.; Jiang, D.H. Quantum grayscale image encryption and secret sharing schemes based on Rubik’s Cube. Physica A Stat. Mech. Its Appl. 2023, 612, 128482. [CrossRef] Hao, W.; Zhang, T.; Chen, X.; Zhou, X. A hybrid NEQR image encryption cryptosystem using two-dimensional quantum walks and quantum coding. Signal Process. 2023, 205, 108890. [CrossRef] Mahalingam, H.; Veeramalai, T.; Menon, A.R.; S., S.; Amirtharajan, R. Dual-Domain Image Encryption in Unsecure Medium—A Secure Communication Perspective. Mathematics 2023, 11, 457. [CrossRef] Zhu, S.; Deng, X.; Zhang, W.; Zhu, C. Image Encryption Scheme Based on Newly Designed Chaotic Map and Parallel DNA Coding. Mathematics 2023, 11, 231. [CrossRef] Song, X.; Chen, G.; Abd El-Latif, A.A. Quantum Color Image Encryption Scheme Based on Geometric Transformation and Intensity Channel Diffusion. Mathematics 2022, 10, 3038. [CrossRef] Zhong, H.; Li, G.; Xu, X.; Song, X. Image Encryption Algorithm Based on a Novel Wide-Range Discrete Hyperchaotic Map. Mathematics 2022, 10, 2583. [CrossRef] Mansoor, S.; Sarosh, P.; Parah, S.A.; Ullah, H.; Hijji, M.; Muhammad, K. Adaptive Color Image Encryption Scheme Based on Multiple Distinct Chaotic Maps and DNA Computing. Mathematics 2022, 10, 2004. [CrossRef] Mfungo, D.E.; Fu, X.; Wang, X.; Xian, Y. Enhancing Image Encryption with the Kronecker xor Product, the Hill Cipher, and the Sigmoid Logistic Map. Appl. Sci. 2023, 13, 4034. [CrossRef] Chen, C.; Zhu, D.; Wang, X.; Zeng, L. One-Dimensional Quadratic Chaotic System and Splicing Model for Image Encryption. Electronics 2023, 12, 1325. [CrossRef] Chen, X.; Wang, Q.; Fan, L.; Yu, S. A Novel Chaotic Image Encryption Scheme Armed with Global Dynamic Selection. Entropy 2023, 25, 476. [CrossRef] [PubMed] Chang, H.; Wang, E.; Liu, J. Research on Image Encryption Based on Fractional Seed Chaos Generator and Fractal Theory. Fractal Fract. 2023, 7, 221. [CrossRef] Zhao, J.; Wang, S.; Zhang, L. Block Image Encryption Algorithm Based on Novel Chaos and DNA Encoding. Information 2023, 14, 150. [CrossRef] Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.