A reversible hiding method of medical image based on multi-form embedded and attribute-based partition

CN122554581APending Publication Date: 2026-08-11GANSU INST OF POLITICAL SCI & LAW
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-19
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0004]嵌入容量不足:现有加密域可逆信息隐藏方案大多针对8位自然图像设计,当直接应用于16位的DICOM医学图像时,未能充分利用其像素深度高、平滑区域比例大等特点,单位位平面的嵌入容量有限,难以满足大容量病历数据嵌入的实际需求

Benefits of technology

[0102](1)高容量自适应嵌入:本发明提出的扩展型L型块嵌入(ELBE)与结构化区域分解二值块嵌入(SR-IBBE)相结合,配合全零平面直接替换模式,充分挖掘了医学图像预测误差位平面的冗余空间。通过位平面级别的自适应编码选择机制,各类型位平面均能采用最优嵌入方式,整体嵌入容量较现有方案显著提升。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122554581A_ABST
    Figure CN122554581A_ABST
Patent Text Reader

Abstract

The present application relates to the field of cryptography and information hiding technology, and particularly relates to a reversible medical image hiding method based on multi-form embedding and attribute-based decentralization, CP-ABE system initialization, encryption root key generation and key derivation, medical image reading and preprocessing, bit plane embedding capacity analysis and encoding type selection, auxiliary information construction and embedding, inner layer bit plane selective encryption, pixel reconstruction and outer layer encryption, encrypted carrier and embedding key acquisition, outer layer decryption and bit plane decomposition, auxiliary information analysis, secret information embedding in the encrypted domain, pixel reconstruction, outer layer encryption and CP-ABE hybrid protection, CP-ABE decryption and key reconstruction, outer layer decryption and bit plane decomposition, auxiliary information analysis and secret information extraction, bit plane recovery, inner layer decryption, prediction error image reconstruction and MED inverse prediction, and original image lossless recovery verification. The present application can guarantee fine-grained access control and multi-layer encryption protection, and significantly improve the reversible embedding capacity of medical images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of cryptography and information hiding technology, specifically to a reversible hiding method for medical images based on multi-form embedding and attribute-based weighting. It is applicable to scenarios such as medical image privacy protection, remote medical diagnosis, cloud storage security, and judicial evidence collection, which require fine-grained access control, multi-layered encryption protection, and lossless data recovery. Background Technology

[0002] Medical images, as a crucial basis for modern clinical diagnosis, carry patients' physiological and pathological information as well as their personal privacy data. With the deepening of medical informatization, DICOM format medical images face increasingly serious risks of leakage and tampering during transmission within hospital systems, remote consultation sharing, and archiving. Reversible information hiding technology can reversibly embed patient medical records, diagnostic reports, and other private information into the carrier image, allowing authorized recipients to fully extract the hidden information and restore the original image without loss. Combining reversible information hiding with image encryption to form encrypted domain reversible information hiding, which can ensure the confidentiality of medical image content while achieving information embedding and lossless recovery in encrypted form, has become a research hotspot in the field of medical image security.

[0003] However, most existing reversible information hiding schemes in cryptographic fields are designed for 8-bit natural images, and their direct application to 16-bit DICOM medical images presents the following prominent problems:

[0004] Insufficient embedding capacity: Most existing reversible information hiding schemes in encrypted domains are designed for 8-bit natural images. When directly applied to 16-bit DICOM medical images, they fail to fully utilize their characteristics such as high pixel depth and large proportion of smooth areas. The embedding capacity per unit bit plane is limited, making it difficult to meet the actual needs of embedding large-capacity medical record data.

[0005] The embedding strategy is too simplistic: most schemes use fixed block partitioning sizes and uniform encoding rules, and do not differentiate between the sparsity characteristics of different bit planes in medical images, which limits the improvement of overall embedding performance.

[0006] Insufficient security: Some schemes use simple stream cipher encryption with limited key space, which cannot effectively resist brute-force attacks and statistical analysis attacks. Summary of the Invention

[0007] To address the aforementioned issues, this invention proposes a reversible information hiding method for medical images that combines attribute-based encryption, subplane selective encryption, and an adaptive embedding strategy. By constructing a three-layer security architecture of "attribute-based key protection—outer-layer pixel XOR encryption—inner-layer bit-plane selective encryption," and introducing an adaptive combination mechanism of extended L-shaped block embedding and structured region decomposition binary block embedding in the prediction error bit plane, this method significantly improves the reversible embedding capacity of medical images while ensuring fine-grained access control and multi-layer encryption protection.

[0008] A reversible medical image hiding method based on multimorphic embedding and attribute-based weighting includes the following steps:

[0009] Step S1: CP-ABE system initialization

[0010] The content owner runs the Setup algorithm of the CP-ABE system to generate the system public key PK and master key MSK. A set of role attributes for medical scenarios is defined, and corresponding access policies are automatically generated based on the modal information in the DICOM header file of the medical image.

[0011] When generating user private keys using the KeyGen algorithm in CP-ABE, a globally independent random number r is introduced for each user, and an independent random number r is also introduced for each attribute in the user attribute set. j .

[0012] Step S2: Root key generation and key derivation

[0013] Generate a random group element as the root key, denoted as K. root ∈G root GT is the target group of the bilinear group. A secure hash function H is used to hash the root key to obtain a hash digest. A portion of the digest is extracted and used as the master seed. master。 Based on the master seed, an inner-layer cryptographic seed is derived using a deterministic pseudo-random number generator. inner Outer encrypted seed outer and sign bit plane encryption seed sign The pseudo-random number generator is initialized using the seed to generate the bit XOR key matrix K required for the inner encryption layer. bit ∈{0,1} M×N The block scrambling arrangement π, and the 16-bit integer key matrix K required for outer encryption. outer ∈[0,65535] M×N .

[0014] Step S3: Medical Image Reading and Preprocessing

[0015] Read the medical image in DICOM format and extract the pixel array I, which has a size of M×N and a pixel depth of 16 bits.

[0016] A median edge detector is used to predict the edge of each pixel in the original image I. For a target pixel x(i,j) at position (i,j), where 2≤i≤M and 2≤j≤N, its predicted value P(i,j) is jointly determined by the left pixel c=I(i,j-1), the upper pixel b=I(i-1,j), and the upper left pixel a=I(i-1,j-1). ;

[0017] Calculate the prediction error e(i,j) = I(i,j) - P(i,j). Pixels in the first row and first column are not predicted; their original values ​​are retained as the recovery reference.

[0018] The prediction error image is converted into a 16-bit binary representation, generating 16 bit planes Γ1 to Γ16. For each pixel position (i,j), bit plane Γ1... k The value of is defined as: ; ;

[0019] Where Γ1 is the most significant bit plane, Γ 16 This is the sign bit plane. Overflow prediction errors with absolute values ​​exceeding the 15-bit representation range are marked in the location map LM.

[0020] Step S4: Bit-plane embedding capacity analysis and coding type selection

[0021] For the first 15 bit planes, i.e. Γ1 to Γ 15 i, calculate the net embedding capacity under the three embedding methods respectively.

[0022] (1) Zero-plane detection

[0023] Check if the current bit plane is entirely zero. If Γ k If all pixel values ​​are 0, then the plane encoding type is marked as "11", and all M×N bits of the entire plane can be used to embed secret information.

[0024] (2) Calculation of the capacity of the L-shaped block embedded in ELBE

[0025] The M×N bit plane is scanned in 2×6 macroblocks. Each macroblock contains three types of sub-blocks: P1 main block, P2 sub-block, and P3 lateral block. A separate P4 boundary block is set to process the right boundary region of the image. For each sub-block, an embeddability condition is defined: if the index pixel value is 0 or 1, and the surrounding pixels at the other three specific positions are all 0, then the sub-block is an embeddable block and can embed 3 bits of information.

