An Encryption Algorithm for Region of Interest in Medical DICOM Based on One-Dimensional eλ-cos-cot Map

Today, with the rapid development of the Internet, improving image security becomes more and more important. To improve image encryption efficiency, a novel region of interest (ROI) encryption algorithm based on a chaotic system was proposed. First, a new 1D eλ-cos-cot (1D-ECC) with better chaotic performance than the traditional chaotic system is proposed. Second, the chaotic system is used to generate a plaintext-relate keystream based on the label information of a medical image DICOM (Digital Imaging and Communications in Medicine) file, the medical image is segmented using an adaptive threshold, and the segmented region of interest is encrypted. The encryption process is divided into two stages: scrambling and diffusion. In the scrambling stage, helical scanning and index scrambling are combined to scramble. In the diffusion stage, two-dimensional bi-directional diffusion is adopted, that is, the image is bi-directionally diffused row by column to make image security better. The algorithm offers good encryption speed and security performance, according to simulation results and security analysis.


Introduction
With the rapid development of information and Internet technologies, a large amount of information needs to be transmitted over the Internet, so information security has received wide attention. Digital images, as an important data content for multimedia transmission, contain a large amount of private visual information, and their secure transmission in public channels and trusted storage in cloud environments are difficult to fully guarantee [1]. For some special fields, such as military, business, and medicine, digital images have stricter requirements for their confidentiality. As a special type of image, medical images are different from ordinary digital images, carrying important information closely related to patients' lives and having strong sensitivity and privacy. The leakage and destruction of medical images during transmission in today's more advanced telemedicine may cause significant damage and harm to medical institutions and individual patients, and may even constitute a threat to health and life. To facilitate the sharing and remote processing of medical images in a more secure way, many people have tried different methods, the most common ones include image encryption [2][3][4], data hiding [5,6], and image watermarking [7,8]. Among these methods, image encryption is considered to be one of the most important methods for securing image data [9].
Medical images cannot match the requirements of real-time transmission of current information because they contain a lot of data, have a slow encryption speed, and take a long time to encrypt. As a result, traditional encryption algorithms such as AES and DES [10][11][12] are no longer suited for the encryption of medical images. Many researchers have discovered that chaotic systems are characterized by ergodicity, unpredictability, and sensitivity to beginning values, which makes chaos well suited for picture encryption [13][14][15]. Low-dimensional chaotic systems and high-dimensional chaotic systems are the most common classifications for chaotic systems. Refs. [16,17] proposed a method of making a simple and effective chaotic system by using the difference of the output sequences of two identical existing one-dimension (1D) chaotic maps. Simulations and performance evaluations showed that the proposed system is able to produce a one-dimension (1D) chaotic system with better chaotic performances and larger chaotic ranges compared with the previous chaotic maps. Ref. [18] proposed a new chaotic system that utilizes two existing one-dimensional chaotic map levels combined into one, and although its complexity and sensitivity are improved compared to the original one-dimensional map, the size of the parameter space is still finite. Ref. [19] proposed a new two-dimensional sine improved logistic iterative chaotic map with infinite collapse (ICMIC) modulation map (2D-SLIM) based on the improved two-dimensional closed-loop modulation coupling model. The performance analysis results show that it has a large parameter space, large Lyapunov exponents, and high complexity. Ref. [20] proposed a sixth-order cellular neural network (CNN) hyperchaotic system, in addition, an octal number communication system based on this hyperchaotic system was given. This communication system has the features of large capacity of signal transmission, high security, and good expansibility. The original information signal can be covered and recovered effectively in this octal number communication system. Ref. [21] proposed a semi-symmetric image encryption scheme based on function projective synchronization between two hyperchaotic systems, and it has several advantages such as great speed and relatively low complexity compared respectively to symmetric and asymmetric algorithms. In particular, the key is generated simultaneously and independently in encryption and decryption sides, which effectively avoids the key transmission and threats of key exposure. Moreover, the sixth-order CNN is not only regarded as the drive system for key synchronization, but is also used for diffusing key generation to enhance the security and sensitivity of the scheme.
By comparing various encryption algorithms, Ref. [17] uses an improved chaotic system based on a one-dimensional chaotic system, which is a low-dimensional system with few control parameters, high real-time performance, and low computational cost, but the chaotic behavior with small key space needs to be improved. In Ref. [18], lowdimensional chaos is also used and has the same characteristics. In Refs. [12,[19][20][21], highdimensional chaos is used to compensate for the problems of low-dimensional chaotic key space and chaotic behavior. However, due to its complex structure and multiple parameters, it increases the difficulty and computational complexity of its hardware and software implementation, and its real-time performance is poor and time consumption is large. Therefore, it is necessary to use a chaotic system with few control parameters and complex chaotic behavior. In this paper, we propose a new chaotic system for a medical image encryption algorithm to address the above problems. The system consists of a one-dimensional chaotic map with one control parameter, and the bifurcation diagram, Lyapunov exponent, 0-1 test, and sample entropy analysis are performed to verify the good performance of the chaotic system. To compensate for the problem of small key space due to few control parameters, a key generation model is proposed, which not only keeps the advantages of simple and fast implementation of the original one-dimensional chaotic system, but also solves the shortcoming of insufficient key space of the one-dimensional chaotic system.
To boost encryption effectiveness, in addition to using chaotic systems with high realtime performance, the problem should be solved from the image itself, such as compressing and encrypting the image [22][23][24]. Unfortunately, most compression algorithms lead to lossy image decryption, and any degradation of image quality may lead to misdiagnosis, so most methods of image compression are not suitable for medical images. Image encryption algorithms are currently classified into two types: full image encryption, which encrypts the entire image, and selective image encryption, which encrypts only a portion of the image. Selective image encryption has been popular in recent years as a way to reduce image encryption and decryption processing time while maintaining a high level of security, and has received the attention of many scientists and engineers with several encryption schemes proposed [25][26][27]. For medical images, only part of an image is meaningful and the other parts are pure black regions, which can be divided into two parts, private and non-private regions, where the private region is also called the region of interest (ROI) and the non-private region is also called the region of background (ROB) [28]. The method for selecting the region of interest is just as crucial as the encryption algorithm in the region of interest encryption technique. ROI encryption techniques can be classified into two groups based on the privacy region selection method: manually selected encryption and automatically selected encryption. The manual selection of the ROI encryption approach entails the user determining a certain privacy zone and then encrypting that region [29,30]. This method is time-consuming and inaccurate. As a result, a plethora of automated selection schemes have been presented. A pixel-based scanning method is proposed in the literature [31] from the left and right sides to the center and a threshold value is used to determine the contour of the ROI. An algorithm for ROI determination of raw medical images based on block energy was proposed in the literature [32]. Refs. [33,34] set the size of ROI to a rectangle in medical images and then encrypts it, however, due to the shape and size of ROI, this solution is limited and cannot adequately secure personal information. Ref. [35] suggested a medical image encryption technique that is fully selective and chaotic. The approach is divided into rounds, and in the diffusion phase of each round, a pseudorandom matrix of the same size as the input image is used to improve the scheme's speed while retaining good security. Ref. [36] proposed a game theory-based ROI optimized nondestructive medical image encryption and decryption scheme. The ROI parameters are optimized using a bargaining game. This allows accurate and adaptive determination of the region of interest, adapting to a wide range of medical image types and encryption requirements. However, this requires us to test all the pixel thresholds and finally select the most suitable segmentation threshold from all the results. To address the above, we design an efficient and secure image encryption algorithm using medical image characteristics. We combine image segmentation with image encryption by first segmenting the image adaptively, segmenting the ROI according to the obtained target segmentation threshold, and encrypting only the ROI, which reduces the processing delay and resource overhead. Contribution: 1.
The 1D-e λ -cos-cot (1D-ECC) chaotic map is proposed and the performance of the map is tested and analyzed, which has a wider range of control parameters. When compared to a traditional 1D chaotic system, this system has better real-time performance and chaotic behavior.

2.
A key generation model based on DICOM (Digital Imaging and Communications in Medicine) file information is proposed, and the initial values and control parameters of the 1D e λ -cos-cot map (1D-ECC) chaotic map are generated using this model to further generate the keystream and expand the key space.

3.
A new 1D e λ -cos-cot map (1D-ECC) medical image region of the interest-based encryption algorithm is proposed, and the simulation and security evaluation results show that the algorithm has high security and can resist common attacks.
The rest of this paper is organized as follows. The 1D e λ -cos-cot (1D ECC) chaotic map will be introduced in Section 2 and its performance will be evaluated using a bifurcation diagram, Lyapunov exponent, 0-1 test, and sample entropy test. Section 3 will introduce the key generation model based on the DICOM file with a 1D-ECC chaotic map. Section 4 will cover the implementation of the entire encryption algorithm. Simulation results will be given in Section 5, and then the security performance of the 1D-ECC chaotic map based encryption algorithm will be further analyzed. Finally, the conclusion will be given in Section 7.

1D-e λ -cos-cot Map
In this section, we propose a new one-dimensional chaotic map to solve the problem of insufficient chaotic behavior of traditional one-dimensional chaotic maps and analyze its chaotic behavior.

Logistic Chaotic Map and Sine Map
The logistic map and sine map are simple, nonlinear dynamical systems with complex chaotic behavior. They can be represented by the equation below [37]: where r is the control parameter in the range of r ∈ (0, 4) and x n is the output chaotic sequence, whose initial value can be expressed by x n=0 . µ is the control parameter in the range µ ∈ [0, 1] and x n is the output chaotic sequence, whose initial value can be initialized by x n=0 . Both the logistic map and sine map suffer from two security problems: first, they have a small effective range of control parameters, as shown in Figure 1a,b: only r ∈ [3.57, 4] and µ ∈ [0.8722, 1] show chaotic behavior, which leads to a small range of key values for cryptosystems that use the system as a random number generator. Further verification can be obtained from the Lyapunov exponential spectrum in Figure 2a,b. Secondly, the output chaotic sequences are unevenly distributed, with insufficient randomness and periodic problems, which will lead to security risks in the corresponding cryptosystems.

1D-e λ -cos-cot Map
The proposed new chaotic map is shown in Equation (3).
x n+1 = cos e λ cot(2πx n + 1) mod 1 where λ is the control parameter λ ∈ [0, +∞], n is the number of iterations, x n is the output chaotic sequence, x n ∈ [0, 1], x n+1 is the next state of the chaotic sequence, and mod() is the modulation function. In the next section, we will prove that the chaotic map has good chaotic performance when λ ∈ [0, +∞].

Performance Analysis
In this section, we carry out some performance analysis tests on the proposed new one-dimensional chaotic map, including the bifurcation diagram, Lyapunov exponent, 0-1 test, and sample entropy test, and compare the chaotic behavior with the traditional one-dimensional chaotic map.

Bifurcation Diagram
As the parameters of a dynamical system change, the bifurcation event occurs. A chaotic system's bifurcation diagram can be used to describe the resulting chaotic sequence and hence study the chaotic behavior of the system. Logistic map and sine map bifurcation diagrams are shown in Figure 1a,b. For the logistic map, a periodic window appears when r = 3.5699456, and the system enters a chaotic state when r = 3.57. For the sine chaos map, the system enters the chaotic state when µ = 0.8722. It can be seen that these two chaotic maps exhibit chaotic performance only for a very small time interval. Moreover, the logistic chaos map and the sine chaos map are complete maps for the interval [0, 1] only when r = 4 and µ = 1. On the contrary, the 1D-ECC map exhibits better chaotic properties. Figure 1c shows the chaotic behavior for λ ∈ [0, 4]. From the comparison results we can observe that the 1D-ECC chaotic map has a greater range of the parameter; in comparison to the logistic and sine chaotic maps, the 1D-ECC chaotic map has a higher random-like performance; and unlike the logistic and sine maps, the 1D-ECC chaotic map has no period window. In addition, to better compare the effects of our proposed map, we also plot the bifurcation diagram for a larger range of control parameters, as shown in Figure 1d, and it can be seen that the 1D-ECC chaos map still has good chaotic properties when the control parameter λ ∈ [0, 100].

Lyapunov Exponent
In a dynamical system, the Lyapunov exponent can be used to measure the rate of separation between infinitely close trajectories. When the Lyapunov exponent is positive, the dynamical system can be considered to have chaotic behavior, and the larger the Lyapunov exponent the higher the chaotic complexity of the mixed system. We plot the Lyapunov exponents of three chaotic maps, and the Lyapunov exponent formula for a one-dimensional chaotic system is as follows [38]: As shown in Figure 2a, the Lyapunov exponents of the logistic map are less than zero when the parameter r < 3.57 and, as shown in Figure 2b, the Lyapunov exponents of sine map are less than zero when the parameter µ < 0.8722, which means they have no chaotic behavior. Meanwhile, in our proposed 1D-ECC map, as shown in Figure 2c, the Lyapunov exponents of the 1D-ECC map are all greater than zero when λ ≥ 0, and the Lyapunov exponents increase gradually with the increase in the range of control parameters, as shown in Figure 2d; when λ = 100, the Liapunov exponent exceeds 100. Compared with the logistic map and sine map, 1D-ECC has a greater parameter range and a higher Lyapunov exponent; it can be called a good chaotic map.

0-1 Test
The 0-1 test can be used to assess chaotic systems' performance. The test uses chaotic systems to produce sequences for numerous rounds, and the test's outcome, K, is either 0 or 1. For a real constant r ∈ (0, π), a number of iterations, n, and a chaotic sequence x(i) i=1,2,3,. . . ,n ,K is calculated as follows [39]: Here and The system is chaotic when K ≈ 1. In this paper, n = 200, r ∈ [ π 5 , 4π 5 ] is chosen to calculate the value of K for two different chaotic maps. The associated outcomes are given in Figure 3a which shows the results of a logistic map test, the value of K is close to 1 only when the parameter is larger than 3.6 and is unstable. For the sine map, as shown in Figure 3b, the K value is close to 1 only when its parameter is close to 1. In the test results of the 1D-ECC map shown in Figure 3c, the K value is always close to 1 when the parameter λ ∈ [0, 100]. In Figure 3d, the K value is very close to 1 for λ ∈ [0, 100], which indicates that the 1D-ECC map has better mixing performance than the existing logistic and sine map have better chaotic performance, so we can apply them to the generation of chaotic sequences.

Sample Entropy
Sample entropy is a type of entropy used to assess the complexity of a time series [40][41][42]. In the field of chaos, the sample entropy is usually used to assess the complexity of the output signal of a dynamic system. When the SE is large, it indicates that the signal is less regular, and the chaotic system has more complex behavior. For the logistic map, when r > 3.57, the sample entropy value starts to increase, and when r = 4, the sample entropy value is about 0.8, as shown in Figure 4a. For the sine map, the sample entropy value starts to increase when µ > 0.872, and when r = 1, the sample entropy value is about 0.8, as shown in Figure 4b. While our proposed 1D-ECC map, the sample entropy value reaches about 1.8 at λ = 0 and increases with the increase in the control parameter λ, as shown in Figure 4c. In addition, we plotted the sample entropy for a larger range of control parameters, and the sample entropy value remains around 2 when λ = 100, as shown in Figure 4d. It can be seen that the 1D-ECC map achieves positive sample entropy values for all control parameters and has larger sample entropy values than the logistic and sine map, indicating that the 1D-ECC map has better chaotic performance.

DICOM File-Based Key Generation Model with 1D-ECC Chaotic Map
In this section, the DICOM standard is introduced and 1D-ECC is applied to generate encryption keys based on DICOM data information.

Introduction of DICOM
The DICOM (Digital Imaging and Communications in Medicine) standard is a standard for the communication and administration of medical imaging information and related data [43]. The overall structure of a DICOM file is shown in Figure 5. Each DICOM file must include a header, and the DICOM file header contains relevant information that identifies the data set. The main feature of DICOM format medical image files is that they contain not only basic information such as image size, width, height, and number of bits per pixel, but also a lot of medical information in the data elements of the data set, such as hospital name, test type, basic patient information, doctor information, etc.
The main component of a DICOM file is the data set, which consists of data elements arranged in a prescribed order, the most basic unit being the data element. For DICOM files, which are usually transferred explicitly, the data elements are arranged in the order of the tags from smallest to largest. It consists of four main parts: (1) DICOM Tag: the identification of the information stored.
(2) VR (value representation): store the data type describing the information.
(3) Value length: store the length of the data describing the information. (4) Value: store the data value describing the information.
DICOM Tags are classified into four groups: (a) Patient, (b) Study, (c) Series, and (d) Image's Name. Figure 6 shows some of the data element information in the DICOM image. As shown in Figure 6, each DICOM Tag is identified by the combination of two hexadecimal numbers, Group and Element. For example, the tag (0010, 0010) represents the Patient's Name, which stores the Patient Name of this DICOM image, and the tag (0010, 0030) represents the Patient Date of Birth, which stores the date of birth of the patient for this DICOM image. In DICOM, the data values stored in each tag are different. Therefore, we mainly apply the data value stored in the data element describing this information and use the data value as the key to 1D-ECC chaos mapping after processing, which ensures that the plaintext ciphertext is highly correlated and further improves the security of the algorithm.

Key Generation
As the encrypted image is closely related to the key, it is very important to use a good key generation algorithm. First, set the control parameter λ 0 and the initial value x 0 for the 1D-ECC chaotic map as the user key. To generate the random number sequence A, the chaotic map is iterated M × N times. To avoid transient effects, the first 1000 sequences of random number sequence A are discarded to obtain the random number sequence B. The first six elements of the random number sequence B are selected as b 1 , b 2 , b 3 , b 4 , b 5 , b 6 , which are used to control the selection of DICOM tag information.
where S is the total number of DICOM data elements, b 1 , b 2 , b 3 , b 4 , b 5 , b 6 , as a control pointer for DICOM data element selection, and six sets of DICOM data element information can be obtained. For example, the information obtained is: (1) (0008, 0018): SOP Instance UID (Instance UID number); UID form is a string used to uniquely identify various different information objects in the DICOM standard, such as the value representation type of data elements, DICOM abstract syntax name, transmission syntax, application context name to ensure uniqueness in various different countries, regions, manufacturers, and equipment use. As the information in the DICOM image is public, to improve the security of the key, we carry out XOR encryption on the selected data value and use the encrypted DICOM data value to generate the key used in the subsequent encryption process, as shown in Figure 7 The specific operations are as follows: Step 1: The selected six groups of DICOM Tag information are noted as d1, d2, d3, d4, d5, d6; Step 2: The hash function is irreversible, conflict-resistant, covert, and can effectively withstand known plaintext attacks and selected plaintext/ciphertext attacks when compared to the random key generation approach. Therefore, we operate on the data using SHA-512, which is part of a set of hashing algorithms called SHA-2 that performs a hash function on the given data and yields a hexadecimal string of 128 bits in length. Using this to operate on d1, d2, d3, d4, d5, d6, a hexadecimal hash string of 128 bits in length is obtained and the hash value is noted as d1 hash , d2 hash , d3 hash , d4 hash , d5 hash , and d6 hash , respectively, as shown in the following equation: Step 3: Convert d1 hash , d2 hash , d3 hash , d4 hash , d5 hash , and d6 hash from hexadecimal to binary, as one hexadecimal number is equal to four binary numbers, yielding six binary sequences of length 512; Step 4: Convert the random number sequence B from decimal to binary; for the random number B, intercept every 512 bits, intercept six times, and obtain six binary chaotic sequences of length 512 as B 1 , B 2 , B 3 , B 4 , B 5 , B 6 ; Step 5: d1 hash , d2 hash , d3 hash , d4 hash , d5 hash , and d6 hash and B 1 , B 2 , B 3 , B 4 , B 5 , B 6 are subjected to heteroskedastic operation (⊕) to obtain six ciphertext sequences C 1 , C 2 , C 3 , C 4 , C 5 , C 6 ; Step 6: divide C 1 , C 2 , C 3 , C 4 , C 5 , C 6 , i.e., each ciphertext sequence, into 32 groups (the length of each group is 16 bits), and convert them from binary to decimal to find a 6 × 32 decimal matrix key; c 1,1 c 1,2 · · · · · · c 1,32 c 2,1 c 2,2 · · · · · · c 2,32 c 3,1 c 3,2 · · · · · · c 3,32 c 4,1 c 4,2 · · · · · · c 4,32 c 5,1 c 5,2 · · · · · · c 5,32 c 6,1 c 6,2 · · · · · · c 6,32 Step 7: Perform a dissimilarity operation on each element of the key in each row; Step 8: According to the obtained k 1 , k 2 , k 3 , k 4 , k 5 , k 6 , to carry out the operation of Formula (13) to obtain the subsequent encryption process requires the control parameters λ 0 , λ 1 , λ 2 and the initial value initial value x 0 , x 1 , x 2 specific operation, as shown in (14).

Generation of Chaotic Sequences
Using the steps outlined above, the initial values of control parameters λ 0 , λ 1 , λ 2 and the initial values x 0 , x 1 , x 2 are obtained, and the chaotic sequences are generated as follows: Step 1: Substitute the obtained parameters λ 0 and the initial value x 0 into the system and iterate M × N times to obtain the chaotic sequence A 1 ; Step 2: Substitute the obtained parameter λ 1 and the initial value x 1 into the system, and iterate 2 × M × N times to obtain the chaotic sequence A 2 ; Step 3: Substitute the obtained parameter λ 2 and the initial value x 2 into the system, and iterate 2 × M × N times to obtain the chaotic sequence A 3 ; Step 4: Arrange the chaotic sequence A 1 in ascending order and record its index sequence T1; Step 5: The chaotic sequences A 2 and A 3 are operated as shown in (15) and (16) to obtain the diffusion key stream Q 1 and Q 2 , respectively; . , 65536 Step 6: Divide the chaotic sequence Q 1 into two chaotic sequences Q 11 , Q 12 of length M × N; Step 7: Divide the chaotic sequence Q 2 into two chaotic sequences Q 21 , Q 22 of length M × N; Among them, the index sequence T 1 is used for the first permutation, the chaotic sequences Q 11 , Q 12 , Q 21 , Q 22 are used for the two-dimensional bidirectional diffusion.

Selection of Region of Interest Blocks
In this section, the selection of target thresholds and the process of determining the region of interest (ROI) are mainly described. The OTSU threshold segmentation method is used in the region of interest block selection process to segment the region of interest in the picture and acquire the target threshold t, which will be used for the later judgment of the region of interest.

Target Threshold Segmentation
The OTSU algorithm is a fast approach for binarizing images that was proposed by Japanese researcher Otsu in 1979 [44], and it is based on the clustering concept: (1) Dividing the number of gray levels of an image into two parts by gray level, such that the difference in gray values between two parts is the largest and the difference in gray levels between each part is the smallest. (2) Finding a suitable gray level to divide by the calculation of a variance.
(3) The traversal method is used to obtain the threshold t that maximizes the variance between classes, and t is the desired target threshold.
The OTSU method is often regarded as the best technique for image segmentation threshold selection because it is simple to implement and is unaffected by picture brightness or contrast, making it ideal for ROI segmentation in medical images.

Selection of Region of Interest
Step 1: The size of the plaintext image is M × N, and the plaintext image is partitioned into blocks of size n × n (n is an integer that can be divided by M and N), which are divided into S blocks, S = M×N n 2 . Here, we set n to 4, and the size of each image block is 4 × 4 = 16.
Step 2: calculate the average of grayscale pixels for each image block according to Equation (17).v where mean() is the mean function and B i denotes the i-th image block, i = 1, 2, 3, . . . , S.
Step 3: The identification method of the region of interest is as follows: Whenv s > t, then the image block B s is the region of interest ROIB r , and the corresponding region of interest flag bit ROI f lag s can be set to 1.
Whenv s ≤ t, the image block B s is a non-interest region RON I, and the corresponding region of interest flag bit ROI f lag s can be set to 0.
Where t is the threshold value for determining the ROI region, which is obtained by thresholding the image by the above OTSU threshold segmentation method; where r is the image region of interest number, r = 1, 2, · · · , sum ROI f lag s ; where ROI f lag s is the corresponding flag bit of the s region of interest; and where sum ROI f lag s is the number of all image blocks in the image that are discriminated as regions of interest.
Step 4: The r region of interest sequence ROIB r are combined into a matrix in a topdown order to obtain the region of interest matrix ROI M with length (n × n) and width Col ROI , operating as shown in Figure 8.

Encryption Algorithm
The matrix ROI M obtained in Section 4.2 is converted into a signed hexadecimal integer, and then chaotic encryption is carried out. In image encryption, two very important operations are scrambling and diffusion. The goal of scrambling is to disrupt the relationship between image pixel positions. Diffusion operation ensures that even small changes in the original image can cause significant changes in the ciphertext image. We use helical scanning scrambling and two-dimensional bidirectional diffusion to encrypt the region of interest in the encryption stage.

Scrambling Stage
Step 1: The obtained region of interest matrix ROI is spirally scanned, and the scanning process is shown in Figure 9.
Step 2: The sequence of elements after scanning is output as a one-dimensional matrix sequence ROI 1D .
Step 3: The chaotic sequence A 1 is sorted in ascending order to obtain the index sequence index.
Step 4: Scramble ROI 1D using an index sequence, to find the disordered one-dimensional matrix sequence SROI 1D and the process is shown in Figure 10.
Step 5: SROI 1D is deformed into a matrix L R OI of size (n × n) × Col ROI .

Diffusion Stage
In the diffusion stage, two-dimensional bidirectional mode taking diffusion is adopted, that is, two-way column and column plus mode diffusion is carried out on the scrambled matrix. First, the scrambled matrix is spread row by row from top to bottom, that is, the first and second rows are added mode diffusion, and the result and the third row are added mode diffusion, until the diffusion of the last row is completed. Then, the same method spreads from left to right, column by column, until it ends in the rightmost column. We continue to add mode diffusion row by row from bottom to top until the diffusion of the first row is completed. Finally, we encrypt diffusion column by column from right to left until the diffusion of the left-most column is completed, and we finally obtain the ciphertext ROI matrix. The diffusion process is shown in Figure 11 and the specific steps are as follows: Step 1: The chaotic sequences Q 11 , Q 12 , Q 21 , Q 22 are intercepted to obtain four chaotic sequences K 1 , K 2 , K 3 , K 4 of length (n × n) × Col ROI , respectively; Step 2: The chaotic sequences K 1 , K 2 , K 3 , K 4 are deformed to find the diffusion key matrix P1, P2, P3, P4 of size (n × n) × Col ROI , respectively; Step 3: The scrambled matrix sequence L R OI and diffusion key matrix P1 are carried out from top to bottom; mode-taking row diffusion and the matrix E 1 after the first diffusion is obtained: where i = 2, 3, · · · · · · n × n; Step 4: Diffuse the matrix E 1 with the diffusion key matrix P2 from left to right to obtain the matrix E 2 after the second diffusion: E 2 ((:, j) = mod(122 + P2(:, 1) + E 1 (:, 1), 65536) E 2 ((:, j) = mod(E 2 (:, j − 1) + P2(:, j) + E 1 (:, j), 65536) (26) where j = 2, 3, · · · · · · Col ROI ; Step 5: Take the mode line diffusion of matrix E 2 and diffusion key matrix P3 from bottom to top and find the matrix E 3 after the third diffusion: E 3 (n × n, :) = mod(107 + P3(n × n, :) + E 2 (n × n, :),

Decryption Algorithm
As the encryption/decryption scheme proposed in this paper is symmetric, the decryption process is the inverse process of the encryption process. The decryption flow chart is shown in Figure 12. As we convert the region of interest from 8 bits to 16 bits during encryption, the pixel value range of the ciphertext ROI is [0, 65,535], and the pixel value range of ROB is [0, 255], we can still use the block-based selection scheme to distinguish the encrypted ROI and ROB, and we can avoid passing the location information of ROI to the receiver or embedding the location information of ROI in the image. This approach reduces the possibility of leaking the encrypted location information during transmission and storage.

Simulation Results and Safety Analysis
To verify the excellent performance of our proposed encryption scheme, a series of experiments are carried out in this section using MATLAB R2015 software, as shown in Figure 13. In addition, although the experiments in this section are analyzed only for grayscale medical images, our encryption algorithm is also applicable to RGB color medical images by using this encryption algorithm only for their three color components.

Simulation Results
To verify the excellent performance of our proposed encryption scheme, a series of experiments are conducted in this section using MATLAB R2015b software, and we use medical images from different parts of the body for testing, including abdominal data from MICCAI 2017 Liver Tumor Segmentation Challenge (LiTS) dataset, lung data from the Lung Image Database Consortium (LIDC-IDRI), and brain data from the Second Hospital of Jilin University. Although the experiments in this section are only conducted with grayscale medical images as an example for analysis, our encryption algorithm is also applicable to RGB color medical images by using this encryption algorithm for only their three color components. We used CT Abdominal, CT Lung, and CT Brain with a size of 512 × 512, and MRI Brain with a size of 320 × 320 for MATLAB simulation test, and obtained the region of interest segmentation threshold values of 66, 53, 45, and 55, respectively, as shown in Figure 13.

Key Space Analysis
The key space is the range of encryption key sizes and consists of all available keys used in the encryption process. In general, a bigger key space can withstand more exhaustive attacks, improving the algorithm's security. When the key space of the algorithm is larger than 2 100 [45] it can withstand brute force attacks. The encryption algorithm we suggest is as follows. There are eight keys: λ 0 , λ 1 , λ 2 , λ 3 , x 0 , x 1 , x 2 , x 3 assuming the computational accuracy of double-precision numbers is 10 −15 , so the total key space is 10 15 8 = 2 398 > 2 100 . As a result, the suggested picture algorithm has a wider key space, which makes it more resistant to brute force attacks.

Key Sensitivity Analysis
A good cryptosystem needs to not only be large enough, but also to be sensitive enough to the key. Key sensitivity means that even a very small change in the key bit can have a large impact on the entire cryptographic image, resulting in a completely different encrypted image [46]. We analyze the effect of key changes on the outcomes of both the encryption and decryption processes. Different encryption keys will result in different encryption results from the standpoint of the encryption process; from the standpoint of the decryption process, if the decryption key is different from the encryption key, it should not be possible to decrypt the original image correctly. Given KEY = λ 0 , λ 1 , λ 2 , λ 3 , x 0 , x 1 , x 2 , x 3 = 5.2, 15.19, 13.98, 11.65, 0.18, 0.35, 0.31, 0.38, for which six parameters are finely changed to obtain six different sets of keys, K1, K2, K3, K4, K5, K6, these six sets of keys are tested for key sensitivity.
In the encryption process, we encrypted the same plaintext image, "CT Abdomen", with a precision difference of 10 −15 , and then compared the encrypted images by subtraction, and the results are shown in Figure 14. The NPCR and UACI values between the ciphertext image generated with the correct key and the ciphertext image generated with the error key were calculated, and the results are listed in Table 1. In the decryption process, we use a key with an accuracy difference of 10 −15 , and the experimental results are shown in Figure 15, The results show that only the correct key can recover, and even if the key differs from the correct key by only 10 −15 , it is impossible to obtain the correct decryption result. These two experiments further demonstrate that the algorithm is highly sensitive to keys and can effectively resist brute force attacks.

Histogram Analysis
The histogram depicts the distribution of image pixels, which is a key indicator of the encryption algorithm's performance [47]. The distribution of pixels in the original image is not uniform, in general. The pixels in the ciphertext should be dispersed as equally as possible to make the encrypted image more resistant to statistical analysis attacks. As a result, the better the encryption algorithm performs, the more uniform the histogram distribution of the ciphertext is. The histogram distribution of the ordinary image is uneven, whereas the histogram distribution of the encrypted image is uniform, indicating that statistical analysis is difficult for an attacker to acquire useful information.
It can be seen that the histogram is more stable when the number of pixels per gray level is closer. It indicates that the value of each pixel tends to be consistent and the security is high. The results of histogram analysis are shown in Figure 16. It can be seen that, after encryption, the original uneven pixel distribution becomes smoother and the pixel distribution is more uniform, which proves that the algorithm is more secure.

Correlation Analysis
There are a lot of data in the plaintext image, but there is also the issue of data redundancy, which leads to a strong correlation between its neighboring pixels. The correlation coefficient is a statistical indicator that reflects the degree of close correlation between variables and can be used to represent the connection between pixels. The correlation coefficient is used in image encryption security analysis to test the correlation between adjacent pixels, and the closer the correlation coefficient value is to 1, the greater the degree of correlation between two variables. When the value approaches zero, the two variables are considered uncorrelated. To secure data from various attacks, an effective encryption scheme should disrupt this link between neighboring pixels. A total of 5000 pairs of adjacent pixels were randomly selected from the plaintext and ciphertext images of "Abdominal CT", and the correlation coefficients were calculated from the horizontal, vertical, and diagonal directions, respectively, by the following equation [48].
where x and y are the neighboring pixel values in an image. Figure 17 depicts the results, and Table 2 depicts the correlation coefficients, which show that the correlation coefficients of the cryptographic images are approximately equal to 0. This means that, in the horizontal, vertical, and diagonal directions, adjacent pixels in cryptographic images have very little correlation. Consequently, the suggested encryption scheme is resistant to pixel correlation statistical assaults.  [49] 0.0193 −0.0154 0.0032 Ref. [50] −0.0394 −0.0194 −0.0223

Information Entropy Analysis
Information entropy is a metric for quantifying information and determining the amount of data required. The randomness of picture information in an image is represented by information entropy, which is a key indication for testing the performance of encryption techniques. Information entropy describes the chaos of image information, and the higher the information entropy, the more disordered the image information is. On the other hand, the lower the information entropy, the more ordered the visual data is. The ideal amount of information entropy for an 8-bit cipher image is 8. Similarly, if the cipher image pixels are represented by 16 bits and the cipher picture's ideal value is 16, the information entropy of the image encrypted by our approach should be close to the ideal value of 16 as we convert the cipher image to 16-bit pixels. Table 3 illustrates the test results, indicating that the information entropy is approaching the optimal value. The following equation can be used to determine the information entropy [36].
where (c i ) denotes the pixel value of the image and p(c i ) is the probability of pixel occurrence.

Differential Attacks Analysis
The differential attack is a crucial test for evaluating image encryption methods. Its fundamental method is to encrypt the plaintext image by changing the pixel value and then attack the encryption technique by comparing it to the original encrypted image. As a result, a good picture encryption method should be resistant to differential attacks. The uniform average change rate (UACI) and the number of pixel change rate (NPCR) are two measures used to assess encryption systems [52].
Where M is the image length, N is the image width, and C 1 and C 2 are the two ciphertext images before and after the original plaintext image is changed by one pixel value. For a 16-bit grayscale image, the ideal value of UACI is about 33.33333% of the bit, while the ideal value of NPCR is about 99.9985%. We tested the NPCR and UACI for different images, and the test results are shown in Table 4. The experimental results show that the present encryption scheme has better robustness against differential attacks. In addition, the results also demonstrate that the present encryption algorithm has high plaintext sensitivity.

Select Plaintext/Ciphertext Attack Analysis
To resist selective plaintext/ciphertext attacks, the key should be made to contain information related to the plaintext [49]. In generating chaotic sequences, part of the key used in this paper is obtained from the label information in the plaintext image, which means that if different label information is selected, then the key will also change, indicating that the ciphertext image is more dependent on the plaintext image and, therefore, our proposed algorithm is capable of effectively resisting both known plaintext and selected plaintext attacks.

Robustness Analysis
Robustness analysis is used to evaluate the resistance of an image to data changes or loss during transmission [53]. Images may be affected by noise during transmission, and these noise attacks may cause the images not to be decrypted properly. We used two different levels of noise attacks on ciphertext images, namely, salt-and-pepper noise, and scattered noise. The experimental results are shown in Figure 18. To quantitatively measure the reliability of defense against noise and data loss, we compared the PSNR of the original and decrypted images. The peak signal-to-noise ratio (PSNR) is a mathematical estimate of image quality between the original and noise-added images. The higher the PSNR number, the closer the original and decrypted images are. The calculation formula of PSNR is shown in Formula (31) [53]: where MSE denotes the mean square error between the original image P and the encrypted image C. MAX denotes the maximum pixel value of the image, MAX = 256 for 8-bit images and MAX = 65,536 for 16-bit images. P is the original image and C is the decrypted image after adding noise. Table 5 displays the test results and the PSNR is more than 44 dB, as can be seen, which indicates that the algorithm is resistant to noise attacks and has a high level of robustness.  In addition to noise attack, clipping attack is also a common attack method. In our proposed algorithm, instead of encrypting the whole medical image, the medical image's ROI is encrypted. The ROI location information buried in the ciphertext image will be lost if the ciphertext image is clipped, rendering the ciphertext image unrecoverable.
It should be noted, in particular, that medical images contain critical patient pathology information. Even minor tampering or data loss can have a significant impact on a doctor's diagnosis. As a result, one should try to avoid causing image damage (such as noise or clipping attacks) or implement appropriate warning policies after such attacks and re-upload the image to ensure the integrity of the image information and the physician's access to the entire medical image.

Speed Analysis
The encryption speed is a significant indicator in the process of practical application, in addition to assessing the security of the encryption method. We completed the simulation tests on MATLAB 2015b platform with Intel Core i3 1.70 GHz CPU and 8 GB RAM. For comparison, full image encryption and region of interest encryption were performed on medical images of size 512 × 512 and 320 × 320, respectively, with the encryption scheme proposed in this paper. The encryption scheme's efficiency is determined by the encryption time (ET) and throughput (ETP) [54]. These computing statistics are expressed as follows: For the above test images, Table 6 shows the encryption time, throughput, and the number of cycles per byte required. As may be shown, the proposed encryption method's experimental results are superior, with a very short encryption time and high throughput, which can meet the applicability in real-time security applications. Compared with other encryption algorithms, our proposed encryption algorithm can meet the requirements of fast encryption. We should point out that the complexity of the algorithm is to measure a key element of the efficiency of encryption in the encryption algorithm we proposed; the algorithm's time complexity with the size of the area of interest. This is related to the amount of interested area in that the more interest in regional elements, the higher the time complexity of algorithm, and the encryption time will also increase. Table 6 provides the results of the encryption time, ROI amount, throughput, and number of cycles per byte required for the encryption process for the above test images. We can see that the proposed encryption method has good experimental results, short encryption time, and high throughput, which can meet the applicability of real-time security applications. Compared with other encryption algorithms, our proposed encryption algorithm can meet the requirements of fast encryption.

Conclusions
The following issues are looked into in this paper. The first proposal is for a new type of one-dimensional chaos. The system has a greater parameter range and better chaotic behavior than the existing Logistic and Sinusoidal mapping systems. It is proven that the 1D-ECC system can generate good chaotic sequences using the bifurcation diagram, Lyapunov exponent, information entropy, and 0-1 test. Secondly, we devise a new key generation approach based on the DICOM label information of medical images, in which the key is used to launch a new chaotic mapping to generate chaotic sequences, resulting in a key that is highly related to the plaintext image. On this foundation, a region of interest (ROI) encryption algorithm for medical images that uses helical scanning scrambling and bidirectional diffusion is created. The algorithm we proposed has a good encryption effect and can withstand many known assaults, according to simulation results and security analysis. Finally, in future work, we will consider combining with asymmetric algorithms to solve the security risks of key transmission, further improve the security of medical images, and guarantee the accurate and efficient transmission of medical images.