6.1. Encryption and Decryption Program
Traditional chaos-based encryption regimes generally use fixed parameters, and the analysis and deciphering of system tracks make the algorithms less secure. Therefore, a dynamic parameter encryption scheme is proposed based on the framework system of diffusion, disruption and DNA encryption algorithms by taking advantage of the parameter tunability of five-dimensional tri-valued memristor chaotic systems. The process is described below:
Step 1: Determining the key. The three color components of the plaintext color image
are transformed into one-dimensional vectors
,
and
. The pixel averages of their components are found separately and combined as the key and as the initial value of the chaotic system, as shown in Equations (32) and (33) below.
Step 2: Chunking. chunking operation is performed on the color image of size , which is uniformly divided into images of size . The chunked images are transformed into one-dimensional vectors, denoted as , , and , respectively.
Step 3: Diagonal block encryption methods and .
- 1.
Generate a chaotic pseudo-random sequence
of length
using chaotic system, discard the first 1500 points of the transition state and perform additive modulo left-shift diffusion operation on a component of the image
obtained from the chunking. Convert the component into a gray-scale image with eight bits for each pixel point. The lower three bits of any data range from zero to seven as the effective range of cyclic shifting of a pixel point’s data, then the plaintext after the cyclic left shift of the data and the chaotic sequence are added and each byte is summed and modeled to obtain the encrypted sequence
. The computation is shown in Equation (34).
where
is a ciphertext sequence,
is a chaotic sequence,
is a plaintext vector and
is a cyclic left shift to the lowest three bits of the data.
- 2.
From the dynamical behavior of the new system, it can be seen that the complexity of the system is higher when parameter . Take this time to generate a pseudo-random sequence of length . Perform a modulo left-shift diffusion operation on the component of image obtained from the chunking to obtain the encrypted sequence .
- 3.
When parameter , the complexity of the system is the highest. Take this time to produce a pseudo-random sequence of length . The repeated pseudo-random numbers in are eliminated and only the first occurrence of the value is retained, and then the elements in the set that do not appear in are ranked from smallest to largest. Then, is swapped with to change the position and component of image obtained from the chunking is dislocated without repetition to obtain the encrypted sequence .
Similarly, the , and of the chunked are encrypted in the same way as .
Step 4: Diagonal block encryption methods and .
- 1.
Keeping the system parameters unchanged and making the system parameters , the components and of are encrypted without repetitive disruption, respectively, in the same way as in Step 3 of 3.
- 2.
Let parameter , generate a pseudo-random sequence and perform a modulo left-shift diffusion operation on the component of , encrypted in the same way as in Step 3 of 1.
Similarly, the , and of the chunked are encrypted in the same way as .
Step 5: Combining the images. The sub-blocks that have been diffused and encrypted are recombined to obtain image .
Step 6: DNA encryption.
- 1.
Separate the components , and of image .
- 2.
Keeping the parameters unchanged, sequences
,
,
,
and
of length
are generated and sequence
is transformed into a two-dimensional matrix
, which is used for DNA operations with component
of image
.
- 3.
Sequence
determines the encoding mode of the DNA of each component
of image
, and sequence
determines the DNA encoding mode of matrix
. There are a total of eight modes of DNA encoding and decoding, which need to be transformed into
and
. After the transformation, the value of each sequence is a random integer from one to eight, and the transformation equation is shown in Equation (36):
- 4.
The decoding of DNA is determined by sequence
. DNA decoding is the inverse process of DNA coding, and there are eight ways of decoding, i.e., decoding
,
,
and
into specific binary values.
- 5.
There are three algorithms for defining DNA, and the DNA algorithm is determined by the system-generated sequence
. If
, additive, if
, subtractive and if
, different-or. Sequence
is transformed according to Equation (38) into integers ranging from zero to three.
Similarly, make and repeat Step 6 for DNA encryption of component ; make and repeat Step 6 for DNA encryption of component .
Step 7: Combining the three 2D matrices encrypted by DNA into a 3D matrix to obtain the encrypted image.
The encryption flowchart is shown in
Figure 17.
The encryption algorithms used are all reversible, so the decryption process is the inverse of the encryption process. The encrypted image is subjected to DNA encoding, DNA inverse operation, DNA decoding, inverse scrambling and inverse diffusion in order to obtain the decrypted image. The decrypted image can be obtained. The specific decryption steps are as follows:
Step 1: Determining the key. Same as the first step of the encryption process.
Step 2: DNA decoding. The reverse process of DNA coding is known as DNA decoding.
- 1.
Separate the components , and of ciphertext image .
- 2.
Keeping the parameters unchanged, sequences
,
,
,
and
of length
are generated, and sequence
is transformed into a two-dimensional matrix
, which is used for DNA operations with component
of image
.
- 3.
Sequence
determines the decoding method of DNA for each component
of image
, and sequence
determines the decoding method of DNA for matrix
. There are eight ways to encode and decode DNA, which need to transform
and
. The value of each sequence after transformation is a random integer from one to eight, and transformation Equation (40) is as follows:
- 4.
Sequence
determines how the DNA is encoded, and there are eight ways to decode it, i.e.,
,
,
and
are encoded into specific binary values.
- 5.
There are three algorithms for defining DNA, and the DNA algorithm is determined by the system-generated sequence
. If
, subtraction is used; if
, addition is used; and if
, inverse heteroscedasticity is used. Sequence
is transformed into an integer in the range zero to three by the transformation of Equation (42).
Similarly, let , repeat Step 6 for DNA decryption of component ; let , repeat Step 6 for DNA decryption of component .
Step 3: Combining the 2D vectors of the three-component RGB after performing DNA decryption to obtain color cipher image .
Step 4: Chunking. The chunking operation is performed on the color ciphertext image of size , which is uniformly divided into images of size . The chunked image is converted into one-dimensional vectors, denoted as , , and , respectively.
Step 5: Diagonal block decryption method and .
- 1.
Using the chaotic system to generate a chaotic pseudo-random sequence
of length
, discard the first 1500 points of the transition state, carry out the reverse additive modulo left-shift diffusion operation on a certain component of the ciphertext image
obtained from the chunking and transform the component into a gray-scale image with eight bits for each pixel point. The low three bits of any piece of data are taken as the value range of 0~7 as the effective range of cyclic shifting of a pixel point’s data, and then after the cyclic right shift the plaintext data and the chaotic sequence for the addition operation, each byte is added and modulo to obtain the decrypted sequence
. Equation (43) is as follows:
where
is a ciphertext sequence,
is a chaotic sequence,
is a plaintext vector and
is a cyclic right shift of the lowest three bits of the data.
- 2.
From the dynamical behavior of the new system, it can be seen that the complexity of the system is higher when parameter . Taking this time, a pseudo-random sequence of length is generated and an inverse modulo left-shift diffusion operation is performed on the component of image obtained from the chunking to obtain decrypted sequence .
- 3.
When parameter , the complexity of the system is the highest. Take this time to produce a pseudo-random sequence of length . The repeated pseudo-random numbers in are eliminated and only the first occurrence of the value is retained, and then the elements in the set that do not appear in are ranked from smallest to largest. Then, and are swapped for the position of components of image obtained from the chunking to perform a repetition-free disarray and to obtain the decrypted sequence .
Similarly, the , and of the chunked are decrypted in the same way as image .
Step 6: Decrypting the diagonal blocks way and .
- 1.
Keeping the system parameters unchanged and letting system parameters , the inverse non-repetitive disambiguation operation is performed on component and component of , respectively, decrypted in the same way as in the third step (3).
Let parameter , generate a pseudo-random sequence and perform a reverse modulo left-shift diffusion operation on component of . The decryption in the same way as in Step 5 of 3.
Step 7: Combining the images. The sub-blocks that have been diffused and decrypted are recombined to obtain original image .
Using the above proposed variable parameter encryption and decryption scheme, the encryption and decryption operations are carried out on RGB color Lena, Baboon and Peppers images of size
pixels using MATLAB 2018a, and the encryption results are shown in
Figure 18. It is difficult to see the information of the original image from the encrypted images, and the decrypted images do not differ much from the original images, which proves that the encryption and decryption algorithm is feasible.
6.3. Analysis of Application Scenarios
For the current more complex encryption environment, the encryption performance, key management and encryption quality and other requirements are higher, such as military, medical, financial and other fields, which often need to use very strong encryption algorithms. The dynamic encryption algorithm can resist statistical attacks, differential attacks, noise attacks and shear attacks, the ciphertext information of the neighboring pixel points are more uniformly distributed, from which the original plaintext information can not be observed. The image quality is higher and the key space is larger, which can well ensure the confidentiality, integrity and availability of information. Therefore, it can be applied to military, medical, financial and other fields.
Encryption of medical data in healthcare organizations to protect patient privacy and data confidentiality from unauthorized access and leakage, where medical images, medical records, prescriptions, etc., can be stored or transmitted, can be encrypted using this encryption technology. In military institutions where the security of sensitive data such as operational plans, intelligence information, map data, etc., needs to be protected, the encryption scheme can be used by military command, control and intelligence departments to protect the confidentiality of sensitive information against eavesdropping and theft by hostile forces. The encryption technology can help financial institutions protect the confidentiality of large amounts of sensitive customer information and financial data, including personal identification information, account balances, transaction records, etc., against data leakage and illegal access.