[0026] Construct a binary label graph L, recording the embeddability state of each sub-block, where 0 indicates embeddability and 1 indicates non-embedding. Perform adaptive run-length encoding compression on the label graph, and denot the length of the compressed bitstream as L. rle The formula for calculating the net embedding capacity of ELBE is: ;

[0027] Where N embed This represents the total number of embeddable sub-blocks.

[0028] (3) Calculation of the capacity of SR-IBBE embedded binary blocks of structured domain decomposition

[0029] The bit plane is divided into 8×4 non-overlapping sub-blocks. Each sub-block is further divided into two regions based on pixel position: the boundary region and the core region. For each region, the number of "0"s (b0) and "1"s (b1) are counted, and the number of minority pixels (λ) is set to min(b0, b1).

[0030] The formula for calculating the threshold ω is: ;

[0031] Where S is the number of pixels in the region; μ is the candidate threshold variable; argmax represents the maximum μ value that makes the objective expression non-negative; and based on the relationship between λ and the threshold ω, the net capacity of the region C is... region for: ;

[0032] The total net capacity of the SR-IBBE in this bit plane is the sum of the capacities of the two regions of all sub-blocks: ;

[0033] Among them, C boundary C represents the capacity of the boundary region. core This indicates the capacity of the core area.

[0034] 4) Adaptive encoding type selection

[0035] For the k-th bit plane, k=1,2,…,15, determine its encoding type: ;

[0036] Step S5: Construction and Embedding of Auxiliary Information

[0037] Construct auxiliary information, concatenating it sequentially: the coded bits of the 15 bit planes, the RLE compression length of each ELBE plane, the compressed tag bitstream of all ELBE planes, the total length of the tag stream, the total length of the secret data, and the coordinates of the end of the auxiliary information embedding. Replace the first pixel of the Γ1 bit plane with the concatenated auxiliary information bit by bit, and record the end position of the embedding.

[0038] Step S6: Selective encryption of inner sub-plane

[0039] Alignment plane Γ2 to Γ 15 Perform inner-layer encryption. For bit planes with encoding type "01", block scrambling encryption is used: the bit plane is divided into 8×4 sub-blocks, and the positions of the sub-blocks are scrambled using a random permutation π. This method preserves the pixel correlation within the block. For bit planes with encoding type "11", no encryption is performed. For other types of bit planes, a bit XOR key matrix K is used. bit Perform bit-by-bit encryption: ;

[0040] Bit-by-bit XOR encryption is performed on the 16th bit plane using a separate key: ;

[0041] Among them, Γ k (i,j) represents the encrypted bit-plane pixel value, Γ k (i,j) represents the original bit-plane pixel value, K bit This represents the key bit at the corresponding position in the bit XOR key matrix, where i is the row index, j is the column index, and K is the key bit. sign (i,j) represents the key bit at the corresponding position in the encryption key matrix of the sign bit plane (i.e., the 16th bit plane).

[0042] Step S7: Pixel Reconstruction and Outer Layer Encryption

[0043] Reconstruct the encrypted 16-bit bit plane into a 16-bit pixel image: ;

[0044] Use the outer encryption key matrix K outer Perform pixel-by-pixel XOR encryption: ;

[0045] Among them, I recon (i,j) represents the pixel value reconstructed after plane-level encryption, I enc (i,j) represents the pixel value after outer encryption, K outer (i,j) represents the corresponding key value in the outer encryption key matrix.

[0046] Step S8: Obtain the encryption carrier and embedded key

[0047] Data hiders obtain encrypted carrier images directly from content owners via secure channels. enc and the master seed used to derive the outer encryption key master Or directly obtain the outer key matrix K outer .

[0048] It should be noted that if the actual application scenario requires access control for the data embedder, a hybrid encryption mechanism should be used to encrypt the carrier image I.enc For protection: The content owner generates a random symmetric key K. sym , use it to I enc Encryption is performed, and then the symmetric key K is encrypted using an access policy designed for data hiders via CP-ABE. sym The data hider must first use their attribute private key to decrypt the CP-ABE ciphertext to obtain the K. sym Then decrypt I enc Then, proceed with the subsequent embedding steps.

[0049] Step S9: Outer layer decryption and bit plane decomposition

[0050] Regenerate the outer encryption key matrix K using the derived key. outer , to I enc Perform XOR decryption to obtain a 16-bit pixel image. Decompose the decrypted pixel image into 16 bit planes.

[0051] Step S10: Auxiliary Information Analysis

[0052] Parse the auxiliary information from the Γ1 bit plane according to the format defined in step S5 to obtain the encoding type of each bit plane, the compressed tag map of the ELBE plane, and the total length L of the secret data. secret And the end position of auxiliary information. Decompress the RLE tag map on the ELBE plane and reconstruct the embeddable location mask.

[0053] Step S11: Directly embed secret information into the encrypted field

[0054] According to Γ1 to Γ 15 The embedding is performed in the order specified, according to the encoding type of each bit plane. Let the secret bit sequence to be embedded be S = (s1, s2, ..., S...). Lsecret ).

[0055] For the all-zero plane, the corresponding pixel in the bit plane is directly replaced with the secret bit. For the ELBE plane, each embeddable sub-block is found according to the tag map, and the 3-bit secret information is written to the corresponding pixel position of the sub-block according to the rules. For the SR-IBBE plane, the flag bit, λ value, a few pixel position information, and secret information are written according to the Good block type; for Bad blocks, the first two original bits are collected and appended to the end of the secret information for processing. Planes with no embedding capacity are skipped.

[0056] Step S12: Pixel reconstruction, outer layer encryption, and CP-ABE hybrid protection

[0057] After the data embedder completes the embedding of the secret information, it reconstructs the modified 16 bit planes into a 16-bit pixel image in the same manner as in step S7, and uses the same outer encryption key matrix K as the content owner.outer Perform pixel-by-pixel XOR encryption on the reconstructed image to generate the final steganalyte image I. stego .

[0058] To protect the confidentiality of the final steganographic image during transmission over a public channel and to achieve fine-grained access control, the data embedder further modifies the I... stego Implement hybrid encryption protection independent of the outer encryption layer, as follows:

[0059] (1) Serialization of steganographic images

[0060] The final steganographic image I stego Serialization to byte stream B stego Its byte length is denoted as L=|B stego |

[0061] (2) Symmetric encrypted byte stream

[0062] Use the root key K generated by the content owner and shared with the data hider in step S2. root As a symmetric key, use K. root Extended to a keystream K of the same length as the byte stream stream : ;

[0063] Where Expand(·,·) represents the expansion function that repeatedly concatenates the key to a specified length (L); L represents the target length; for byte stream B stego With key stream K stream Perform a bit-by-bit XOR operation to generate the symmetric ciphertext C. sym : ;

[0064] (3) CP-ABE encryption root key

[0065] Using the CP-ABE public key PK generated by the content owner in step S1, and the access policy determined according to the DICOM image type, the root key K is... root Encryption is performed to obtain the key ciphertext C. abe : ;

[0066] The access policy is pre-defined by the content owner based on the medical image modality; CP_ABE.Encrypt(·,·,·) represents the CP-ABE encryption algorithm, PK is the system public key, and K is the system public key. root The root key to be encrypted;

[0067] (4) Packaging and output

[0068] The key ciphertext Cabe and the symmetric ciphertext C symThe access policy is combined into a structured data packet, which is then serialized to generate the final protected encrypted steganographic image file. .

[0069] This file is transmitted over a public channel, and only authorized recipients whose attributes meet the access policy can decrypt it and obtain the steganographic image.

[0070] Step S13: CP-ABE decryption and key reconstruction

[0071] After the receiving end receives the protected encrypted steganographic image file The CP-ABE decryption process uses its private attribute key SKattr to decrypt the ciphertext Cabe. This scheme implements fine-grained access control here: CP-ABE decryption succeeds only if the receiver's attribute set satisfies the access policy associated with the ciphertext; otherwise, the decryption process terminates, and the receiver cannot obtain any valid information. If the receiver's attributes satisfy the access policy, the root key is successfully recovered. ;

[0072] Where CP_ABE.Decrypt(·,·,·) represents the CP-ABE decryption algorithm, PK is the system public key, and C is the system public key. abe For key ciphertext, SK attr For user attributes private key;

[0073] Subsequently, using the recovered root key K root Generate the key stream K in the same manner as step S12. stream For symmetric ciphertext C sym Perform XOR decryption to recover byte stream B stego , byte stream B stego Deserialization yields the final steganalytic image I. stego Based on K root Regenerate the primary seed using the same derivation method as in step S2. master It then derives the inner encryption seed, outer encryption seed, and sign bit plane encryption seed, and subsequently reconstructs the outer encryption key matrix K. outer Inner layer bit XOR key matrix K bit Block scrambling π and sign bit plane encryption key matrix K sign .

[0074] Step S14: Outer layer decryption and bit plane decomposition

[0075] Using the reconstructed outer encryption key matrix K outer For the final steganalysis image I stego Perform pixel-by-pixel XOR decryption to obtain the decrypted 16-bit pixel image I' recon(i,j) , will I' recon(i,j)Bitwise decomposition into 16 bit planes yields a set of bit planes containing embedded information. }: ;

[0076] Step S15: Auxiliary Information Analysis and Secret Information Extraction

[0077] Parse the auxiliary information from the first few pixels of the Γ̂1 bit plane according to the format defined in step S7. Assume the parsed information includes: the bit plane encoding type Code. k (k=1,…,15), compressed tag map data of the ELBE plane, total length L of secret data secret And the end position of auxiliary information. Decompress the RLE tag map of the ELBE plane marked "00" and reconstruct the embeddable position mask. Then, extract the secret bit sequence S′=(s1′,s2′,…,…) according to the coding type of each bit plane, following the order Γ̂1 to Γ̂15. ) And the original bits of the Bad block, extract the pointer p=1.

[0078] (1) Extraction of the all-zero plane (encoded "11")

[0079] For the all-zero plane Γ̂k, if k=1, start from the next pixel after the end position of the auxiliary information; otherwise, start from the beginning position of the bit plane and extract bits pixel by pixel according to the raster scan order until the required length is reached.

[0080] (2) Extraction of ELBE plane (coded "00")

[0081] According to the reconstructed label map L k Determine the location of each embeddable sub-block. For each embeddable sub-block, extract 3 bits of secret information in the pixel order defined at the time of embedding.

[0082] For images of size M×N, ELBE uses a 2×6 macroblock structure for scanning units, and the label image size is adaptively determined based on the image size. For boundary columns on the right that cannot form a complete 2×6 macroblock, P4 boundary blocks are used for separate processing to ensure that the embedding space of edge regions of any image size can be effectively utilized.

[0083] (3) Extraction of SR-IBBE plane (coded "01")

[0084] For each 8×4 sub-block, the boundary region and the core region are processed separately. The block type is determined by reading the flag bits of the first few pixels of the region, and then the embedded secret bits are extracted.

[0085] The specific rules are as follows:

[0086] If the first two pixels of a region are "10" or "11", then the region is of type Good-I / II (λ=0), and the remaining pixels in the region store secret information, which is extracted sequentially in column priority order. If the first three pixels of a region are "011" or "010", then the region is of type Good-III / IV. Let the first three pixels be (b1, b2, b3), then the minority pixel value is either minority=0 (b3=1) or minority=1 (b3=0). The fourth pixel represents the number of minority pixels λ (1 represents λ=1, 0 represents λ=2). Then λ· Each pixel stores the position information of a few pixels, which is read bit by bit and converted into a position index. The remaining pixels in the region store secret information, which is extracted sequentially. If the first two pixels of a region are "00", the region is of type Bad and does not store secret information, but the first two raw bits of the region (which have been replaced with "00") need to be collected and temporarily stored for subsequent bit plane reconstruction. When the total number of extracted secret bits reaches L... secret Stop extraction when the time is right, and record the bit plane index k of the last secret bit. ∗ Row coordinates r ∗ and column coordinates c ∗ The original bits of the temporarily stored Bad block are separated from the secret bit sequence to obtain the pure secret information S′.

[0087] Step S16: Bit plane recovery

[0088] The bit planes are inversely restored based on the extracted information. All zeros in the zero plane are set to 0. The ELBE plane restores the embedding positions of embeddable sub-blocks to 0 based on the tag map. The SR-IBBE plane restores the original pixel values ​​of the region based on the Good block information, and for Bad blocks, the extracted original pixel values ​​are reverted to their corresponding positions.

[0089] Step S17: Inner Layer Decryption

[0090] Perform inner-layer decryption on the recovered bit plane. Perform inverse scrambling on the SR-IBBE bit plane based on the random permutation of the records. Perform XOR decryption on the other bit planes using the same key matrix. Perform XOR decryption on the 16th bit plane using a separate key.

[0091] Step S18: Image reconstruction of prediction error and MED inverse prediction

[0092] The 16 decrypted bit planes are reconstructed into a prediction error image, the absolute value of which is: ;

[0093] Where |e'(i,j)| represents the absolute value of the recovered prediction error, Γ k(i,j) This represents the decrypted k-th bit-plane pixel value, 2 15−kThis indicates the weight corresponding to this bit plane, where i is the row index and j is the column index;

[0094] The symbol is Γ 16 Decision: If Γ 16 (i,j)=1 then e′(i,j)= -|e′(i,j)|, otherwise e′(i,j)=|e′(i,j)|.

[0095] Perform MED inverse prediction on the image with prediction error, starting from the reference pixels in the first row and first column, and recover the original image pixel values ​​pixel by pixel: ;

[0096] Where P′(i,j) is recalculated from the recovered neighboring pixels according to the MED formula, and e′(i,j) is the recovered prediction error value.

[0097] Step S19: Verification of lossless restoration of the original image

[0098] The recovered image I′ is compared pixel-by-pixel with the original DICOM image I, and the mean square error (MSE) and peak signal-to-noise ratio (PSNR) are calculated. ; .

[0099] Where MSE represents mean square error, M is the number of rows in the image, N is the number of columns in the image, I'(i,j) is the pixel value of the recovered image, and I(i,j) is the pixel value of the original image; PSNR represents peak signal-to-noise ratio in dB, and max(I) represents the maximum possible value of the pixel in the original image.

[0100] Based on the multimorphic distribution characteristics of continuous zero values ​​in the bit plane of medical image prediction error, this invention designs Extended L-shaped Block Embedding (ELBE) and Structured Region Decomposition Binary Block Embedding (SR-IBBE). By combining multi-type decision units and intra-block region decomposition, the embedding capacity per unit bit plane is improved. Simultaneously, an adaptive bit plane encoding mechanism is introduced, enabling each bit plane to automatically select the optimal embedding method based on its own sparsity characteristics, and directly utilizing the all-zero bit plane as the embedding space. In terms of security architecture, this invention integrates CP-ABE attribute-based encryption with sub-plane selective encryption. Using the group elements generated by CP-ABE as the root key, inner and outer encryption keys are derived to construct a multi-layered security protection system, achieving fine-grained access control and lossless data recovery.

[0101] The beneficial effects of the technical solution of this invention are as follows:

[0102] (1) High-capacity adaptive embedding: The extended L-shaped block embedding (ELBE) proposed in this invention is combined with the structured region decomposition binary block embedding (SR-IBBE) and the all-zero plane direct replacement mode to fully exploit the redundancy space of the bit plane of medical image prediction error. Through the bit plane-level adaptive coding selection mechanism, each type of bit plane can adopt the optimal embedding method, and the overall embedding capacity is significantly improved compared with the existing schemes.

[0103] (2) Layered Security and Fine-Grained Access Control: This invention constructs a three-layer security architecture: "CP-ABE key protection—outer layer pixel XOR encryption—inner layer bit-plane selective encryption." The outer layer homogenizes the statistical characteristics of the ciphertext, the inner layer performs block scrambling or differential stream encryption based on the bit-plane type, and the outermost layer implements key protection and attribute-based access control through CP-ABE. This architecture ensures data confidentiality while realizing role-based access control, meeting the multi-role access control requirements of medical scenarios.

[0104] (3) Fully reversible and universally applicable to medical images: The embedding process fully records the information required for recovery, and the receiving end can accurately recover the original bit plane and reconstruct the original image without loss. In view of the characteristics of DICOM images with 16-bit depth and a large proportion of high smoothness region, this invention designs a 16-bit prediction error bit plane and a direct replacement mode of the all-zero plane, and adapts to the edge processing requirements of images with different widths through boundary sub-block design, thereby enhancing the applicability of the solution to various medical images. Attached Figure Description

[0105] Figure 1 is a flowchart of the overall method of the present invention;

[0106] Figure 2 This is a schematic diagram of the ELBE block type and SR_IBBE embedding of the present invention;

[0107] Figure 3 This is a schematic diagram of test images for an embodiment;

[0108] Figure 4 This is a schematic diagram illustrating the encrypted test image and the embedded secret information in an embodiment.

[0109] Figure 5 This is a schematic diagram illustrating the extraction of secret information from a test image and the restoration of the original image in an embodiment. Detailed Implementation

[0110] This invention provides a reversible medical image hiding method based on multimorphic embedding and attribute-based weighting, such as... Figure 1 As shown, the method includes four main stages: system initialization and key generation stage, content owner processing stage, data hider embedding stage, and receiver extraction and recovery stage.

[0111] I. System initialization and key generation phase, including the following steps:

[0112] Step S1: CP-ABE system initialization;

[0113] The content owner runs the Setup algorithm of the CP-ABE system to generate the system public key PK and master key MSK. A set of medical scenario role attributes is defined, including radiologists (attributes: RAD, DOC, L3), CT technicians (attributes: RAD, CT, TEC, L2), MR technicians (attributes: RAD, MR, TEC, L2), ophthalmic computed tomography technicians (attributes: OPT, TEC, L2), etc. The corresponding access policy is automatically generated based on the modal information in the medical image DICOM header file. For example, for MR images, the generated policy is: Policy(MR)=((RAD∧DOC)∨(MR∧TEC));

[0114] It should be noted that when the KeyGen algorithm of CP-ABE generates user private keys, it introduces a globally independent random number r for each user and an independent random number r for each attribute in the user attribute set. j This mechanism ensures that even two users with identical attribute sets (e.g., two radiologists with the same attributes "RAD, DOC, L3") will have mathematically distinct and mutually inverse private keys. This design provides the scheme with strong resistance to collusion attacks and reliable personal audit traceability.

[0115] Step S2: Generating the encryption root key and derivation;

[0116] Generate a random group element as the root key, denoted as K. root ∈G root GT is the target group of the bilinear group. A secure hash function H (such as SHA-256) is used to hash the root key to obtain a hash digest. A portion of the digest is extracted and used as the master seed. master。 Based on the master seed, an inner-layer cryptographic seed is derived using a deterministic pseudo-random number generator. inner Outer encrypted seed outer and sign bit plane encryption seed sign Using the aforementioned seeds, initialize the pseudo-random number generators to generate the bit XOR key matrix K required for inner-layer encryption. bit ∈{0,1} M×N The block scrambling arrangement π, and the 16-bit integer key matrix K required for outer encryption. outer ∈[0,65535] M×N .

[0117] II. The content owner processing stage includes the following steps:

[0118] Step S3: Medical image reading and preprocessing;

[0119] Read the DICOM format medical image and extract pixel array I, which has a size of M×N and a pixel depth of 16 bits. The test image for this example is shown below. Figure 3 As shown.

[0120] A median edge detector is used to predict the edge of each pixel in the original image I. For a target pixel x(i,j) at position (i,j) (where 2≤i≤M, 2≤j≤N), its predicted value P(i,j) is jointly determined by the left pixel c=I(i,j-1), the upper pixel b=I(i-1,j), and the upper left pixel a=I(i-1,j-1): ;

[0121] Calculate the prediction error e(i,j) = I(i,j) - P(i,j). Pixels in the first row and first column are not predicted; their original values ​​are retained as the recovery reference.

[0122] The prediction error image is converted into a 16-bit binary representation, generating 16 bit planes Γ1 to Γ16. For each pixel position (i,j), bit plane Γ1... k The value of is defined as: ; ;

[0123] Where Γ1 is the most significant bit plane, Γ 16 This is the sign bit plane. Overflow prediction errors with absolute values ​​exceeding the 15-bit representation range are marked in the location map LM.

[0124] Step S4: Bit-plane embedding capacity analysis and coding type selection;

[0125] For the first 15 position planes (Γ1 to Γ) 15 ), calculate the net embedding capacity under the three embedding methods respectively.

[0126] (1) Zero-plane detection;

[0127] Check if the current bit plane is entirely zero. If Γ k If all pixel values ​​are 0, then the plane encoding type is marked as "11", and all M×N bits of the entire plane can be used to embed secret information.

[0128] (2) Calculation of the capacity of Extended L-shaped Block Embedding (ELBE);

[0129] like Figure 2The M×N bit plane is scanned in 2×6 macroblocks. Each macroblock contains three types of sub-blocks: P1 main block, P2 sub-block, and P3 lateral block. A separate P4 boundary block is set to handle the right boundary region of the image. For each sub-block, an embeddability condition is defined: if the index pixel value is 0 or 1, and the surrounding pixels at the other three specific positions are all 0, then the sub-block is embeddable and can embed 3 bits of information.

[0130] Construct a binary label graph L, recording the embeddability state of each sub-block (0 indicates embeddability, 1 indicates non-embedding). Perform adaptive run-length encoding compression on the label graph, and denot the length of the compressed bitstream as L. rle The formula for calculating the net embedding capacity of ELBE is: ;

[0131] Where N embed This represents the total number of embeddable sub-blocks.

[0132] (3) Calculation of capacity for Structured Domain Decomposition Binary Block Embedding (SR-IBBE);

[0133] like Figure 2 The bit plane is divided into 8×4 non-overlapping sub-blocks. Each sub-block is further divided into two regions based on pixel position: the boundary region (containing the first, last, and inner pixels of the last row, totaling 18 pixels) and the core region (containing the upper consecutive pixels of the middle column, totaling 14 pixels). For each region, the number of "0"s (b0) and "1"s (b1) are counted, and the number of minority pixels (λ) is set to min(b0, b1).

[0134] The formula for calculating the threshold ω is: ;

[0135] Where S is the number of pixels in the region, μ is the candidate threshold variable, and argmax represents the maximum μ value that makes the target expression non-negative. Based on the relationship between λ and the threshold ω, the net capacity of the region C... region for: ;

[0136] The total net capacity of the SR-IBBE in this bit plane is the sum of the capacities of the two regions of all sub-blocks: ;

[0137] Among them, C boundary C represents the capacity of the boundary region. core Indicates core area capacity

[0138] 4) Adaptive encoding type selection;

[0139] For the k-th bit plane (k=1,2,…,15), determine its encoding type: ;

[0140] Step S5: Construction and embedding of auxiliary information;

[0141] Construct auxiliary information, concatenating it sequentially as follows: coded bits for 15 bit planes (2 bits each, total 30 bits), RLE compression length for each ELBE plane (18 bits each), compressed tag bitstreams for all ELBE planes, total tag stream length (18 bits), total secret data length (22 bits), and auxiliary information embedding end coordinates (9 bits for row coordinates and 9 bits for column coordinates). Replace each bit of the concatenated auxiliary information bit by bit into the first pixel of the Γ1 bit plane, recording the embedding end position.

[0142] Step S6: Selective encryption of inner layer bit plane;

[0143] Alignment plane Γ2 to Γ 15 Perform inner-layer encryption. For bit planes with encoding type "01", block scrambling encryption is used: the bit plane is divided into 8×4 sub-blocks, and the positions of the sub-blocks are scrambled using a random permutation π. This method preserves the pixel correlation within the block. For bit planes with encoding type "11", no encryption is performed. For other types of bit planes, a bit XOR key matrix K is used. bit Perform bit-by-bit encryption: ;

[0144] Bit-by-bit XOR encryption is performed on the 16th bit plane using a separate key: ;

[0145] Among them, Γ k (i,j) represents the encrypted bit-plane pixel value, Γ k (i,j) represents the original bit-plane pixel value, K bit This represents the key bit at the corresponding position in the bit XOR key matrix, where i is the row index, j is the column index, and K is the key bit. sign (i,j) represents the key bit at the corresponding position in the encryption key matrix of the sign bit plane (i.e., the 16th bit plane).

[0146] Step S7: Pixel reconstruction and outer layer encryption;

[0147] Reconstruct the encrypted 16-bit bit plane into a 16-bit pixel image: ;

[0148] Use the outer encryption key matrix K outer Perform pixel-by-pixel XOR encryption: ;

[0149] Among them, I recon (i,j) represents the pixel value reconstructed after plane-level encryption, I enc (i,j) represents the pixel value after outer encryption, Kouter (i,j) represents the corresponding key value in the outer encryption key matrix.

[0150] III. The data hider embedding stage includes the following steps:

[0151] Step S8: Obtain the encryption carrier and the embedded key;

[0152] In the current embodiment of the present invention, the data hider obtains the encrypted carrier image I directly from the content owner via a secure channel. enc and the master seed used to derive the outer encryption key master (or directly obtain the outer key matrix K) outer The data hider can obtain the carrier data required for embedding without CP-ABE decryption, and the embedding process itself does not impose access policy restrictions.

[0153] It should be noted that if the actual application scenario requires access control for data embedders (e.g., only allowing specific data hiders to perform embedding operations), a hybrid encryption mechanism can be used to encrypt the carrier image I. enc For protection: The content owner generates a random symmetric key K. sym , use it to I enc Encryption is performed, and then the symmetric key K is encrypted using an access policy designed for data hiders via CP-ABE. sym The data hider must first use their attribute private key to decrypt the CP-ABE ciphertext to obtain the K. sym Then decrypt I enc Then, subsequent embedding steps can be performed. This extended design can be flexibly enabled according to deployment requirements without affecting the core embedding process of this invention.

[0154] Step S9: Outer layer decryption and bit plane decomposition;

[0155] Regenerate the outer encryption key matrix K using the derived key. outer , to I enc Perform XOR decryption to obtain a 16-bit pixel image. Decompose the decrypted pixel image into 16 bit planes.

[0156] Step S10: Auxiliary information parsing;

[0157] Parse the auxiliary information from the Γ1 bit plane according to the format defined in step S5 to obtain the encoding type of each bit plane, the compressed tag map of the ELBE plane, and the total length L of the secret data. secret And the end position of auxiliary information. Decompress the RLE tag map on the ELBE plane and reconstruct the embeddable location mask.

[0158] Step S11: The secret information is directly embedded in the encrypted field;

[0159] According to Γ1 to Γ 15 The embedding is performed in the order specified, according to the encoding type of each bit plane. Let the secret bit sequence to be embedded be S = (s1, s2, ..., S...). Lsecret For the all-zero plane, the corresponding pixel in the bit plane is directly replaced with the secret bit. For the ELBE plane, each embeddable sub-block is found according to the tag map, and the 3-bit secret information is written to the corresponding pixel position of the sub-block according to the rules. For the SR-IBBE plane, the flag bit, λ value, a few pixel position information, and secret information are written according to the Good block type; for Bad blocks, the first two original bits are collected and appended to the end of the secret information for processing. Planes with no embedding capacity are skipped.

[0160] Step S12: Pixel reconstruction, outer layer encryption, and CP-ABE hybrid protection;

[0161] After the data embedder completes the embedding of the secret information, it reconstructs the modified 16 bit planes into a 16-bit pixel image in the same manner as in step S7, and uses the same outer encryption key matrix K as the content owner. outer Perform pixel-by-pixel XOR encryption on the reconstructed image to generate the final steganalyte image I. stego This step restores the image with embedded secret information to its encrypted state, ensuring consistency in subsequent extraction processes.

[0162] To protect the confidentiality of the final steganographic image during transmission over a public channel and to achieve fine-grained access control, the data embedder further modifies the I... stego Implement hybrid encryption protection independent of the outer encryption layer, as follows:

[0163] (1) Serialize the steganographic image;

[0164] The final steganographic image I stego Serialization to byte stream B stego Its byte length is denoted as L=|B stego |

[0165] (2) Symmetrically encrypted byte stream;

[0166] Use the root key K generated by the content owner and shared with the data hider in step S2. root As a symmetric key, use K. root Extended to a keystream K of the same length as the byte stream stream : ;

[0167] Where Expand(·,·) represents the expansion function that repeatedly concatenates the key to a specified length (L); L represents the target length; for byte stream B stegoWith key stream K stream Perform a bit-by-bit XOR operation to generate the symmetric ciphertext C. sym : ;

[0168] (3) CP-ABE encryption root key;

[0169] Using the CP-ABE public key PK generated by the content owner in step S1, and the access policy determined according to the DICOM image type, the root key K is... root Encryption is performed to obtain the key ciphertext C. abe : ;

[0170] The access policy is pre-defined by the content owner based on the medical image modality; CP_ABE.Encrypt(·,·,·) represents the CP-ABE encryption algorithm, PK is the system public key, and K is the system public key. root The root key to be encrypted;

[0171] (4) Package and output;

[0172] The key ciphertext Cabe and the symmetric ciphertext C sym The access policy is combined into a structured data packet, which is then serialized to generate the final protected encrypted steganographic image file. .

[0173] This file can be transmitted over a public channel. Only authorized recipients whose attributes meet the access policy can decrypt and obtain the steganographic image, thereby extracting secret information and recovering the original image.

[0174] After the image is encrypted and the secret information is embedded, such as Figure 4 As shown.

[0175] IV. The receiving end extraction and recovery stage includes the following steps:

[0176] Step S13: CP-ABE decryption and key reconstruction;

[0177] After the receiving end receives the protected encrypted steganographic image file Using the private key S of the attribute it holds Kattr For key ciphertext C abeDecryption is then performed. This scheme implements fine-grained access control here: CP-ABE decryption succeeds only when the receiver's attribute set satisfies the ciphertext association access policy; otherwise, the decryption process terminates, and the receiver cannot obtain any valid information. This mechanism ensures that different access roles (such as radiologists, CT technicians, MR technicians, etc.) can only access steganographic images matching their attributes, achieving role-based access control. If the receiver's attributes satisfy the access policy, the root key can be successfully recovered. ;

[0178] Where CP_ABE.Decrypt(·,·,·) represents the CP-ABE decryption algorithm, PK is the system public key, and C is the system public key. abe For key ciphertext, SK attr For user attributes private key;

[0179] Subsequently, using the recovered root key K root Generate the key stream K in the same manner as step S12. stream For symmetric ciphertext C sym Perform XOR decryption to recover byte stream B stego , byte stream B stego Deserialization yields the final steganalytic image I. stego Based on K root Regenerate the primary seed using the same derivation method as in step S2. master It then derives the inner encryption seed, outer encryption seed, and sign bit plane encryption seed, and subsequently reconstructs the outer encryption key matrix K. outer Inner layer bit XOR key matrix K bit Block scrambling π and sign bit plane encryption key matrix K sign .

