Nothing Special   »   [go: up one dir, main page]

CN115348361B - Encryption image reversible data encryption and decryption method based on multi-MSB block coding - Google Patents

Encryption image reversible data encryption and decryption method based on multi-MSB block coding Download PDF

Info

Publication number
CN115348361B
CN115348361B CN202210995169.XA CN202210995169A CN115348361B CN 115348361 B CN115348361 B CN 115348361B CN 202210995169 A CN202210995169 A CN 202210995169A CN 115348361 B CN115348361 B CN 115348361B
Authority
CN
China
Prior art keywords
block
data
image
pixels
bit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210995169.XA
Other languages
Chinese (zh)
Other versions
CN115348361A (en
Inventor
隋连升
韩凯峰
肖照林
王战敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xian University of Technology
Original Assignee
Xian University of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xian University of Technology filed Critical Xian University of Technology
Priority to CN202210995169.XA priority Critical patent/CN115348361B/en
Publication of CN115348361A publication Critical patent/CN115348361A/en
Application granted granted Critical
Publication of CN115348361B publication Critical patent/CN115348361B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/32Circuits or arrangements for control or supervision between transmitter and receiver or between image input and image output device, e.g. between a still-image camera and its memory or between a still-image camera and a printer device
    • H04N1/32101Display, printing, storage or transmission of additional information, e.g. ID code, date and time or title
    • H04N1/32144Display, printing, storage or transmission of additional information, e.g. ID code, date and time or title embedded in the image data, i.e. enclosed or integrated in the image, e.g. watermark, super-imposed logo or stamp
    • H04N1/32149Methods relating to embedding, encoding, decoding, detection or retrieval operations
    • H04N1/32347Reversible embedding, i.e. lossless, invertible, erasable, removable or distorsion-free embedding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/001Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using chaotic signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/32Circuits or arrangements for control or supervision between transmitter and receiver or between image input and image output device, e.g. between a still-image camera and its memory or between a still-image camera and a printer device
    • H04N1/32101Display, printing, storage or transmission of additional information, e.g. ID code, date and time or title
    • H04N1/32144Display, printing, storage or transmission of additional information, e.g. ID code, date and time or title embedded in the image data, i.e. enclosed or integrated in the image, e.g. watermark, super-imposed logo or stamp
    • H04N1/32149Methods relating to embedding, encoding, decoding, detection or retrieval operations
    • H04N1/32267Methods relating to embedding, encoding, decoding, detection or retrieval operations combined with processing of the image
    • H04N1/32272Encryption or ciphering
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Facsimile Transmission Control (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses an encryption image reversible data encryption method based on multi-MSB block coding, which comprises the following steps: partitioning an image; encrypting to obtain an encrypted image; dividing an encrypted image into a flat sliding block and a rough block to generate a position diagram; compressing after block coding to generate auxiliary data; embedding the auxiliary data in the encrypted image; and encrypting the embedded data to obtain secret data, and storing the secret data in an encrypted image to obtain a secret-loaded image. The invention also discloses a decryption method for the encryption method, which comprises the following steps: extracting and recovering auxiliary data; restoring the remaining auxiliary data; extracting and recovering the secret data; decrypting the embedded data using the key; restoring smooth block data; recovering the rough block data; decryption processing; an original image is obtained. The method solves the problems of low data embedding rate and low algorithm security in the prior art.

Description

Encryption image reversible data encryption and decryption method based on multi-MSB block coding
Technical Field
The invention belongs to the technical field of image processing, relates to an encrypted image reversible data encryption method based on multi-MSB block coding, and further relates to a decryption method for the encrypted image reversible data encryption method based on multi-MSB block coding.
Background
In the big data age today, cloud storage technology and social media networks have matured day by day, with digital images carrying huge amounts of information being one of the main ways of information dissemination. But the digital image that propagates over the common channel in the network is not secure and would cause significant loss if intercepted by an unauthorized person. Privacy collection of personal identity information is as small as important safety problems in the fields of national defense science and technology, medical treatment, national confidentiality and the like, and the safety of digital image content must be provided with reliable guarantee means to prevent unauthorized personnel from stealing. Early on, students were proposing solutions to this problem to reversible data hiding. Currently, much research has been devoted to reversible data hiding methods, and the embedding mechanism thereof can be largely divided into three categories, namely histogram shifting, difference expansion and lossless compression. Although the reversible data hiding technology is quite mature at present, the embedding rate is still not high, and the algorithm security is also poor.
Disclosure of Invention
The invention aims to provide an encrypted image reversible data encryption method based on multi-MSB block coding, which solves the problems of low data embedding rate and low algorithm security in the prior art.
The invention also provides a decryption method of the encryption method.
The technical scheme adopted by the invention is that the method for encrypting the reversible data of the encrypted image based on multi-MSB block coding comprises the following steps:
step 1, an original image I with M multiplied by N size is obtained o Dividing into m non-overlapping blocks with n multiplied by n;
step 2, generating an image encryption key K e K is obtained by adopting a Runge-Kutta method e Inputting the image into a logic-logic cascading chaotic system to generate a chaotic sequence, and taking the block as a unit to obtain an original image I o Encryption processing is carried out to obtain an encrypted image I e
Step 3, encrypting the image I e Dividing m non-overlapping blocks into a flat sliding block and a rough block, and generating a position diagram L to mark each block as a smooth block or a rough block;
and 4, adopting multi-MSB block coding to respectively execute different compression processes on the flat sliding block and the rough block, and simultaneously generating necessary auxiliary data, wherein the method comprises the following steps of: huffman coding Rule, label graph tau and reference pixel Ref;
step 5, embedding all the auxiliary data generated in step 4 into the encrypted image I in sequence e In (a) and (b);
step 6, hiding the secret key K by using the data h Encrypting the embedded data d to obtain secret data d e Will secret data d e The encrypted image I stored in step 5 e In the remaining embeddable position of (2) to obtain a secret image I carrying secret data ew
m=m×n/N in step 1 2 Original imageI o The lowest bit plane raw data of all pixels is used with a binary sequence L sb And (5) preserving.
In the step 2, the logics-logics cascading chaotic system is expressed as follows:
in the cascade chaotic system, Z n 、φ 1 、φ 2 As the system parameter, n is the iteration number of the chaotic system, when Z n ∈[0,1],φ 1 ∈[3.5699456,4],φ 2 ∈[3.5699456,4]When the system is in a chaotic state; initializing a logic-logic cascading chaotic system, and adding Z n Give a number of 0-1]Arbitrary value, phi 1 Give [0-4 ]]Arbitrary value, phi 2 Also give [0-4 ]]Any numerical value between the two, and generates a long enough cascading chaotic sequence x c Generated chaotic sequence x c The chaos value interval of the sequence is limited to 0-255]。
In the step 2, the encryption method of the encryption processing is as follows: from a cascading chaotic sequence x c A sub-chaotic sequence X with the length of m is taken out 1 For scrambling the original image I o The positions of m non-overlapping blocks in the frame are used for realizing primary encryption; from a cascading chaotic sequence x c Taking out a sub-chaos sequence X with length of MxN 2 Intra-block n of each block is performed in minimum units of blocks 2 Scrambling among pixels to realize secondary encryption; from a cascading chaotic sequence x c Taking out a sub-chaos sequence X with length of m 3 Each block corresponds to X 3 And performing exclusive OR operation on all pixels in the block and the chaotic value to realize three times of encryption.
In the step 3, the concrete method for dividing the flat sliding block and the rough block comprises the following steps: dividing the block into a smooth block and a rough block according to the correlation of a plurality of most significant bits of pixels in the block, wherein the specific steps are as follows: first, the encrypted image I e The pixel p in each block is converted to binary form using equation (7):
taking out a bit of all pixels in a block, namely a bit plane of the block, wherein the bit plane of the uppermost layer of the block is composed of the most significant bits of all pixels in the block, and is marked as E 1 Subsequent bits will be sequentially noted as E 2 -E 8
If the most significant bit plane E of the block 1 Not all zeros or ones, the block is a coarse block; if the most significant bit plane E of the block 1 All zeros or ones, the block is a flat slide of type I, if the block has a most significant bit plane E 1 And the second highest level E 2 All zero or all one, then the block is a type ii flat block, and so on, the smooth block is determined to be a type I block to a type VII block.
In step 3, the method for generating the position map L includes:
the flat slider is marked by '1', and the rough block is marked by '0', so that the length of the position diagram is m bits, and the binary position diagram L is generated by the following formula:
in step 4, after classifying the smooth blocks, the front x= {1,2,3,4,5,6,7} bit planes of each flat slider are compressed by bit substitution for embedding additional data, and the larger the smooth block type, the larger the number of bit planes available for embedding, the more MSB block coding is performed on the rough block, which is as follows:
first, an encrypted image I is calculated e The prediction rule of the prediction value of the coarse block pixels is as follows:
(1) first row first column pixel I e The predictive value of (1, 1) is itself;
(2) if the current pixel is in the first row, the value of the left adjacent pixel is the predicted value;
(3) if the current pixel is in the first column, the value of the adjacent pixel above the current pixel is the predicted value of the current pixel;
(4) for other coarse block pixels I e (i, j) the predicted value of which is calculated by using the MED median edge detection method, and the calculation formula is as follows:
wherein a=i e (i-1,j-1),b=I e (i,j-1),c=I e (i-1,j),Is I e And (i, j) the corresponding predicted value. Next, the original value and the predicted value are converted into two 8-bit binary sequences, respectively, using the following formulas:
wherein P is k (i, j) andrespectively binary sequences corresponding to the original value and the predicted value. Comparing the two sequences from the most significant bit MSB to the least significant bit LSB until a certain bit is different; the tag value epsilon is then used to mark how many bits are the same between the original value and the predicted value sequence from MSB to LSB, and the calculation formula is as follows:
the first 7 bits of the two sequences are taken for processing, and the first row and first column pixels I in the image are corrected e (1, 1) storing the reference pixel Ref as a unique reference pixel, scanning all rough block pixels, and processing the rough block pixels through the steps to obtain a label graph tau corresponding to all the rough block pixels;
the label value epsilon has eight values, namely {0,1,2,3,4,5,6,7}, and 8 Huffman codes are correspondingly defined to represent the eight label values, namely { "00", "01", "100", "101", "1100", "1101", "1110", "1111" }; calculating the number of different types of tag values through a tag graph tau, sequencing the eight types of tags according to the occurrence frequency of the eight types of tags from high to low, and sequentially distributing 8 Huffman codes; the Huffman coding Rule composed of 8 Huffman codes is a part of auxiliary data;
the length of the Huffman encoded tag map τ may be calculated by the following equation:
wherein n is t Representing the number of pixels with a label value t in the coarse block, c t Representing the length of the corresponding huffman code.
In step 5, auxiliary data is embedded in I of the encrypted image e The method comprises the following specific steps:
step 5.1 calculating the Length Len of all auxiliary data aux Stored with 20 bits and placed in the header of the entire auxiliary data sequence to form a long binary auxiliary data sequence;
step 5.2 embedding the header portion of the binary auxiliary sequence into the encrypted image I by means of bit substitution e Is the lowest in the plane;
step 5.3 embedding data in the block:
for data embedding of pixels in a flat slider, corresponding flag information is stored in the most significant bit plane of its smooth block according to the type of its smooth block. The type of the flat slider is marked by using seven 3bits code words of { "001", "010", "011", "100", "101", "110", "111" }, then the original all-zero or all-one data in the flat slider is stored in sequence, and the rest part is used for embedding the rest auxiliary data in a bit substitution mode;
for data embedding of pixels in a rough block, an encrypted image I is set e The label value of the coarse pixel in (a) is epsilon, which means that the current coarse pixel can be embedded(ε+1) bits.
The technical scheme adopted by the invention is also an encryption image reversible data decryption method based on multi-MSB block coding, which comprises the following steps:
step 1, a carried dense image I ew Extracting all auxiliary data in the least significant bit plane, and sequentially recovering to obtain: auxiliary data length Len aux Huffman coding Rule, reference pixel Ref and position diagram L;
step 2, according to the extracted auxiliary data content, the encrypted image I is guided ew Extracting embedded data in the middle flat sliding block, and recovering residual auxiliary data according to the extracted data: tag map τ, original map least significant bit plane raw data L sb multi-MSB original data in the peaked slider;
step 3, guiding the carried image I according to the extracted auxiliary data content ew The embedded data in the coarse block is extracted and the whole secret data d is restored e
Step 4, utilizing the data hiding secret key to hide the secret data d e Decrypting to obtain decrypted embedded data;
step 5, reversely using the thought of multi-MSB block coding to recover the data in the flat sliding block;
step 6, recovering the data in all the rough blocks according to Huffman coding Rule, reference pixel Ref, label graph tau and position graph L;
step 7, encrypting the secret key K by using the image e And (3) combining the logics-logics cascading chaotic system, and decrypting the image obtained after the processing in the step (6) by taking the block as a unit;
step 8, the original image least significant bit plane original data L sb The data in the image is correspondingly put back to the least significant bit surface of the image processed in the step 7 one by one to obtain an original image I o
In step 5, the specific steps of recovering the data in the flat slider are as follows: the type of the flat sliding block is known according to the three previous data in the most significant bit of the flat sliding block, and the next few data are the original data of the flat sliding block from the most significant bit surface to the least significant bit surface which can be embedded, and the original data are directly covered.
In step 6, the specific steps of recovering the data in the rough block are as follows: firstly, the original pixel data of the first row and the first column are calculated by referring to the pixels, then the predicted values of all the pixels are calculated by an MED median detection method, then the front epsilon+1 bit of each rough pixel in the label graph can be known to be modified according to the label value corresponding to the rough pixel, and the front epsilon bit of the rough pixel is completely the same as the front epsilon bit of the predicted value, so that the original pixel data can be recovered directly through the coverage of the front epsilon bit of the predicted value, and similarly, the epsilon+1 bit of the rough pixel can be recovered through the inversion of the epsilon+1 bit of the predicted value.
The invention has the beneficial effects that:
the invention provides an encryption and decryption method for reversible data of an encrypted image based on multi-MSB block coding, which provides a scheme of multi-MSB block coding, wherein an original image is firstly divided into a plurality of small blocks with equal size, then all the blocks are divided into two main types of smooth blocks and rough blocks according to correlation analysis of pixels in the blocks, then image encryption is carried out by a chaotic system, the correlation of the pixels in the blocks is reserved, meanwhile, the safety of the image is greatly improved, and a flat sliding block and the rough blocks are respectively encoded and compressed by the multi-MSB block coding to vacate additional embeddable space to accommodate necessary auxiliary data and secret data. Finally, after the receiver takes the secret image, the secret data can be extracted and decrypted only by having the corresponding secret key, and meanwhile, the lossless recovery of the original image can be realized.
Drawings
FIG. 1 is a flow chart of the method for reversible data encryption and decryption of an encrypted image based on multi-MSB block coding of the present invention;
FIG. 2 is a block bit-plane analysis diagram of the method for encrypting and decrypting encrypted image reversible data based on multi-MSB block coding of the present invention;
FIG. 3 is a block explanatory diagram of an encryption image reversible data encryption and decryption method based on multi MSB block coding of the present invention;
FIG. 4 is an exemplary diagram of coarse pixel tag value generation for a reversible data encryption and decryption method for an encrypted image based on multi-MSB block encoding in accordance with the present invention;
FIG. 5 is a standard test Lena diagram of the method for encrypting and decrypting encrypted image reversible data based on multi-MSB block coding of the present invention;
FIG. 6 is a diagram of an auxiliary data structure of an encrypted image reversible data encryption and decryption method based on multi-MSB block coding according to the present invention;
FIG. 7 is a diagram of an example of smooth block embedding of the method for reversible data encryption and decryption of an encrypted image based on multi-MSB block coding according to the present invention;
FIG. 8 is a diagram of an example of coarse pixel embedding additional data for the method of reversible data encryption and decryption of an encrypted image based on multi-MSB block coding of the present invention;
FIG. 9 is a graph showing the comparison of the experimental results of the embedding rate of the method for encrypting and decrypting the reversible data of the encrypted image based on multi-MSB block coding;
Detailed Description
The present invention will be described in detail with reference to specific examples.
The whole flow chart of the encryption image reversible data encryption method based on multi MSB block coding is shown in fig. 1, and the method comprises the following steps:
step 1, first, an original image I with M multiplied by N size is obtained o Divided into M non-overlapping blocks of size n×n, where m=m×n/N 2 At the same time add it I o The lowest bit plane raw data of all pixels in the array is used as a binary sequence L sb Storing;
step 2, generating an image encryption key K e K is obtained by adopting a Runge-Kutta method e And inputting the images into a logics-logics cascading chaotic system to generate a chaotic sequence which is long enough to encrypt the original images. The logics-logics cascading chaotic system can be expressed as follows:
in the cascade chaotic system, Z nAs the system parameter, n is the iteration number of the chaotic system, when Z n ∈[0,1],When the system is in a chaotic state. Initializing a logic-logic cascading chaotic system, and adding Z n The initial value is 0.1003%>The initial value is 3.65%>The initial value is 3.89, and a long enough cascading chaotic sequence x is generated c Note that the generated chaotic sequence x c The chaos value interval of the sequence is limited to 0-255];
Step 2.1, slave cascading chaos sequence x c A sub-chaotic sequence X with the length of m is taken out 1 For scrambling the original image I o The positions of m non-overlapping blocks in the frame are used for realizing primary encryption;
step 2.2, slave cascading chaos sequence x c Taking out a sub-chaos sequence X with length of MxN 2 Intra-block n of each block is performed in minimum units of blocks 2 Scrambling between pixels, and realizing secondary encryption.
Step 2.3, slave cascading chaos sequence x c Taking out a sub-chaos sequence X with length of m 3 Each block corresponds to X 3 And performing exclusive OR operation on all pixels in the block and the chaotic value to realize three times of encryption. After the above steps are performed, an encrypted image I is obtained e The content of the original image is effectively covered, and the safety of the encrypted image is greatly enhanced due to the encryption characteristic of the chaotic system. Notably, since the encryption process is performed as follows: inter-block scrambling, intra-block exclusive-or, so even after encryption, the encrypted image I e Is still kept with the original in all blocks in the tableInitial image I o The same inter-pixel correlation;
step 3, encrypting the image I according to the correlation of a plurality of most significant bits (Most Significant Bits) of pixels in the block e The m non-overlapping blocks in the table are divided into two types of flat sliding blocks and rough blocks; generating a position diagram L according to the judging result, and marking each block as a smooth block or a rough block;
step 3.1, firstly, the encrypted image I is processed e The pixel p in each block is converted to binary form using the following formula:
because each pixel has 8 bits, taking out a bit of all pixels in the block together results in a bit plane for the block. The uppermost bit plane in FIG. 2 is composed of the most significant bits (Most Significant Bit) of all intra-block pixels, denoted E 1 Similarly, subsequent bits will be sequentially denoted as E 2 -E 8
Generally, an image always has a continuity feature, i.e. adjacent pixel values are very close to each other. Since the image encryption method in units of blocks is adopted in the previous step, each encryption block can retain such strong correlation of pixels within the block even after the image encryption stage. After encryption, due to this strong inter-pixel correlation, it is likely that all of the first most significant bit planes (Most Siginificant Bits) in some flat sliders are "0" or all are "1". Depending on the number of bitplanes for all "0" s or all "1" s, all blocks may be scanned to classify them as different. If the most significant bit plane of the block, i.e. E 1 Not all zeros or ones, then such blocks are coarse blocks. If the most significant bit plane of the block, i.e. E 1 All zeros or ones, then the block is a flat slider of type I, if the block's most significant bit plane and the next highest bit plane, E 1 And E is connected with 2 All zero or all one, then this block is a type ii flat slider. Considering only the first seven bit planes for data embedding, the lastThe bit plane (i.e. least significant bit) is used for embedding a part of auxiliary data to ensure that the subsequent extraction process is carried out smoothly;
according to the definition rule shown in fig. 3, after all the encrypted blocks are scanned, the flat blocks and the rough blocks can be distinguished first. Meanwhile, 1 rough block is known, and 7 flat sliding blocks are different.
Each block is marked as a smooth block or a rough block by using a position map L, wherein the smooth block is marked with "1" and the rough block is marked with "0", so that the length of the position map is m bits, and the binary position map L is generated as follows:
and 4, adopting multi-MSB block coding to respectively execute different compression processes on the flat sliding block and the rough block so as to make more embeddable space. The simultaneous generation of the necessary auxiliary data includes: huffman coding Rule, label graph tau and reference pixel Ref;
step 4.1, after the smooth blocks are classified, the front x= {1,2,3,4,5,6,7} bit planes of each flat slider will be compressed by bit substitution for embedding additional data, and the larger the smooth block type, the larger the number of bit planes available for embedding;
step 4.2, for the compression processing of the coarse blocks, firstly, the encrypted image I is calculated e The prediction rule of the prediction value of the coarse block pixels is as follows:
(1) first row first column pixel I e The predicted value of (1, 1) is itself.
(2) If the current pixel is in the first row, the value of its left neighbor is its predicted value.
(3) If the current pixel is in the first column, the value of its neighboring pixel above it is its predicted value.
(4) For other coarse block pixels I e (i, j) the predicted value of which is calculated using a Median Edge Detection (MED) method, the calculation formula being as follows:
wherein a=i e (i-1,j-1),b=I e (i,j-1),c=I e (i-1,j),Is I e And (i, j) the corresponding predicted value. Next, the original value and the predicted value are converted into two 8-bit binary sequences, respectively, using the following formulas:
wherein P is k (i, j) andrespectively binary sequences corresponding to the original value and the predicted value. The two sequences are compared from Most Significant Bit (MSB) to Least Significant Bit (LSB) until one of the bits is different. The tag value epsilon is then used to mark how many bits are the same between the original value and the predicted value sequence from MSB to LSB, and the calculation formula is as follows:
although the two sequences are 8 bits in length, only the first 7 bits of the two sequences are taken for processing because the image I is encrypted e The least significant bit-plane of (c) will be used as part of the embedding space, not available for compression encoding. Thus epsilon is an integer not greater than 7, which means that epsilon has a maximum of eight values. In the embedding stage, the pixels in each coarse block may provide an embedding space of ε+1 bits. Notably, the first row and first column pixels I in the modified image e (1, 1) will be stored as a unique reference pixel Ref as an auxiliary data, since the subsequent image restoration phase requires restoration using the reference pixelRepeating all coarse block pixels.
For example, as shown in fig. 4, if the original pixel value of a certain rough block is 162, and the predicted value thereof is 168 after the prediction calculation, the two values can be respectively converted into an eight-bit binary form of "10100010" and "10101000". The first 4 bits are found to be identical from the MSB to LSB comparison, so the tag value epsilon=4 for this coarse block pixel, while also representing that 5 bits of this coarse block pixel are available for embedding additional data. Scanning all the rough block pixels, and obtaining a label graph tau corresponding to all the rough block pixels through the processing procedure of the step 4.2. A large amount of embeddable space can then be created in these coarse block pixels to accommodate the additional data according to the label map τ;
step 4.3, because the tag value ε has eight total possible values, namely {0,1,2,3,4,5,6,7}. Correspondingly, we define a set of 8 Huffman codes to represent these eight tag values, i.e., { "00", "01", "100", "101", "1100", "1101", "1110", "1111" }. Firstly, calculating the number of different types of label values through the label graph obtained in the step 5.2, sequencing the eight labels according to the occurrence frequency from high to low, and sequentially distributing 8 Huffman codes. That is, where a "00" Huffman code would represent the most numerous tag values, and a "1111" Huffman code would represent the least numerous tag values. The use of huffman codes will greatly help to reduce the volume of this portion of auxiliary data and thus achieve better embedding capacity. It should be noted that the Huffman coding Rule consisting of 8 Huffman codes should be regarded as an auxiliary data to be stored.
As shown in fig. 5, a Lena chart of the most classical 512×512 size of the digital image processing world will be used herein as an example, and when the tile size n=4, there are 4282 coarse tiles, that is, 68512 coarse tile pixels in total. The number of 8 tag values is calculated, which corresponds to the compression rule as shown in the following table:
Label 0 1 2 3 4 5 6 7
Distribution 4152 5857 7066 13183 14123 10483 6535 7113
Code 1111 1110 1100 01 00 100 1101 101
it should be noted that the number of bits occupied by the compression rule is fixed, i.e. 26 bits. After the compression process is implemented, the length of the tag map τ after huffman coding can be calculated by the following formula:
wherein n is t Representing the number of pixels with a label value t in the coarse block, c t Representing the length of the corresponding Huffman code;
step 5, after the processing of the step 4, encrypting the image I e There are three spaces available for embedding additional data, namely: the least significant bit plane (Least Significant Bits), the embeddable space in the smooth block, the embeddable space in the rough block. All of its auxiliary data are embedded sequentially therein;
step 5.1, firstly, calculating the length Len of all auxiliary data aux Stored with 20 bits and placed in the header of the entire auxiliary data sequence to form a long binary auxiliary data sequence as shown in fig. 6;
step 5.2, first embedding the header portion of the binary auxiliary sequence into the encrypted image I by means of bit substitution e Is the lowest in the plane;
and 5.3, for the embeddable space in the flat slider, firstly, storing corresponding mark information in the most significant bit surface of the smooth block according to the type of the flat slider. The type of the flat slider is marked with seven 3bits codewords of { "001", "010", "011", "100", "101", "110", "111" }. And then sequentially storing the original all-zero or all-one data in the flat slider. While the remaining part (e.g. the dark grey space of fig. 7) will be used to embed the remaining auxiliary data in a bit-wise manner;
as shown in FIG. 7, a flat slider of type IV, the first 3bits "100" in the most significant bit plane is used to mark the block typeThe block type IV can know that the current block is all zero or all one from the E1-E4 bit surface, and the following '0011' is to reserve the original data of the E1-E4 bit surface so as to ensure that the original image I can be restored nondestructively when the subsequent image is restored o . While the remaining dark grey portions of the E1-E4 bit planes may be embedded with auxiliary data or subsequent secret data;
step 5.4 data embedding procedure for pixels in coarse block as shown in FIG. 8, assume an encrypted image I e The current value of a coarse pixel is 52 with a label value epsilon=5, which means that this coarse pixel can embed 5+1=6 bits of extra data. Assuming that the extra 6bits of data to be embedded at this time is "010101", the value of this coarse pixel becomes 84 after the embedding operation is performed. Embedding the remaining auxiliary data or the subsequent secret data in this way;
step 6, hiding the secret key K by using the data h Encrypting the embedded data d to obtain secret data d e The method comprises the steps of carrying out a first treatment on the surface of the Secret data d e Stored in encrypted image I e In the remaining embeddable position of (2) to obtain a secret image I carrying secret data ew
The decryption method of the picture encrypted by the multi-MSB block coding-based encryption image reversible data encryption method comprises the following steps:
step 1, a carried dense image I ew Extracting embedded data in the least significant bit plane (Least Significant Bits) and sequentially recovering to obtain part of auxiliary data: auxiliary data length Len aux Huffman coding Rule, reference pixel Ref and position diagram L. Note that since the least significant bit plane can provide an embedded position that is much larger in size than the space required for these auxiliary data, it is no problem to extract and recover these auxiliary data in bits first;
step 2, according to the extracted auxiliary data content, the encrypted image I is guided ew Extracting embedded data in the middle flat slider, and recovering residual auxiliary data according to more extracted data: tag map τ, original map least significant bit plane raw data L sb Many of the smooth blocksMSB original data;
step 3, according to the extracted auxiliary data content, the encrypted image I is guided ew The embedded data in the coarse block is extracted and the whole secret data d is restored e
Step 4, hiding the secret key K by using the data h For secret data d e Decrypting to obtain decrypted embedded data;
and 5, reversely using the idea of multi-MSB block coding to recover the data in the flat slider. Namely: the type of the flat slider can be known according to the three previous bits of data in the most significant bit of the flat slider, and the few subsequent bits of data are the original data of the flat slider from the most significant bit surface to the least significant bit surface which can be embedded, and the flat slider can be directly covered and recovered. Note that since the original data of the rest bit planes are not modified except for the bit planes available for embedding, the encryption process is only performed for security, so that the original data can be completely recovered when the decryption is performed in the reverse direction;
and 6, recovering the data in all the rough blocks according to Huffman coding Rule, reference pixel Ref, label graph tau and position graph L. First, the original pixel data of the first row and the first column are calculated by referring to the pixels, and then the predicted values of all the pixels are calculated by a median detection Method (MED). And then according to the label value corresponding to each rough pixel in the label graph, the epsilon+1 bit before the rough pixel can be known to be modified. And the front epsilon bit of the rough pixel is identical to the front epsilon bit of the predicted value, so that the rough pixel can be recovered directly through the coverage of the front epsilon bit of the predicted value. Similarly, the epsilon+1 of a coarse pixel can be restored by inverting the epsilon+1 bit of its predicted value. The data in the rough block has been fully recovered so far;
step 7, encrypting the secret key K by using the image e And (3) combining the logics-logics cascading chaotic system, and decrypting the image obtained after the processing in the step (6) by taking the block as a unit;
step 8, the original image least significant bit plane original data L sb The data in the step 7 are put back to the least effective image after the processing in the step one-to-one correspondenceBit plane, obtain original image I o
The method for encrypting the reversible data of the encrypted image based on the multi-MSB block coding is verified:
the method encrypts 10 classical test images, and performs NPCR and UACI calculation on the encrypted images, and the result is shown in the following table, so that the algorithm provided by the invention has extremely strong differential attack resistance.
Because of the high correlation between adjacent pixels of the image, one pixel often leaks information of surrounding pixels, and an attacker can use the characteristic to estimate the gray value of the next pixel, so that the recovery of the whole plaintext image is realized. The stronger the image encryption algorithm is resistant to attack, the less the correlation of the image before and after encryption should be. To test the encryption algorithm of the present invention, the correlation between the original image and the encrypted image is calculated:
wherein Cov (I, I') ew ) Is the covariance between the original image and the encrypted image, σ (I) and σ (I' ") ew ) Is the standard deviation. In addition, entropy is generally used to evaluate the randomness of an encrypted image, as follows:
wherein x is i Is a gray value, P (x i ) Is the frequency with which it occurs. For encrypted images, the ideal entropy is 8, the higher the entropy, the more uniform the distribution of the image.
The corresponding correlation coefficient and information entropy were calculated for 10 images shown in the following table, and the results are shown in the following table:
as can be seen from the test data results in the table, the correlation coefficient of the 10 test images is close to 0, which indicates that there is almost no correlation between the original image and the corresponding encrypted image; their entropy approaches 8, indicating a very uniform distribution of the encrypted image. This effectively demonstrates that the encryption algorithm of the present invention is resistant to attack by lawbreakers.
The data embedding rate is also an important index for measuring the reversible data hiding method of the encrypted image. As shown in fig. 9, the data embedding rate of the present invention is highest compared with that of the conventional excellent encrypted image reversible data hiding method, as can be seen from the figure.
Experiments are not limited to these images but extend to all images in three general databases in the field of image processing, namely uci, boss 2 and BOSSBase, to demonstrate the general embedding capabilities of the method. As shown in the following table, for the database UCID, the average embedding rate of this method was 2.8223bpp, with the average growth amounts of the other five methods [ Puteaux ], [ BBE ], [ YIN2], [ INS ] and [ YIN ] being 1.9293, 0.9957, 0.5540, 0.7025 and 0.1347, respectively. For the larger database BOWS2, the average embedding rate increases slightly, but still outperforms the other databases. Likewise, the BOSSBase database can draw the same conclusion that the proposed method always has the best embedding result on average.
In conclusion, through the analysis, experiments prove the superiority of the method in the aspect of embedding capacity and the safety of an algorithm. The invention provides a compression coding mode of processing a smoothing sliding block and a rough block respectively, which fully utilizes image redundancy for smooth block classification, creates a larger space for embedding secret data, and provides more space for embedding secret data. By using the chaotic sequence generated by the encryption key to perform triple encryption with the image, the security of secret data and the whole algorithm can be ensured, so that the robustness of the algorithm is higher.

Claims (8)

1. The reversible data encryption method for the encrypted image based on multi-MSB block coding is characterized by comprising the following steps of:
step 1, an original image I with M multiplied by N size is obtained o Dividing into m non-overlapping blocks with n multiplied by n;
step 2, generating an image encryption key K e K is obtained by adopting a Runge-Kutta method e Inputting the image into a logic-logic cascading chaotic system to generate a chaotic sequence, and taking the block as a unit to obtain an original image I o Encryption processing is carried out to obtain an encrypted image I e
Step 3, encrypting the image I e The m non-overlapping blocks in the (a) are divided into smooth blocks and rough blocks according to the correlation of a plurality of most significant bits of pixels in the blocks, the smooth blocks are marked with 1's, and the rough blocks are marked with 0's, so that the length of the position diagram is m bits, and the generation formula of the binary position diagram L is as follows:
generating a position map L to mark each block as a smooth block or a rough block;
step 4, after classifying the smooth blocks, the front x= {1,2,3,4,5,6,7} bit plane of each smooth block is compressed by a bit substitution mode to embed additional data, and the larger the smooth block type is, the more the number of bit planes can be embedded, the more MSB block coding is performed on the rough block, which comprises the following specific steps:
first, an encrypted image I is calculated e The prediction rule of the prediction value of the coarse block pixels is as follows:
(1) first row first column pixel I e The predictive value of (1, 1) is itself;
(2) if the current pixel is in the first row, the value of the left adjacent pixel is the predicted value;
(3) if the current pixel is in the first column, the value of the adjacent pixel above the current pixel is the predicted value of the current pixel;
(4) for other coarse block pixels I e (i, j) the predicted value of which is calculated by using the MED median edge detection method, and the calculation formula is as follows:
wherein a=i e (i-1,j-1),b=I e (i,j-1),c=I e (i-1,j),Is I e (i, j) the corresponding predicted value; next, the original value and the predicted value are converted into two 8-bit binary sequences, respectively, using the following formulas:
wherein P is k (i, j) andbinary sequences corresponding to an original value and a predicted value respectively, and comparing the two sequences from a most significant bit MSB to a least significant bit LSB until a certain bit is different; the tag value epsilon is then used to mark how many bits are the same between the original value and the predicted value sequence from MSB to LSB, and the calculation formula is as follows:
the first 7 bits of the two sequences are taken for processing, and the first row and first column pixels I in the image are corrected e (1, 1) storing the reference pixel Ref as a unique reference pixel, scanning all rough block pixels, and processing the rough block pixels through the steps to obtain a label graph tau corresponding to all the rough block pixels;
the label value epsilon has eight values, namely {0,1,2,3,4,5,6,7}, and 8 Huffman codes are correspondingly defined to represent the eight label values, namely { "00", "01", "100", "101", "1100", "1101", "1110", "1111" }; calculating the number of different types of tag values through a tag graph tau, sequencing the eight types of tags according to the occurrence frequency of the eight types of tags from high to low, and sequentially distributing 8 Huffman codes; the Huffman coding Rule composed of 8 Huffman codes is a part of auxiliary data;
the length of the Huffman encoded tag map τ may be calculated by the following equation:
wherein n is t Representing the number of pixels with a label value t in the coarse block, c t Representing the length of the corresponding huffman code, wherein the necessary assistance data comprises: huffman coding Rule, label graph tau and reference pixel Ref;
step 5, embedding all the auxiliary data generated in step 4 into the encrypted image I in sequence e In (a) and (b);
step 6, hiding the secret key K by using the data h Encrypting the embedded data d to obtain secret data d e Will secret data d e The encrypted image I stored in step 5 e In the remaining embeddable position of (2) to obtain a secret image I carrying secret data ew
2. The encryption method according to claim 1, wherein m=mxn/N in the step 1 2 Original image I o The lowest bit plane raw data of all pixels is used with a binary sequence L sb And (5) preserving.
3. The encryption method according to claim 1, wherein the logics-logics cascading chaotic system in the step 2 is expressed as:
in the cascade chaotic system, Z n+1 For the next chaotic state of the system, the current chaotic state Z of the system n By means of the iterative generation of the data,as the system parameter, n is the iteration number of the chaotic system, when Z n ∈[0,1],/> When the system is in a chaotic state; initializing a logic-logic cascading chaotic system, and adding Z n Give a number of 0-1]Arbitrary value of->Give [0-4 ]]Arbitrary value of->Also give [0-4 ]]Any numerical value between the two, and generates a long enough cascading chaotic sequence x c Generated chaotic sequence x c The chaos value interval of the sequence is limited to 0-255]。
4. The encryption method according to claim 3, wherein in the step 2, the encryption method of the encryption process is: from a cascading chaotic sequence x c A sub-chaotic sequence X with the length of m is taken out 1 For scrambling the original image I o The positions of m non-overlapping blocks in the frame are used for realizing primary encryption; from a cascading chaotic sequence x c Taking out a sub-chaos sequence X with length of MxN 2 Intra-block n of each block is performed in minimum units of blocks 2 Scrambling among pixels to realize secondary encryption; from a cascading chaotic sequence x c Taking out a sub-chaos sequence X with length of m 3 Each block corresponds to X 3 And performing exclusive OR operation on all pixels in the block and the chaotic value to realize three times of encryption.
5. The encryption method according to claim 1, wherein in the step 3, the specific method for dividing the flat slider and the rough block is as follows: first, the encrypted image I e The pixel p in each block is converted to binary form using the following formula:
taking out a bit of all pixels in a block, namely a bit plane of the block, wherein the bit plane of the uppermost layer of the block is composed of the most significant bits of all pixels in the block, and is marked as E 1 Subsequent bits will be sequentially noted as E 2 -E 8
If the most significant bit plane E of the block 1 Not all zeros or ones, the block is a coarse block; if the most significant bit plane E of the block 1 All zeros or ones, the block is a flat slide of type I, if the block has a most significant bit plane E 1 And the second highest level E 2 All zero or all one, then the block is a type ii flat block, and so on, the smooth block is determined to be a type I block to a type VII block.
6. The encryption method according to claim 1, wherein in the step 5, the auxiliary data is embedded in the I of the encrypted image e The method comprises the following specific steps:
step 5.1 calculating the Length Len of all auxiliary data aux Stored with 20 bits and placed in the header of the entire auxiliary data sequence to form a long binary auxiliary data sequence;
step 5.2 embedding the header portion of the binary auxiliary sequence into the encrypted image I by means of bit substitution e Is the lowest in the plane;
step 5.3 embedding data in the block:
for the data embedding of pixels in the flat slider, according to the type of the smooth block, corresponding marking information is stored in the most significant bit surface of the smooth block, seven 3-bit code words of { "001", "010", "011", "100", "101", "110", "111" } are used for marking the type of the flat slider, then the original all-zero or all-one data in the flat slider is sequentially stored behind the flat slider, and the rest part is used for embedding the rest auxiliary data in a bit replacement mode;
for data embedding of pixels in a rough block, an encrypted image I is set e The label value of the coarse pixel is epsilon, which means that the current coarse pixel can embed (epsilon + 1) bits of extra data.
7. A method of decrypting an encrypted image obtained by an encryption method according to any one of claims 1 to 6, comprising the steps of:
step 1, a carried dense image I ew Extracting all auxiliary data in the least significant bit plane, and sequentially recovering to obtain: auxiliary data length Len aux Huffman coding Rule, reference pixel Ref and position diagram L;
step 2, according to the extracted auxiliary data content, the encrypted image I is guided ew Extracting embedded data in the middle flat sliding block, and recovering residual auxiliary data according to the extracted data: tag map τ, original map least significant bit plane raw data L sb multi-MSB original data in the peaked slider;
step 3, guiding the carried image I according to the extracted auxiliary data content ew The embedded data in the coarse block is extracted and the whole secret data d is restored e
Step 4, utilizing the data hiding secret key to hide the secret data d e Decrypting to obtain decrypted embedded data;
step 5, reversely using the thought of multi-MSB block coding to recover the data in the flat sliding block;
step 6, recovering the data in all the rough blocks according to Huffman coding Rule, reference pixel Ref, label graph tau and position graph L;
step 7, encrypting the secret key K by using the image e And (3) combining the logics-logics cascading chaotic system, and decrypting the image obtained after the processing in the step (6) by taking the block as a unit;
step 8, the original image least significant bit plane original data L sb The data in the image is correspondingly put back to the least significant bit surface of the image processed in the step 7 one by one to obtain an original image I o
8. The decryption method according to claim 7, wherein in the step 5, the specific steps of recovering the data in the flat slider are: the type of the flat sliding block is known according to the three-bit data in front of the most significant bit of the flat sliding block, and the few bits of data immediately after the type of the flat sliding block are the original data from the most significant bit surface to the least significant bit surface which can be embedded in the flat sliding block, and the original data are directly covered; in the step 6, the specific steps of recovering the data in the rough block are as follows: firstly, the original pixel data of the first row and the first column are calculated by referring to the pixels, then the predicted values of all the pixels are calculated by an MED median detection method, then the front epsilon+1 bit of each rough pixel in the label graph can be known to be modified according to the label value corresponding to the rough pixel, and the front epsilon bit of the rough pixel is completely the same as the front epsilon bit of the predicted value, so that the original pixel data can be recovered directly through the coverage of the front epsilon bit of the predicted value, and similarly, the epsilon+1 bit of the rough pixel can be recovered through the inversion of the epsilon+1 bit of the predicted value.
CN202210995169.XA 2022-08-18 2022-08-18 Encryption image reversible data encryption and decryption method based on multi-MSB block coding Active CN115348361B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210995169.XA CN115348361B (en) 2022-08-18 2022-08-18 Encryption image reversible data encryption and decryption method based on multi-MSB block coding

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210995169.XA CN115348361B (en) 2022-08-18 2022-08-18 Encryption image reversible data encryption and decryption method based on multi-MSB block coding

