A practical chaotic encryption method for medical images based on oblique filling curve
By adopting a chaotic encryption method based on oblique fill curves in medical image encryption, the problem of difficulty in encrypting medical images with negative pixel values in the prior art is solved, efficient encryption of DICOM format images is achieved, and the uniqueness of the encrypted image of each patient is ensured.
Patent Information
- Application Number
- CN202211363601.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-02
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2042-11-02
AI Technical Summary
Existing medical image encryption algorithms are difficult to process images with negative pixel values, especially medical images in DICOM format, making these encryption algorithms unpractical.
The medical image chaos encryption method based on oblique fill curve is adopted to ensure that negative values can be encrypted through image preprocessing, key generation, diffusion process, pre-scheduling and messing process.
Efficient encryption of medical images with negative values is achieved, the practicality of the encryption method is added, and the encrypted image of each patient is ensured completely different by adding the patient's ID number to the key.
Smart Images

Figure CN115842618B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of medical image processing and relates to a practical chaotic encryption method for medical images based on an oblique filling curve. Background Art
[0002] In recent years, medical image encryption algorithms based on various technologies have been proposed. Although many medical image encryption algorithms have been developed, most image encryption schemes cannot encrypt images with negative pixel values, which makes them limited; most image encryption schemes cannot encrypt images with negative pixel values, which undoubtedly makes these encryption algorithms impractical. For medical images, DICOM is the main storage format, so the proposed encryption scheme should be able to encrypt images in DICOM format. Because most encryption algorithms cannot encrypt images with negative pixel values, and most medical images are stored in DICOM format, which contains images with negative pixel values. Summary of the invention
[0003] In order to solve the above problems, the present invention provides a technical solution adopted by the present invention: a practical chaotic encryption method for medical images based on an oblique filling curve, comprising the following steps:
[0004] Acquiring a medical image to be processed;
[0005] Preprocessing the medical image once to obtain a preprocessed medical image;
[0006] Generate a key based on the preprocessed medical image, wherein the key is based on a chaotic map to obtain a chaotic sequence;
[0007] The pixel values of the preprocessed medical image are diffused based on the chaotic sequence to obtain a semi-encrypted image;
[0008] Performing secondary preprocessing on the semi-ciphertext image to obtain a preprocessed semi-ciphertext image;
[0009] The preprocessed semi-ciphertext image is scrambled based on chaotic sequence, using index scrambling and oblique filling curve scrambling to obtain the encrypted image.
[0010] Further: the preprocessing of the medical image to obtain the processed medical image comprises the following steps:
[0011] First, traverse the plaintext image. When the pixel value of the plaintext image has a negative value, set flag = 0, otherwise set flag = 1.
[0012] When flag = 0, the pixel value of the input image is judged. For pixel values greater than or equal to 0, they are recorded as 1 in the new matrix, and for pixel values less than 0, they are recorded as 0 in the new matrix. All pixel values of the image are traversed to obtain the matrix S, and then the pixel values of the plaintext image are processed as positive values to obtain the image P;
[0013] When flag=1, no processing is required and the plaintext image is P.
[0014] Further: the process of generating a key based on the preprocessed medical image is as follows:
[0015] The preprocessed medical image uses a hash algorithm 512 to generate a key;
[0016] The patient's ID number and the pixel value of the image P obtained by image preprocessing are mapped to 0-255 as the input of the SHA-512 algorithm to obtain a hexadecimal key with a length of 146;
[0017] Convert the 146-bit key into binary digits. One hexadecimal digit is equal to four binary digits, so the string length becomes 584. Divide the 584-bit binary digits into two groups and then perform an XOR operation to obtain a string of 292-bit binary digits, which will be divided into 4 groups, each with a length of 73, that is.
[0018] K=K1 K2K3K4 (1)
[0019] Wherein: K represents the key, K1, K2, K3 and K4 are the first group of keys, the second group of keys, the third group of keys, and the fourth group of keys.
[0020] Further: the initial value and control parameters of the TLCS chaotic map are determined by the key, and the initial value and parameters x1, x2, μ1, μ2 of the chaotic map are generated by the following formula:
[0021]
[0022]
[0023] Among them: bi2de(x) means converting the binary number x into a decimal number, and x represents K1, K2, K3 and K4.
[0024] Furthermore, the pixel values of the preprocessed medical image are diffused based on the chaotic sequence to obtain a semi-encrypted image as follows:
[0025] Step 1: Take x1 and μ1 as the initial value and parameters of TLCS mapping, substitute x1 and μ1 and iterate (M+4)×(N+4) times to get the chaotic sequence A, then transform the chaotic sequence according to equation (4) to get the sequence A1;
[0026] A1=mod(floor(A(1:(M+4)×(N+4))×2 16 ,F) (4)
[0027] Where: floor(x) represents rounding down, where F represents the number of intensity levels; where M is the number of rows of the medical image to be processed, and N is the number of columns of the medical image to be processed;
[0028] Step 2: Divide the image P into four blocks, denoted as P1, P2, P3 and P4 respectively. At the same time, divide the chaotic matrix A1 into four blocks, denoted as A 11 , A 12 , A 13 and A 14 , the size is ((M+4) / 2)×((N+4) / 2);
[0029] Step 3: Perform diffusion operations on P1, P2, P3 and P4 respectively according to equation (5-8) to obtain four diffused images, namely P1′, P2′, P3′ and P4′.
[0030]
[0031]
[0032]
[0033]
[0034] Where: for a 512×512 image, i and j range from 2-257, where F represents the number of intensity levels;
[0035] Step 4: Splice the four diffused images P1′, P2′, P3′ and P4′ together to obtain the semi-ciphertext image P′.
[0036] Further: the process of performing secondary preprocessing on the semi-ciphertext image to obtain the preprocessed semi-ciphertext image is as follows:
[0037] When flag = 0, the pixel value sign of P' is changed according to the matrix S obtained by image preprocessing, and the matrix S is traversed.
[0038] If S(i,j)=0, the value of P′(i,j) will not be changed.
[0039] If S(i,j)=1, then change the value of P′(i,j) to its opposite number, and after the traversal is completed, the image P″ is obtained;
[0040] When flag=1, no processing is required, and P′ is equal to P″.
[0041] Further: the pre-processed semi-ciphertext image is based on a chaotic sequence, and uses index scrambling and oblique filling curve scrambling to obtain the encrypted image in the following process:
[0042] Step 1: Take x2 and μ2 as the initial value and parameter of the chaotic mapping, iterate M×N times to get the chaotic sequence A2;
[0043] Step 2: Convert the image into a one-dimensional sequence Seq, and then sort the indexes according to A2 to obtain the sequence Seq1 after index scrambling;
[0044] Step 3: Convert the obtained Seq1 into an M×N matrix, and then use the oblique filling curve to perform a scrambling to obtain the encrypted image.
[0045] A practical chaotic encryption device for medical images based on oblique filling curves includes the following steps:
[0046] Acquisition module: used to acquire the medical image to be processed;
[0047] A primary preprocessing module: used to perform a primary preprocessing on the medical image to obtain a preprocessed medical image;
[0048] A key generation module: used to generate a key based on the preprocessed medical image, wherein the key is based on a chaotic map to obtain a chaotic sequence;
[0049] Diffusion module: used to diffuse the pixel values of the preprocessed medical image based on the chaotic sequence to obtain a semi-encrypted image;
[0050] Secondary preprocessing module: used to perform secondary preprocessing on the semi-ciphertext image to obtain the preprocessed semi-ciphertext image;
[0051] Scrambling module: It is used to scramble the preprocessed semi-ciphertext image based on the chaotic sequence, using index scrambling and oblique filling curve scrambling to obtain the encrypted image.
[0052] The present invention provides a practical chaotic encryption method for medical images based on oblique filling curves. For medical images, DICOM is the main storage format. Different from traditional grayscale images, the pixel values of medical images are both positive and negative, so the quality of medical images can be better guaranteed.
[0053] Based on the Logistic and Sine chaotic mappings, this paper proposes a new chaotic mapping (TLCS), which has good performance as shown by various tests.
[0054] The present invention designs a chaotic encryption method for medical images based on oblique filling curves. The main process includes five parts: image preprocessing, key generation, diffusion process, preprocessing before scrambling, and scrambling process. Adding the ID card to the key increases the key space and ensures that the encrypted image of each patient is completely different, including the patient's own identity information;
[0055] The encryption scheme proposed in this application can realize the encryption of medical images with negative values, which increases the practicality of the method. During the encryption process, the patient's ID number is added to the key, which increases the key space of the method. The present invention proposes an oblique filling curve for scrambling, which can realize rapid scrambling of the image.
[0056] The present invention can not only encrypt traditional PNG images, but also encrypt images with negative pixel values, has a wider scope of application, and increases the practicability of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0058] Figure 1 is a flow chart of the method;
[0059] Figure 2 It is a block diagram of the diffusion process;
[0060] Figure 3 (a) is a schematic diagram of the data matrix and the oblique filling curve, and (b) is a schematic diagram of the data matrix after a scan of the oblique filling curve;
[0061] Figure 4 This is a schematic diagram of index scrambling;
[0062] Figure 5 It is an encryption effect diagram, where (a) is the medical image to be processed, (b) is the encrypted ciphertext image, and (c) is the decrypted image. DETAILED DESCRIPTION
[0063] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0064] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present invention and its application or use. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0065] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0066] Unless otherwise specifically stated, the relative arrangement of the parts and steps described in these embodiments, the numerical expressions and numerical values do not limit the scope of the present invention. At the same time, it should be clear that, for ease of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship. The technology, methods and equipment known to ordinary technicians in the relevant field may not be discussed in detail, but in appropriate cases, the technology, methods and equipment should be regarded as part of the authorization specification. In all examples shown and discussed here, any specific value should be interpreted as merely exemplary, rather than as a limitation. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further discussed in subsequent drawings.
[0067] In the description of the present invention, it is necessary to understand that the directions or positional relationships indicated by directional words such as "front, back, up, down, left, right", "lateral, vertical, perpendicular, horizontal" and "top, bottom" are usually based on the directions or positional relationships shown in the drawings. They are only for the convenience of describing the present invention and simplifying the description. Unless otherwise specified, these directional words do not indicate or imply that the device or element referred to must have a specific direction or be constructed and operated in a specific direction. Therefore, they cannot be understood as limiting the scope of protection of the present invention: the directional words "inside and outside" refer to the inside and outside relative to the contours of each component itself.
[0068] For ease of description, spatially relative terms such as "above", "above", "on the upper surface of", "above", etc. may be used here to describe the spatial positional relationship between a device or feature and other devices or features as shown in the figure. It should be understood that spatially relative terms are intended to include different orientations of the device in use or operation in addition to the orientation described in the figure. For example, if the device in the accompanying drawings is inverted, the device described as "above other devices or structures" or "above other devices or structures" will be positioned as "below other devices or structures" or "below their position devices or structures". Thus, the exemplary term "above" can include both "above" and "below". The device can also be positioned in other different ways (rotated 90 degrees or in other orientations), and the spatially relative descriptions used here are interpreted accordingly.
[0069] In addition, it should be noted that the use of terms such as "first" and "second" to limit components is only for the convenience of distinguishing the corresponding components. If not otherwise stated, the above terms have no special meaning and therefore cannot be understood as limiting the scope of protection of the present invention.
[0070] Figure 1 is a flow chart of the method;
[0071] A practical chaotic encryption method for medical images based on oblique filling curves includes the following steps:
[0072] Step 1: Obtain the medical image to be processed;
[0073] Step 2: preprocess the medical image to obtain a preprocessed medical image;
[0074] Step 3: Generate a key based on the preprocessed medical image, wherein the key is based on a chaotic map to obtain a chaotic sequence;
[0075] Step 4: The pixel values of the preprocessed medical image are diffused based on the chaotic sequence to obtain a semi-encrypted image;
[0076] Step 5: Perform secondary preprocessing on the semi-ciphertext image to obtain a preprocessed semi-ciphertext image;
[0077] Step 6: The preprocessed semi-ciphertext image is scrambled based on the chaotic sequence using index scrambling and oblique filling curve scrambling to obtain the encrypted image.
[0078] Step 1 / Step 2 / Step 3 / Step 4 / Step 5 / Step 6 are executed in sequence;
[0079] Further: the preprocessing of the medical image to obtain the processed medical image comprises the following steps:
[0080] First, traverse the plaintext image. When the pixel value of the plaintext image has a negative value, set flag = 0, otherwise set flag = 1.
[0081] When flag = 0, the pixel value of the input image is judged. For pixel values greater than or equal to 0, they are recorded as 1 in the new matrix, and for pixel values less than 0, they are recorded as 0 in the new matrix. All pixel values of the image are traversed to obtain the matrix S, and then the pixel values of the plaintext image are processed as positive values to obtain the image P;
[0082] When flag=1, no processing is required and the plaintext image is P.
[0083] Further: the process of generating a key based on the preprocessed medical image is as follows:
[0084] Since the hash function can effectively resist known plaintext attacks and chosen plaintext attacks, and the hash function is very sensitive to the original image, the pre-processed medical image uses the hash algorithm 512 to generate the key;
[0085] The patient's ID number and the pixel value of the image P obtained by image preprocessing are mapped to 0-255 as the input of the SHA-512 algorithm to obtain a hexadecimal key with a length of 146;
[0086] Convert the 146-bit key into binary digits. One hexadecimal digit is equal to four binary digits, so the string length becomes 584. Divide the 584-bit binary digits into two groups and then perform an XOR operation to obtain a string of 292-bit binary digits, which will be divided into 4 groups, each with a length of 73, that is.
[0087] K=K1 K2 K3 K4 (1)
[0088] K represents a key, K1, K2, K3 and K4 represent the first group of keys, the second group of keys, the third group of keys and the fourth group of keys.
[0089] The TLCS chaotic mapping used for encryption has been proven to have good performance through various tests. The definition of TLCS is as follows:
[0090] x n+1 =mod(utan(πx n (1-x n )×e 10 , 1)
[0091] Where: u is the control parameter, mod(x,1) represents the modulus operation of x with respect to 1. When the control parameter u∈(0,8) of the system, x of TLCS nUniformly distributed within (0,1), it is in a chaotic state and can generate a chaotic sequence.
[0092] The initial value and control parameters of the TLCS chaotic map are determined by the key. The initial value and parameters x1, x2, μ1, μ2 of the chaotic map are generated by the following formula:
[0093]
[0094]
[0095] Where: bi2de(x) means converting the binary number x into a decimal number, representing K1, K2, K3 and K4.
[0096] Figure 2 is a schematic diagram of the diffusion process; further: the pixel values of the preprocessed medical image are diffused based on the chaotic sequence to obtain the semi-ciphertext image as follows:
[0097] Step 1: Take x1 and μ1 as the initial value and parameters of TLCS mapping, substitute x1 and μ1 and iterate (M+4)×(N+4) times to get the chaotic sequence A, then transform the chaotic sequence according to equation (4) to get the sequence A1;
[0098] A1=mod(floor(A(1:(M+4)×(N+4))×2 16 ,F) (4)
[0099] Wherein: floor(x) represents rounding down, where F represents the number of intensity levels; for example, if the pixel value is represented by 8 bits, then F=256, and if the pixel value is represented by 16 bits, then F=65536.
[0100] Step 2: Divide the image P into four blocks, denoted as P1, P2, P3 and P4 respectively. At the same time, divide the chaotic matrix A1 into four blocks, denoted as A 11 , A 12 , A 13 and A 14 , the size is ((M+4) / 2)×((N+4) / 2);
[0101] Step 3: Perform diffusion operations on P1, P2, P3 and P4 respectively according to equation (5-8) to obtain four diffused images, namely P1′, P2′, P3′ and P4′.
[0102]
[0103]
[0104]
[0105]
[0106] Where: for a 512×512 image, the range of i and j is 2-257, where F represents the number of intensity levels; for example, if the pixel value is represented by 8 bits, then F=256, and if the pixel value is represented by 16 bits, then F=65536.
[0107] Step 4: Concatenate the four diffused images P1′, P2′, P3′ and P4′ together to obtain the semi-ciphertext image P′.
[0108] Further: the process of performing secondary preprocessing on the semi-ciphertext image to obtain the preprocessed semi-ciphertext image is as follows:
[0109] When flag = 0, the pixel value sign of P' is changed according to the matrix S obtained by image preprocessing, and the matrix S is traversed.
[0110] If S(i,j)=0, the value of P′(i,j) will not be changed.
[0111] If S(i,j)=1, then change the value of P′(i,j) to its opposite number, and get the image P″ after the traversal.
[0112] When flag=1, no processing is required, P′ is equal to P″, and P″ is the semi-ciphertext image after preprocessing.
[0113] Figure 3 (a) is a schematic diagram of the data matrix and the oblique filling curve, and (b) is a schematic diagram of the data matrix after a scan of the oblique filling curve.
[0114] Further: the pre-processed semi-ciphertext image is based on a chaotic sequence, and uses index scrambling and oblique filling curve scrambling to obtain the encrypted image in the following process: Figure 4 This is a schematic diagram of index scrambling;
[0115] Step 1: Take x2 and μ2 as the initial value and parameter of the chaotic mapping, and iterate M×N times to obtain the chaotic sequence A2; M and N are the sizes of the medical image to be processed, where M is the number of rows of the medical image to be processed, and N is the number of columns of the medical image to be processed;
[0116] Step 2: Convert the image into a one-dimensional sequence Seq, and then sort the indexes according to A2 to obtain the sequence Seq1 after index scrambling;
[0117] Index sorting is to number the chaotic sequence in order, starting from 1, 1, 2, 3..., one to one, and then sort the chaotic sequence, and the corresponding numbers of the chaotic sequence will also be sorted, and an index sequence is obtained.
[0118] Step 3: Convert the obtained Seq1 into an M×N matrix, and then use the oblique filling curve to perform a scrambling to obtain the encrypted image.
[0119] The interval and angle of the oblique fill curve have been determined, and the schematic diagram shows its traversal method.
[0120] The new chaotic mapping (TLCS) proposed in the present invention has been proved to have good performance through various tests, including bifurcation diagram, Lyapunov exponent, Shannon entropy, autocorrelation analysis, initial value sensitivity analysis and NIST test.
[0121] Figure 5 It is an encryption effect diagram, where (a) is the medical image to be processed, (b) is the encrypted ciphertext image, and (c) is the decrypted image.
[0122] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A practical chaotic encryption method for medical images based on oblique filling curve, characterized by: The following steps are involved: Acquiring a medical image to be processed; Preprocessing the medical image once to obtain a preprocessed medical image; Generate a key based on the preprocessed medical image, wherein the key is based on a chaotic map to obtain a chaotic sequence; The pixel values of the preprocessed medical image are diffused based on the chaotic sequence to obtain a semi-encrypted image; Performing secondary preprocessing on the semi-ciphertext image to obtain a preprocessed semi-ciphertext image; The preprocessed semi-ciphertext image is based on chaotic sequence, using index scrambling and oblique filling curve scrambling to obtain the encrypted image; The process of generating a key based on the preprocessed medical image is as follows: The preprocessed medical image uses a hash algorithm 512 to generate a key; The image obtained by the patient's ID number and image preprocessing P The pixel value is mapped to 0-255 as the input of the SHA-512 algorithm, and a hexadecimal key with a length of 146 is obtained; Convert the 146-bit key to binary digits. One hexadecimal digit equals four binary digits, so the string length becomes 584. Divide the 584-bit binary digits into two groups and then perform an XOR operation to obtain a string of 292-bit binary digits, which will be divided into 4 groups, each with a length of 73, that is, (1) Where: K represents a key, K1, K2, K3 and K4 represent the first group of keys, the second group of keys, the third group of keys and the fourth group of keys; The initial value and control parameters of the TLCS chaotic map are determined by the key. Generated by the following formula: (2) (3) in: Converts the binary number x to a decimal number. The pixel values of the preprocessed medical image are diffused based on the chaotic sequence to obtain a semi-encrypted image as follows: Step 1: x 1 and μ 1 is the initial value and parameter of TLCS mapping, substitute x 1 and μ 1 Iteration Get the chaotic sequence A , and then transform the chaotic sequence according to equation (4) to obtain the sequence A 1; (4) Where: floor( x ) represents rounding down, where F represents the number of intensity levels; where M is the number of rows of the medical image to be processed, and N is the number of columns of the medical image to be processed; Step 2: Image P It is divided into four parts, respectively P 1. P 2. P 3 and P 4. At the same time, the chaotic matrix A 1 is also divided into four parts, namely A 11 , A 12 , A 13 and A 14 , the size is ; Step 3: According to equation (5-8), P 1. P 2. P 3 and P 4 performs diffusion operation to obtain four diffused images, which are , , and ; (5) (6) (7) (8) Among them: for images, and The range is 2-257, where F Indicates the number of intensity levels; Step 4: Diffuse the four images , , and Splice together to get a semi-ciphertext image ; The preprocessed semi-ciphertext image is based on a chaotic sequence, and uses index scrambling and oblique filling curve scrambling to obtain the encrypted image in the following process: Step 1: x 2 and μ 2 is the initial value and parameter of the chaotic map, iterative The chaotic sequence A2 is obtained; Step 2: Convert the image into a one-dimensional sequence , then according to Sort the index and get the sequence after the index is scrambled ; Step 3: Get Convert to The matrix is then scrambled using an oblique filling curve to obtain the encrypted image.
2. According to claim 1, a practical chaotic encryption method for medical images based on oblique filling curves is characterized by: The preprocessing of the medical image to obtain the processed medical image comprises the following steps: First, traverse the plaintext image. When the pixel value of the plaintext image is negative, set flag=0, otherwise set flag=1. When flag=0, the pixel value of the input image is judged. For pixel values greater than or equal to 0, they are recorded as 1 in the new matrix, and for pixel values less than 0, they are recorded as 0 in the new matrix. All pixel values of the image are traversed to obtain the matrix S, and then the pixel values of the plaintext image are processed as positive values to obtain the image P; When flag=1, no processing is required and the plaintext image is P.
3. According to claim 1, a practical chaotic encryption method for medical images based on oblique filling curves is characterized by: The process of performing secondary preprocessing on the semi-ciphertext image to obtain the preprocessed semi-ciphertext image is as follows: When flag=0, the matrix S obtained by image preprocessing is Change the sign of the pixel value, traverse the matrix S, like , then it does not change The value of like , then The value is changed to its opposite number, and the image is obtained after the traversal is completed. ; When flag=1, no processing is required. That is .
4. A practical chaotic encryption device for medical images based on oblique filling curve, characterized in that: The following steps are involved: Acquisition module: used to acquire the medical image to be processed; A primary preprocessing module: used to perform a primary preprocessing on the medical image to obtain a preprocessed medical image; A key generation module: used to generate a key based on the preprocessed medical image, wherein the key is based on a chaotic map to obtain a chaotic sequence; The process of generating a key based on the preprocessed medical image is as follows: The preprocessed medical image uses a hash algorithm 512 to generate a key; The image obtained by the patient's ID number and image preprocessing P The pixel value is mapped to 0-255 as the input of the SHA-512 algorithm, and a hexadecimal key with a length of 146 is obtained; Convert the 146-bit key to binary digits. One hexadecimal digit equals four binary digits, so the string length becomes 584. Divide the 584-bit binary digits into two groups and then perform an XOR operation to obtain a string of 292-bit binary digits, which will be divided into 4 groups, each with a length of 73, that is, (1) Where: K represents a key, K1, K2, K3 and K4 represent the first group of keys, the second group of keys, the third group of keys and the fourth group of keys; Diffusion module: used to diffuse the pixel values of the preprocessed medical image based on the chaotic sequence to obtain a semi-encrypted image; Secondary preprocessing module: used to perform secondary preprocessing on the semi-ciphertext image to obtain the preprocessed semi-ciphertext image; Scrambling module: used to scramble the pre-processed semi-ciphertext image based on the chaotic sequence, using index scrambling and oblique filling curve scrambling to obtain the encrypted image; The initial value and control parameters of the TLCS chaotic map are determined by the key. Generated by the following formula: (2) (3) in: It means converting the binary number x into a decimal number. Represents K1, K2, K3 and K4; The pixel values of the preprocessed medical image are diffused based on the chaotic sequence to obtain a semi-encrypted image as follows: Step 1: x 1 and μ 1 is the initial value and parameter of TLCS mapping, substitute x 1 and μ 1 Iteration Get the chaotic sequence A , and then transform the chaotic sequence according to equation (4) to obtain the sequence A 1; (4) Where: floor( x ) represents rounding down, where F represents the number of intensity levels; where M is the number of rows of the medical image to be processed, and N is the number of columns of the medical image to be processed; Step 2: Image P It is divided into four parts, respectively P 1. P 2. P 3 and P 4. At the same time, the chaotic matrix A 1 is also divided into four parts, namely A 11 , A 12 , A 13 and A 14 , the size is ; Step 3: According to equation (5-8), P 1. P 2. P 3 and P 4 performs diffusion operation to obtain four diffused images, which are , , and ; (5) (6) (7) (8) Among them: for images, and The range is 2-257, where F Indicates the number of intensity levels; Step 4: Diffuse the four images , , and Splice together to get a semi-ciphertext image ; The preprocessed semi-ciphertext image is based on a chaotic sequence, and uses index scrambling and oblique filling curve scrambling to obtain the encrypted image in the following process: Step 1: x 2 and μ 2 is the initial value and parameter of the chaotic map, iterative The chaotic sequence A2 is obtained; Step 2: Convert the image into a one-dimensional sequence , then according to Sort the index and get the sequence after the index is scrambled ; Step 3: Get Convert to The matrix is then scrambled using an oblique filling curve to obtain the encrypted image.
Citation Information
Patent Citations
Single-round image encryption method based on hybrid chaotic mapping
CN111682932A
Image encryption method based on Y-shaped filling curve and variable-step Josephh traversal
CN112202545A