[0180] Step S14: Outer layer decryption and bit plane decomposition;

[0181] Using the reconstructed outer encryption key matrix K outer For the final steganalysis image I stego Perform pixel-by-pixel XOR decryption to obtain the decrypted 16-bit pixel image I' recon(i,j) , will I' recon(i,j) Bitwise decomposition into 16 bit planes yields a set of bit planes containing embedded information. }: ;

[0182] Step S15: Auxiliary Information Analysis and Secret Information Extraction

[0183] Parse the auxiliary information from the first few pixels of the Γ̂1 bit plane according to the format defined in step S7. Assume the parsed information includes: the bit plane encoding type Code.k (k=1,…,15), compressed tag map data of the ELBE plane, total length L of secret data secret And the end position of auxiliary information. Decompress the RLE tag map of the ELBE plane marked "00" and reconstruct the embeddable position mask. Then, extract the secret bit sequence S′=(s1′,s2′,…,…) according to the coding type of each bit plane, following the order Γ̂1 to Γ̂15. ) And the original bits of the Bad block, extract the pointer p=1.

[0184] (1) Extraction of the all-zero plane (encoded "11");

[0185] For the all-zero plane Γ̂k, if k=1, start from the next pixel after the end position of the auxiliary information; otherwise, start from the beginning position of the bit plane and extract bits pixel by pixel according to the raster scan order until the required length is reached.

[0186] (2) Extraction of the ELBE plane (encoded "00");

[0187] According to the reconstructed label map L k The position of each embeddable sub-block is determined. For each embeddable sub-block, 3 bits of secret information are extracted according to the pixel order defined at the time of embedding. The specific shape of each sub-block is shown in the attached drawings. The method of this invention is applicable to carrier images of any size. For an image of size M×N, the ELBE scanning unit adopts a 2×6 macroblock structure, and the tag map size is adaptively determined according to the image size. For boundary columns on the right that cannot form a complete 2×6 macroblock, P4 boundary blocks are used for separate processing to ensure that the embedding space of edge regions of any image size can be effectively utilized.

[0188] (3) Extraction of SR-IBBE plane (encoded "01");

[0189] For each 8×4 sub-block, the boundary region and core region are processed separately. The block type is determined by reading the flag bits of the first few pixels of the region, and then the embedded secret bits are extracted. The specific rules are as follows:

[0190] If the first two pixels of a region are "10" or "11", then the region is of type Good-I / II (λ=0), and the remaining pixels in the region store secret information, which is extracted sequentially in column priority order. If the first three pixels of a region are "011" or "010", then the region is of type Good-III / IV. Let the first three pixels be (b1, b2, b3), then the minority pixel value is either minority=0 (b3=1) or minority=1 (b3=0). The fourth pixel represents the number of minority pixels λ (1 represents λ=1, 0 represents λ=2). Then λ· Each pixel stores the position information of a few pixels, which is read bit by bit and converted into a position index. The remaining pixels in the region store secret information, which is extracted sequentially. If the first two pixels of a region are "00", the region is of type Bad and does not store secret information, but the first two raw bits of the region (which have been replaced with "00") need to be collected and temporarily stored for subsequent bit plane reconstruction. When the total number of extracted secret bits reaches L... secret Stop extraction when the time is right, and record the bit plane index k of the last secret bit. ∗ Row coordinates r ∗ and column coordinates c ∗ The original bits of the temporarily stored Bad block are separated from the secret bit sequence to obtain the pure secret information S′.

[0191] Step S16: Bit plane recovery;

[0192] The bit planes are inversely restored based on the extracted information. All zeros in the zero plane are set to 0. The ELBE plane restores the embedding positions of embeddable sub-blocks to 0 based on the tag map. The SR-IBBE plane restores the original pixel values ​​of the region based on the Good block information, and for Bad blocks, the extracted original pixel values ​​are reverted to their corresponding positions.

[0193] Step S17: Inner layer decryption;

[0194] Perform inner-layer decryption on the recovered bit plane. Perform inverse scrambling on the SR-IBBE bit plane based on the random permutation of the records. Perform XOR decryption on the other bit planes using the same key matrix. Perform XOR decryption on the 16th bit plane using a separate key.

[0195] Step S18: Image reconstruction of prediction error and inverse prediction using MED;

[0196] The 16 decrypted bit planes are reconstructed into a prediction error image, the absolute value of which is: ;

[0197] Where |e'(i,j)| represents the absolute value of the recovered prediction error, Γ k(i,j) This represents the decrypted k-th bit-plane pixel value, 2 15−k This indicates the weight corresponding to this bit plane, where i is the row index and j is the column index;

[0198] The symbol is Γ 16 Decision: If Γ 16 (i,j)=1 then e′(i,j)= -|e′(i,j)|, otherwise e′(i,j)=|e′(i,j)|.

[0199] Perform MED inverse prediction on the image with prediction error, starting from the reference pixels in the first row and first column, and recover the original image pixel values ​​pixel by pixel: ;

[0200] Where P′(i,j) is recalculated from the recovered neighboring pixels according to the MED formula, and e′(i,j) is the recovered prediction error value.

[0201] Step S19: Verification of lossless restoration of the original image;

[0202] The recovered image I′ is compared pixel-by-pixel with the original DICOM image I, and the mean square error (MSE) and peak signal-to-noise ratio (PSNR) are calculated: ; ;

[0203] Where MSE represents mean square error, M is the number of rows in the image, N is the number of columns in the image, I'(i,j) is the pixel value of the recovered image, and I(i,j) is the pixel value of the original image; PSNR represents peak signal-to-noise ratio in dB, and max(I) represents the maximum possible value of the pixel in the original image.

[0204] Test images to extract secret information and restore the original image, such as Figure 5 As shown.

[0205] Verification showed that the MSE of the restored image was 0 and the PSNR was infinite, indicating that the method achieved completely lossless restoration.

Claims