Publications (2)

Publication Number Publication Date
CN115348361A CN115348361A (en) 2022-11-15
CN115348361B true CN115348361B (en) 2023-07-25

Family

ID=83953990

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210995169.XA Active CN115348361B (en) 2022-08-18 2022-08-18 Encryption image reversible data encryption and decryption method based on multi-MSB block coding

Country Status (1)

Country Link
CN (1) CN115348361B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2691977A1 (en) * 2007-07-02 2009-01-08 Lg Electronics Inc. Digital broadcasting system and method of processing data in digital broadcasting system
CN112202984A (en) * 2020-09-25 2021-01-08 中国人民武装警察部队工程大学 Ciphertext domain reversible information hiding method based on error correction redundancy
CN114493968A (en) * 2021-12-23 2022-05-13 西安理工大学 Data hiding method based on most significant bit replacement and least significant bit compression

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6891893B2 (en) * 2000-04-21 2005-05-10 Microsoft Corp. Extensible multimedia application program interface and related methods

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2691977A1 (en) * 2007-07-02 2009-01-08 Lg Electronics Inc. Digital broadcasting system and method of processing data in digital broadcasting system
CN112202984A (en) * 2020-09-25 2021-01-08 中国人民武装警察部队工程大学 Ciphertext domain reversible information hiding method based on error correction redundancy
CN114493968A (en) * 2021-12-23 2022-05-13 西安理工大学 Data hiding method based on most significant bit replacement and least significant bit compression

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Reversible data hiding in encrypted images based on pixel prediction and multi-MSB planes rearrangement;zhaoxia yin等;《Signal processing》;全文 *
基于加密图像的高容量可逆信息隐藏算法研究;邓敏;《知网》;全文 *