1. A reversible medical image hiding method using multi-morphological embedding and attribute-based weighting, characterized in that, It includes the following steps: Step S1: CP-ABE system initialization; The content owner runs the Setup algorithm of the CP-ABE system to generate the system public key PK and master key MSK; defines a set of role attributes for medical scenarios, and automatically generates corresponding access policies based on the modal information in the DICOM header file of medical images. When generating user private keys using the KeyGen algorithm in CP-ABE, a globally independent random number r is introduced for each user, and an independent random number r is also introduced for each attribute in the user attribute set. j ; Step S2: Generating the encryption root key and derivation; Generate a random group element as the root key, denoted as K. root ∈G root GT is the target group of the bilinear group; the root key is hashed using a secure hash function H to obtain a hash digest; a portion of the digest is extracted as the master seed. master; Based on the master seed, an inner-layer cryptographic seed is derived using a deterministic pseudo-random number generator. inner Outer Encryption Seed outer and sign bit plane encryption seed sign The pseudo-random number generator is initialized using the seed to generate the bit XOR key matrix K required for the inner encryption layer. bit ∈{0,1} M×N The block scrambling arrangement π, and the 16-bit integer key matrix K required for outer encryption. outer ∈[0,65535] M×N ; Step S3: Medical image reading and preprocessing; Read the medical image in DICOM format and extract the pixel array I, which has a size of M×N and a pixel depth of 16 bits; The median edge detector is used to predict the predicted value P(i,j) for each pixel of the original image I; Calculate the prediction error e(i,j)=I(i,j)-P(i,j); the pixels in the first row and first column are not predicted, and their original values ​​are directly retained as the recovery reference; The prediction error image is converted into a 16-bit binary representation, generating 16 bit planes Γ1 to Γ16; Step S4: Bit-plane embedding capacity analysis and coding type selection; For the first 15 bit planes, i.e. Γ1 to Γ 15 i, calculate the net embedding capacity under the three embedding methods respectively; Step S5: Construction and embedding of auxiliary information; Construct auxiliary information and concatenate it in the following order: the coded bits of the 15 bit planes, the RLE compression length of each ELBE plane, the compressed tag bit stream of all ELBE planes, the total length of the tag stream, the total length of the secret data, and the coordinates of the end of the auxiliary information embedding; replace the concatenated auxiliary information bit by bit into the first pixel of the Γ1 bit plane and record the end of the embedding position. Step S6: Selective encryption of inner layer bit plane; Alignment plane Γ2 to Γ 15 Perform inner encryption; Step S7: Pixel reconstruction and outer layer encryption; Reconstruct the encrypted 16-bit bit plane into a 16-bit pixel image: using the outer encryption key matrix K. outer Perform pixel-by-pixel XOR encryption: Step S8: Obtain the encryption carrier and the embedded key; Data hiders obtain encrypted carrier images directly from content owners via secure channels. enc and the master seed used to derive the outer encryption key master Or directly obtain the outer key matrix K outer ; Step S9: Outer layer decryption and bit plane decomposition; The outer encryption key matrix K is regenerated using the derived key. outer , to I enc Perform XOR decryption to obtain a 16-bit pixel image; decompose the decrypted pixel image into 16 bit planes; Step S10: Auxiliary information parsing; Parse the auxiliary information from the Γ1 bit plane according to the format defined in step S5 to obtain the encoding type of each bit plane, the compressed tag map of the ELBE plane, and the total length L of the secret data. secret And the end position of auxiliary information; decompress the RLE label map of the ELBE plane and reconstruct the embeddable position mask; Step S11: The secret information is directly embedded in the encrypted field; According to Γ1 to Γ 15 The embedding is performed in the order of the bits, according to the encoding type of each bit plane; let the secret bit sequence to be embedded be S=(s1,s2,…,S…). Lsecret ); Step S12: Pixel reconstruction, outer layer encryption, and CP-ABE hybrid protection; After the data embedder completes the embedding of the secret information, it reconstructs the modified 16 bit planes into a 16-bit pixel image in the same manner as in step S7, and uses the same outer encryption key matrix K as the content owner. outer Perform pixel-by-pixel XOR encryption on the reconstructed image to generate the final steganalyte image I. stego ; To protect the confidentiality of the final steganographic image during transmission over a public channel and to achieve fine-grained access control, the data embedder modifies the I... stego Implement hybrid encryption protection independent of the outer encryption layer; Step S13: CP-ABE decryption and key reconstruction; After the receiving end receives the protected encrypted steganographic image file It uses its private attribute key SKattr to decrypt the key ciphertext Cabe; Step S14: Outer layer decryption and bit plane decomposition; Using the reconstructed outer encryption key matrix K outer For the final steganalysis image I stego Perform pixel-by-pixel XOR decryption to obtain the decrypted 16-bit pixel image I' recon(i,j) , will I' recon(i,j) The bits are decomposed into 16 bit planes to obtain a set of bit planes containing embedded information; Step S15: Auxiliary information analysis and secret information extraction; Parse auxiliary information from the front pixels of the Γ̂1 bit plane according to the format defined in step S7; Step S16: Bit plane recovery; The bit plane is inversely recovered based on the extracted information; the entire zero plane is set to 0. The ELBE plane restores the embedding position of the embeddable sub-block to 0 based on the label map; the SR-IBBE plane restores the original pixel value of the region based on the Good block information, and for the Bad block, it restores the extracted original pixel value to the corresponding position. Step S17: Inner layer decryption; Perform inner-layer decryption on the recovered bit plane; perform inverse scrambling on the SR-IBBE bit plane according to the random arrangement of the records; perform XOR decryption on the other bit planes using the same key matrix; perform XOR decryption on the 16th bit plane using an independent key; Step S18: Image reconstruction of prediction error and inverse prediction using MED; Step S19: Verification of lossless restoration of the original image.

2. The medical image reversible hiding method based on multimorphic embedding and attribute-based weighting according to claim 1, characterized in that, Step S3 uses a median edge detector to predict each pixel of the original image I. Specifically, for the target pixel x(i,j) at position (i,j), where 2≤i≤M and 2≤j≤N, its predicted value P(i,j) is jointly determined by the left pixel c=I(i,j-1), the upper pixel b=I(i-1,j), and the upper left pixel a=I(i-1,j-1). ; The prediction error image is converted into a 16-bit binary representation. Specifically, for each pixel position (i,j), the bit plane Γ... k The value of is defined as: ; ; Where Γ1 is the most significant bit plane, Γ 16 For the sign bit plane; overflow prediction errors with absolute values ​​exceeding the 15-bit representation range are marked in the location map LM.

3. The medical image reversible hiding method based on multimorphic embedding and attribute-based weighting according to claim 2, characterized in that, The specific method for step S4 is as follows: (1) Zero-plane detection Check if the current bit plane is entirely zero; if Γ k If all pixel values ​​are 0, then the plane encoding type is marked as "11", and all M×N bits of the entire plane can be used to embed secret information; (2) Calculation of the capacity of the L-shaped block embedded in ELBE The bit plane of size M×N is scanned in units of 2×6 macroblocks; each macroblock contains three types of subblocks: P1 main block, P2 subblock, and P3 horizontal block, and P4 boundary block is set independently to process the right boundary region of the image; for each subblock, its embeddability condition is defined: if the index pixel value is 0 or 1, and the surrounding pixels at the other three specific positions are all 0, then the subblock is an embeddable block and can embed 3 bits of information. Construct a binary label graph L, recording the embeddability state of each sub-block, where 0 indicates embeddability and 1 indicates non-embedding. Perform adaptive run-length encoding compression on the label graph, and denot the length of the compressed bitstream as L. rle The formula for calculating the net embedding capacity of ELBE is: ; Where N embed This represents the total number of embeddable sub-blocks. (3) Calculation of the capacity of structured domain decomposition binary block embedding SR-IBBE Divide the bit plane into 8×4 non-overlapping sub-blocks; each sub-block is decomposed into two regions according to pixel position: the boundary region and the core region; count the number of "0"s b0 and the number of "1"s b1 in each region respectively, and let the number of minority pixels λ=min(b0,b1); The formula for calculating the threshold ω is: ; Where S is the number of pixels in the region; μ is the candidate threshold variable; argmax represents the maximum μ value that makes the objective expression non-negative; and based on the relationship between λ and the threshold ω, the net capacity of the region C is... region for: ; The total net capacity of the SR-IBBE in this bit plane is the sum of the capacities of the two regions of all sub-blocks: ; Among them, C boundary C represents the capacity of the boundary region. core Indicates the capacity of the core area; 4) Adaptive encoding type selection For the k-th bit plane, k=1,2,…,15, determine its encoding type: 。 4. The medical image reversible hiding method based on multimorphic embedding and attribute-based weighting according to claim 3, characterized in that, In step S6, the alignment planes Γ2 to Γ 15 The specific method for performing inner-layer encryption is as follows: For bit planes with encoding type "01", block scrambling encryption is used: the bit plane is divided into 8×4 sub-blocks, and the positions of the sub-blocks are scrambled using a random permutation π. This method preserves the pixel correlation within the block; for bit planes with encoding type "11", no encryption is performed; for other types of bit planes, a bit XOR key matrix K is used. bit Perform bit-by-bit encryption: ; Bit-by-bit XOR encryption is performed on the 16th bit plane using a separate key: , Among them, Γ k (i,j) represents the encrypted bit-plane pixel value, Γ k (i,j) represents the original bit-plane pixel value, K bit This represents the key bit at the corresponding position in the bit XOR key matrix, where i is the row index, j is the column index, and K is the key bit. sign (i,j) represents the key bit at the corresponding position in the symbol bit plane, i.e., the 16th bit plane encryption key matrix.

5. The medical image reversible hiding method based on multimorphic embedding and attribute-based weighting according to claim 4, characterized in that, The specific method for step S7 is as follows: Reconstruct the encrypted 16-bit bit plane into a 16-bit pixel image: ; Use the outer encryption key matrix K outer Perform pixel-by-pixel XOR encryption: , Among them, I recon (i,j) represents the pixel value reconstructed after plane-level encryption, I enc (i,j) represents the pixel value after outer encryption, K outer (i,j) represents the corresponding key value in the outer encryption key matrix.

6. The medical image reversible hiding method based on multimorphic embedding and attribute-based weighting according to claim 5, characterized in that, In step S12, for I stego Implement hybrid encryption protection independent of the outer encryption layer, as follows: (1) Serialization of steganographic images The final steganographic image I stego Serialization to byte stream B stego Its byte length is denoted as L=|B stego |; (2) Symmetric encrypted byte stream Use the root key K generated by the content owner and shared with the data hider in step S2. root As a symmetric key; use K root Extended to a keystream K of the same length as the byte stream stream : ; Where Expand(·,·) represents the expansion function that repeatedly concatenates the key to a specified length L; L represents the target length; for byte stream B stego With key stream K stream Perform a bit-by-bit XOR operation to generate the symmetric ciphertext C. sym : ; (3) CP-ABE encryption root key Using the CP-ABE public key PK generated by the content owner in step S1, and the access policy determined according to the DICOM image type, the root key K is... root Encryption is performed to obtain the key ciphertext C. abe : ; The access policy is pre-defined by the content owner based on the medical image modality; CP_ABE.Encrypt(·,·,·) represents the CP-ABE encryption algorithm, PK is the system public key, and K is the system public key. root The root key to be encrypted; (4) Packaging and output The key ciphertext Cabe and the symmetric ciphertext C sym The access policy is combined into a structured data packet, which is then serialized to generate the final protected encrypted steganographic image file. ; This file is transmitted over a public channel, and only authorized recipients whose attributes meet the access policy can decrypt it and obtain the steganographic image.

7. The medical image reversible hiding method based on multimorphic embedding and attribute-based weighting according to claim 6, characterized in that, Step S13 implements fine-grained access control: CP-ABE decryption succeeds only when the receiver's attribute set satisfies the ciphertext association access policy; otherwise, the decryption process terminates, and the receiver cannot obtain any valid information. If the receiver's attributes satisfy the access policy, the root key is successfully recovered. ; Where CP_ABE.Decrypt(·,·,·) represents the CP-ABE decryption algorithm, PK is the system public key, and C is the system public key. abe For key ciphertext, SK attr For user attributes private key; Subsequently, using the recovered root key K root Generate the key stream K in the same manner as step S12. stream For symmetric ciphertext C sym Perform XOR decryption to recover byte stream B stego , byte stream B stego Deserialization yields the final steganalyte image I. stego Based on K root Regenerate the primary seed using the same derivation method as in step S2. master It then derives the inner encryption seed, outer encryption seed, and sign bit plane encryption seed, and subsequently reconstructs the outer encryption key matrix K. outer Inner layer bit XOR key matrix K bit Block scrambling π and sign bit plane encryption key matrix K sign .

8. The medical image reversible hiding method based on multimorphic embedding and attribute-based weighting according to claim 7, characterized in that, The specific method for step S15 is as follows: Parse the auxiliary information from the first pixels of the Γ̂1 bit plane according to the format defined in step S7; assuming the parsed information includes: the bit plane encoding type Code. k ELBE plane compressed label map data, secret data total length L secret And the auxiliary information end position, k=1,…,15; decompress the RLE tag map of the ELBE plane marked "00" and reconstruct the embeddable position mask; then, extract the secret bit sequence S′=(s1′,s2′,…, Γ̂1 to Γ̂15 according to the encoding type of each bit plane. ) And the original bits of the Bad block, extract pointer p=1; (1) Extraction of the all-zero plane, i.e., the code "11"i For the all-zero plane Γ̂k, if k=1, start from the next pixel after the end position of the auxiliary information; otherwise, start from the beginning position of the bit plane and extract bits pixel by pixel according to the raster scan order until the required length is reached. (2) Extraction of ELBE plane encoding "00"i According to the reconstructed label map L k Determine the position of each embeddable sub-block; for each embeddable sub-block, extract 3 bits of secret information in the pixel order defined at the time of embedding; For images of size M×N, ELBE uses a 2×6 macroblock structure for scanning units, and the label image size is adaptively determined based on the image size. For the boundary columns on the right that cannot form a complete 2×6 macroblock, P4 boundary blocks are used for separate processing to ensure that the embedding space of the edge region of an image of any size can be effectively utilized. (3) Extraction of SR-IBBE plane code "01"i For each 8×4 sub-block, the boundary region and the core region are processed separately; the block type is determined by reading the flag bits of the first few pixels of the region, and then the embedded secret bits are extracted. The specific rules are as follows: If the first two pixels of a region are "10" or "11", then the region is of type Good-I / II, λ=0, and the remaining pixels in the region store secret information, which is extracted sequentially in column priority order; if the first three pixels of a region are "011" or "010", then the region is of type Good-III / IV; let the first three pixels be (b1,b2,b3), then the minority pixel values ​​are either minority=0, b3=1 or minority=1, b3=0; the fourth pixel represents the number of minority pixels λ, where 1 represents λ=1 and 0 represents λ=2; subsequently λ· Each pixel stores the position information of a few pixels, which is read bit by bit and converted into a position index; the remaining pixels in the region store secret information, which is extracted sequentially; if the first two pixels of a region are "00", then the region is of type Bad and does not store secret information, but the first two original bits of the region, which have been replaced with "00", need to be collected and temporarily stored for subsequent bit plane recovery; when the total number of extracted secret bits reaches L secret Stop extraction when the time is right, and record the bit plane index k of the last secret bit. ∗ Row coordinates r ∗ and column coordinates c ∗ Separate the original bits of the temporarily stored Bad block from the secret bit sequence to obtain the pure secret information S′.

9. The medical image reversible hiding method based on multimorphic embedding and attribute-based weighting according to claim 8, characterized in that, The specific method for step S18 is as follows: The 16 decrypted bit planes are reconstructed into a prediction error image, the absolute value of which is: ; Where |e'(i,j)| represents the absolute value of the recovered prediction error, Γ k(i,j) This represents the decrypted k-th bit-plane pixel value, 2 15-k This indicates the weight corresponding to this bit plane, where i is the row index and j is the column index; The symbol is Γ 16 Decision: If Γ 16 (i,j)=1 then e′(i,j)= -|e′(i,j)|, otherwise e′(i,j)=|e′(i,j)|; Perform MED inverse prediction on the image with prediction error, starting from the reference pixels in the first row and first column, and recover the original image pixel values ​​pixel by pixel: ; Where P′(i,j) is recalculated from the recovered neighboring pixels according to the MED formula, and e′(i,j) is the recovered prediction error value.

10. The reversible medical image hiding method based on multimorphic embedding and attribute-based weighting according to claim 9, characterized in that, The specific method for step S19 is as follows: The recovered image I′ is compared pixel-by-pixel with the original DICOM image I, and the mean square error (MSE) and peak signal-to-noise ratio (PSNR) are calculated. ; , Where MSE represents mean square error, M is the number of rows in the image, N is the number of columns in the image, I'(i,j) is the pixel value of the recovered image, and I(i,j) is the pixel value of the original image; PSNR represents peak signal-to-noise ratio in dB, and max(I) represents the maximum possible value of the pixel in the original image.