Also Published As

Publication number Publication date
CN115348361A (en) 2022-11-15

Similar Documents

Publication Publication Date Title
Yu et al. Reversible data hiding with hierarchical embedding for encrypted images
Qin et al. Separable reversible data hiding in encrypted images via adaptive embedding strategy with block selection
Yin et al. Reversible data hiding in encrypted images based on pixel prediction and bit-plane compression
Puteaux et al. An efficient MSB prediction-based method for high-capacity reversible data hiding in encrypted images
Fu et al. Effective reversible data hiding in encrypted image with adaptive encoding strategy
Puyang et al. Reversible data hiding in encrypted images with two-MSB prediction
Cao et al. High capacity reversible data hiding in encrypted images by patch-level sparse representation
CN112311954B (en) Ciphertext domain reversible information hiding method based on complementary code mark and bitmap embedding
CN109348228B (en) Reversible information hiding system and method for image encryption domain
CN113194213B (en) PNG image information hiding and recovering method based on secret sharing and chaotic mapping
CN111898138B (en) Separable ciphertext domain reversible data hiding method
Anushiadevi et al. Separable reversible data hiding in an encrypted image using the adjacency pixel difference histogram
Yi et al. Parametric reversible data hiding in encrypted images using adaptive bit-level data embedding and checkerboard based prediction
Weng et al. High capacity reversible data hiding in encrypted images using SIBRW and GCC
CN113382127B (en) Encrypted image reversible information hiding method with elastic selection and run-length coding
Chen et al. Error-free separable reversible data hiding in encrypted images using linear regression and prediction error map
Bhattacharyya et al. A novel approach to develop a secure image based steganographic model using integer wavelet transform
Mo et al. Reversible Data Hiding in Encrypted Image Based on Block Classification Permutation.
CN110166784B (en) Adaptive image texture area steganography method based on pixel blocks
CN114172630B (en) Reversible information hiding method based on addition homomorphic encryption and multi-high-order embedding
CN115695675A (en) Video encryption method for network data secure exchange
Panchikkil et al. A pseudo-random pixel mapping with weighted mesh graph approach for reversible data hiding in encrypted image
CN114745475A (en) Robust reversible information hiding method for encrypted image
CN115379066B (en) Encryption image reversible data encryption and decryption method based on self-adaptive compression coding
Neetha et al. An efficient image encryption reversible data hiding technique to improve payload and high security in cloud platforms

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant