CN112380551A - Reversible data hiding method and system based on double images - Google Patents

Reversible data hiding method and system based on double images Download PDF

Info

Publication number
CN112380551A
CN112380551A CN202011292406.3A CN202011292406A CN112380551A CN 112380551 A CN112380551 A CN 112380551A CN 202011292406 A CN202011292406 A CN 202011292406A CN 112380551 A CN112380551 A CN 112380551A
Authority
CN
China
Prior art keywords
matrix
tortoise
points
pixel
secret
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.)
Granted
Application number
CN202011292406.3A
Other languages
Chinese (zh)
Other versions
CN112380551B (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.)
Xiamen University of Technology
Original Assignee
Xiamen 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 Xiamen University of Technology filed Critical Xiamen University of Technology
Priority to CN202011292406.3A priority Critical patent/CN112380551B/en
Publication of CN112380551A publication Critical patent/CN112380551A/en
Application granted granted Critical
Publication of CN112380551B publication Critical patent/CN112380551B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Image Processing (AREA)

Abstract

The invention provides a reversible data hiding method and a reversible data hiding system based on double images, which are characterized in that a novel tortoise shell magic matrix is obtained by adding numerical values of '8' to element values of tortoise back points on the basis of the original tortoise shell magic matrix, the range of the element values in the matrix is expanded, the hidden quantity of hidden secret data of the matrix is increased, meanwhile, a novel reversible hiding algorithm is invented, the secret data are converted into hexadecimal numbers to be hidden in the novel tortoise shell magic matrix, and pairwise corresponding secret images are obtained; and in the stage of secret data extraction, a corresponding data extraction rule is formulated according to a novel reversible hiding algorithm to extract the secret data, and an original image is recovered. Compared with the traditional data hiding algorithm based on the image, the method has the advantage of ensuring the quality of the hidden image under the condition of higher storage capacity, so that the secret data can be hidden more safely.

Description

Reversible data hiding method and system based on double images
Technical Field
The invention relates to the technical field of image processing, in particular to a reversible data hiding method and system based on double images.
Background
With the popularization of network technology, people can conveniently communicate with other people and exchange data on the network. However, due to the open nature of the network, data transmitted on the network can be easily intercepted, tampered or destroyed by malicious persons. Therefore, in order to improve the security of data communication, a common solution is to encrypt the data to be transmitted. However, due to the complexity of the encryption algorithm, the encryption and decryption process takes a relatively long time, and the encrypted data is a pile of meaningless scratchlike things, which is more likely to cause suspicion of malicious persons. While malicious persons may not be able to crack the data directly, they may corrupt the data, causing loss of the data.
In addition to encryption techniques, data hiding is also an effective method of data protection. The data hiding algorithm may hide secret data into a medium, which may be an image, video, audio, text, etc. After the data is embedded in the image, the image and the original image are not greatly different from each other seen from naked eyes, so that the doubts of attackers are not easily caused, and the data transmission can be safely carried out. And after receiving the image hidden with the secret information, the receiver extracts the secret information according to an extraction algorithm.
Data hiding is divided into reversible data hiding and irreversible data hiding according to whether a data receiver can recover an original image. Generally, whether irreversible data hiding can hide more secret information or not is achieved, and conversely, reversible data hiding capacity is generally smaller. The advantage of reversible data hiding is that the original image can be fully restored.
The invention carries out reversible data hiding based on double images, and two images with hidden secret data can be generated after the original image is hidden with the secret data. The original image and the secret data cannot be extracted only by a single image storing the secret data, and if and only if two images storing the secret data are acquired by a receiving party together, the secret data and the original image can be completely recovered by the cooperation of the two images.
Disclosure of Invention
The invention provides a reversible data hiding method and system based on double images, which are used for solving the defects of the prior art.
In one aspect, the present invention provides a reversible data hiding method based on dual images, comprising the following steps:
s1: constructing a matrix with a horizontal and vertical coordinate range of [0,255], enabling values of adjacent elements in the same row in the matrix to differ by 1 and sequentially increase progressively, enabling values of two adjacent even columns of elements in the same column to be more than 2 than those of odd columns and values of odd columns to be more than 3 than those of even columns, then carrying out modular 8 operation on the element values in the matrix to enable the element values to be between [0,7], and finally covering the matrix with a plurality of connected and spliced hexagons to obtain a tortoise shell magic matrix, wherein points in the matrix at the edges of the hexagons belong to tortoise edge points, points not at the edges of the hexagons belong to tortoise back points, and adding a numerical value of 8 to each element at the tortoise back points in the tortoise shell magic matrix to obtain a novel tortoise shell magic matrix;
s2: converting the secret information to be hidden into a string of binary numbers, and converting every 4 binary numbers into a hexadecimal number;
s3: one pixel p is taken from the original image (p E [0,255 ])]) Expanding the pixel p to one coordinate (p, p) if the pixel p is a coordinate (p, p)
Figure BDA0002784304180000021
And is
Figure BDA0002784304180000022
Obtaining a hexadecimal number which is marked as v from the secret information, determining a hiding range according to the position difference of the point (p, p) in the novel tortoise shell magic matrix, and finding a coordinate (p) which leads the coordinate corresponding to the value of v in the hiding range1,p2) And aligning said coordinates (p) according to a movement rule1,p2) Moving the points where the conflict exists;
s4: p is to be1Assigning to the position corresponding to the pixel p in the original image, traversing all pixels in the original image and all hexadecimal numbers in the secret information to execute the step S3 to obtain a first secret image, and assigning p to the position corresponding to the pixel p in the original image2Assigning the value to the position corresponding to the pixel p in the original image, and traversing all pixels in the original image and all hexadecimal numbers in the secret information to execute the step S3 to obtain a second secret image.
The method enlarges the range of the element values in the novel tortoise-shell magic matrix by adding the numerical value of 8 to the element values of the tortoise back points, thereby increasing the hidden quantity of the hidden secret data of the novel tortoise-shell magic matrix, and well hiding the secret data and recovering the original image under the condition of less change to the original image by utilizing the novel reversible hiding algorithm.
In a specific embodiment, the hiding range is determined according to the position difference of the point (p, p) in the novel tortoise-shell magic matrix, and the specific steps include: recording a point with a larger vertical coordinate in the turtle back points as an upper turtle back point, recording a point with a smaller vertical coordinate in the turtle back points as a lower turtle back point, recording three points with a minimum vertical coordinate or a vertical coordinate equal to the upper turtle back point in the turtle side points as upper turtle side points, recording three points with a maximum vertical coordinate or a vertical coordinate equal to the lower turtle back point in the turtle side points as lower turtle side points, if the pixel p belongs to the upper turtle side points or the upper turtle back points, constructing a 4 x 5 block by taking the point with the coordinate (p, p) in the novel turtle shell magic matrix as the lower right corner, deducting 4 elements in the middle upper right corner of the block, and using the remaining 16 elements to store a hexadecimal number; if the pixel p belongs to the lower turtle boundary point or the lower turtle back point, a 4 × 5 block is constructed by using (p, p) as the upper left corner, 4 elements in the lower left corner of the block are subtracted, and the remaining 16 elements are used to store one hexadecimal number.
In a specific embodiment, the movement rule specifically includes:
if the pixel p belongs to the upper turtle-edge point or the upper turtle-back point, moving the element bf of the last column of the first row and the element bs of the last column of the second row in the hidden range according to the following rule:
Figure BDA0002784304180000031
if the pixel p belongs to the lower turtle-edge point or the lower turtle-back point, the element lf of the first column of the last row and the element ls of the first column of the second last row in the hidden range are moved according to the following rule:
Figure BDA0002784304180000032
in a specific embodiment, in step S3, if the pixel p ∈ [0, 2]]Or p e [253,255]Let p stand for1=p2And directly performs step S4.
In a specific embodiment, the method further includes a step of extracting the secret information in the image, and specifically includes:
a1: executing the step S1 to obtain the novel tortoise shell magic matrix;
a2: sequentially extracting the p from the same position of the first secret image and the second secret image1And p2Defining the difference d ═ p1-p2
A3: secret information extraction is performed according to the following rules:
(1) if d is 0 and p1And p2If the first secret image belongs to the edge point, secret information is not hidden in corresponding points in the first secret image and the second secret image; if d is 0 and p1And p2If the information does not belong to the edge point, the hidden hexadecimal secret information v is the midpoint (p) of the novel tortoise shell magic matrix1,p2) A value of (d);
(2) if d < 0, the hidden hexadecimal secret information v is obtained according to the following rule:
Figure BDA0002784304180000041
(3) if d > 0, the hidden hexadecimal secret information v is obtained according to the following rule:
Figure BDA0002784304180000042
wherein M (p)1,p2) Show the novel magic tortoise shellPoints in the surgical matrix (p)1,p2) The value of (c).
In a specific embodiment, the method further includes a step of restoring the original picture, specifically including executing the following original picture restoration algorithm after the steps a 1-A3:
(1) if d is equal to 0, the original pixel p is equal to p1
(2) If d < 0, p can be obtained by:
Figure BDA0002784304180000043
(3) if d > 0, p can be obtained by:
Figure BDA0002784304180000051
and restoring the pixel p at the corresponding position in the original image, thereby restoring the original image.
According to a second aspect of the present invention, a computer-readable storage medium is proposed, on which a computer program is stored, which computer program, when being executed by a computer processor, carries out the above-mentioned method.
According to a third aspect of the present invention, a reversible data hiding system based on dual images is proposed, the system comprising:
novel tortoise shell magic matrix construction module: configuring a matrix with a horizontal and vertical coordinate range of [0,255], enabling values of adjacent elements in the same row in the matrix to differ by 1 and sequentially increase progressively, enabling values of even columns of adjacent two elements in the same column to be more than values of odd columns by 2 and values of odd columns to be more than values of even columns by 3, then performing modular 8 operation on the element values in the matrix to enable the element values to be between [0,7], and finally covering the matrix with a plurality of hexagons which are connected and spliced to obtain a tortoise-shell magic matrix, wherein points in the matrix at the edge of the hexagon belong to tortoise-edge points, points which are not at the edge of the hexagon belong to tortoise-back points, and adding values of '8' to the elements at the tortoise-back points in the tortoise-shell magic matrix to obtain a novel tortoise-shell magic matrix;
secret information preprocessing module: the device is configured to convert secret information to be hidden into a string of binary numbers, and then convert every 4 binary numbers into a hexadecimal number;
secret information hiding module: configured to take a pixel p (p e 0, 255) from the original image]) Expanding the pixel p to one coordinate (p, p) if the pixel p is a coordinate (p, p)
Figure BDA0002784304180000052
And is
Figure BDA0002784304180000053
Obtaining a hexadecimal number which is marked as v from the secret information, determining a hiding range according to the position difference of the point (p, p) in the novel tortoise shell magic matrix, and finding a coordinate (p) which leads the coordinate corresponding to the value of v in the hiding range1,p2) And aligning said coordinates (p) according to a movement rule1,p2) Moving the points where the conflict exists;
secret image generation module: is configured to couple p1Assigning to the position corresponding to the pixel p in the original image, traversing all pixels in the original image and all hexadecimal numbers in the secret information to operate a secret information hiding module to obtain a first secret image, and assigning p to the position corresponding to the pixel p in the original image2And assigning a value to a position corresponding to the pixel p in the original image, traversing all pixels in the original image and all hexadecimal numbers in the secret information, and operating a secret information hiding module to obtain a second secret image.
On the basis of the original tortoise-shell magic matrix, a novel tortoise-shell magic matrix is constructed in a mode of adding numerical values of '8' to the element values of the tortoise back points, the range of the element values in the tortoise-shell magic matrix is expanded, the hidden quantity of hidden secret data of the novel tortoise-shell magic matrix is increased, a novel reversible hiding algorithm is invented, the secret data are converted into hexadecimal numbers to be hidden in the novel tortoise-shell magic matrix, and two pairwise corresponding secret images are obtained; and in the stage of secret data extraction, a corresponding data extraction rule is formulated according to a novel reversible hiding algorithm to extract the secret data, and an original image is recovered. Compared with the traditional secret data hiding algorithm based on the image, the secret data hiding method based on the image has the advantage of ensuring the quality of the hidden image under the condition of high reserve, so that the secret data can be hidden more safely.
Drawings
The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments and together with the description serve to explain the principles of the invention. Other embodiments and many of the intended advantages of embodiments will be readily appreciated as they become better understood by reference to the following detailed description. Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is a flow chart of a method for reversible data hiding based on dual images according to an embodiment of the present invention;
figure 2 is a novel tortoise shell magic matrix of one specific embodiment of the present invention;
fig. 3 is a schematic diagram of a single tortoise shell structure in the magic matrix of the tortoise shell according to an embodiment of the present invention;
FIG. 4 is a schematic diagram illustrating two secret information hiding manners based on 4 × 5 blocks according to an embodiment of the present invention;
fig. 5 is a schematic diagram of data embedding using a novel tortoise-shell magic matrix according to an embodiment of the present invention;
FIG. 6 is a schematic diagram illustrating the rule of movement of the conflict point according to one embodiment of the present invention;
FIG. 7 is a diagram illustrating possible value ranges of the difference d according to an embodiment of the present invention;
FIG. 8 is a block diagram of a two-image based reversible data hiding system according to an embodiment of the present invention;
FIG. 9 is a graph comparing maximum reserve values for different methods of an embodiment of the invention;
FIG. 10 is a graph comparing image quality values for different methods for maximum inventory in accordance with an embodiment of the present invention.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows a flowchart of a reversible data hiding method based on two images according to an embodiment of the present invention. As shown in fig. 1, the method comprises the steps of:
s101: constructing a matrix with the horizontal and vertical coordinate range of [0,255], enabling the value difference of adjacent elements in the same row in the matrix to be 1, sequentially increasing the value, enabling the value of two adjacent even columns of elements in the same column to be more than 2 than that of odd columns, enabling the value of odd columns to be more than that of even columns by 3, then conducting modular 8 operation on the element values in the matrix, enabling the element values to be between [0,7], and finally covering the matrix with a plurality of connected and spliced hexagons to obtain the tortoise shell magic matrix. The matrix is characterized in that the range of the horizontal and vertical coordinates is [0,255], which corresponds to the value range of the pixel values of the gray level image; and sequentially adding 1 to two adjacent element values of the same row in the matrix from left to right, wherein the value of the even-numbered column of the two adjacent elements of the same column is 2 more than that of the odd-numbered column, the value of the odd-numbered column is 3 more than that of the even-numbered column, and finally, the element values in the matrix need to be subjected to modulo-8 operation to ensure that the element values are between [0 and 7 ].
In a specific embodiment, a point located at the edge of the hexagon in the tortoise shell magic matrix belongs to a tortoise-edge point, a point not located at the edge of the hexagon belongs to a tortoise-back point, an upper tortoise-back point is arranged in the tortoise-back point with a larger vertical coordinate, a lower tortoise-back point is arranged in the tortoise-back point with a smaller vertical coordinate, three points with a smallest vertical coordinate or a vertical coordinate equal to the upper tortoise-back point in the tortoise-back point are upper tortoise-edge points, and three points with a largest vertical coordinate or a vertical coordinate equal to the lower tortoise-back point in the tortoise-edge points are lower tortoise-edge points.
Fig. 3 shows a schematic diagram of a single tortoise shell structure in a magic matrix of a specific embodiment of the present invention, wherein points (311, 312, 314) are lower tortoise-side points, point (313) is a lower tortoise-back point, points (321, 322, 324) are upper tortoise-side points, and point (323) is an upper tortoise-back point.
According to the definition of the point in the tortoise-shell magic matrix shown in fig. 3, the elements of the tortoise-shell magic matrix at the dorsum of the tortoise (313, 323) are added with the value "8" to obtain the novel tortoise-shell magic matrix as shown in fig. 2, wherein p isiAnd pi+1Respectively, the abscissa and the ordinate of the novel tortoise shell magic matrix are taken as p1And p2
S102: the secret information to be hidden is converted into a string of binary numbers, and every 4 binary numbers are converted into a hexadecimal number.
S103: one pixel p is taken from the original image (p E [0,255 ])]) Expanding the pixel p to one coordinate (p, p) if the pixel p is a coordinate (p, p)
Figure BDA0002784304180000081
And is
Figure BDA0002784304180000082
Obtaining a hexadecimal number which is marked as v from the secret information, determining a hiding range according to the position difference of the point (p, p) in the novel tortoise shell magic matrix, and finding a coordinate (p) which leads the coordinate corresponding to the value of v in the hiding range1,p2) And aligning said coordinates (p) according to a movement rule1,p2) The point where the collision exists moves.
In a specific embodiment, the hiding range is determined according to the position difference of the point (p, p) in the novel tortoise-shell magic matrix, and the specific steps include: if the pixel p belongs to the upper turtle-side point (321, 322, 324) or the upper turtle-back point (323), a 4 × 5 block is constructed by taking the point with the coordinate (p, p) in the novel turtle-shell magic matrix as the lower right corner, 4 elements in the upper right corner in the block are deducted, and the rest 16 elements are used for hiding the hexadecimal number; if the pixel p belongs to the lower turtle edge point (311, 312, 314) or the lower turtle back point (313), a 4 × 5 block is constructed with (p, p) as the upper left corner, the 4 elements in the lower left corner of the block are subtracted, and the remaining 16 elements are used to hide the hexadecimal number.
According to the above method, a 4 × 5 block is arbitrarily drawn in the novel tortoise-shell magic matrix shown in fig. 2 (as shown by the square box in fig. 2), then the elements therein must contain 0-15, and 4 elements in the upper right corner and the lower left corner are repeated, as shown by the dotted circle in fig. 2. Thus, with 4 repeated elements subtracted, the remaining 16 element values must belong to [0, 15], and the 4 × 5 block plotted has two cases as in fig. 4:
FIG. 4 is a schematic diagram illustrating two classified modes of secret information hiding based on 4 × 5 blocks according to an embodiment of the present invention, where one of the two classified modes is a group of 4 upper-right-corner elements (labeled as t), and the remaining 16 elements are a group (labeled as t)1) As shown in FIG. 401, if the pixel p belongs to the upper tortoises point (321, 322, 324) or the upper tortoises point (323), t is used1To hide the hexadecimal number. The other is a group of 4 elements in the lower left corner (labeled b), and the remaining 16 elements are a group (labeled b)1) As shown in FIG. 402, if the pixel p belongs to the lower turtle-edge point (311, 312, 314) or the lower turtle-back point (313), b is used1To hide the hexadecimal number.
Fig. 5 shows a schematic diagram of data embedding by using the novel tortoise shell magic matrix according to a specific embodiment of the present invention, for example, points (4, 4), (6, 6) and (8, 8) in fig. 5 belong to the upper tortoise side point or the upper tortoise back point, a 4 × 5 block is constructed by taking (p, p) as the lower right corner element,deducting the 4 elements in the upper right corner of the block, i.e. using t116 elements to hide a hexadecimal number; for example, points (3, 3), (5, 5) and (7, 7) in fig. 5 belong to the lower turtle-side point or the lower turtle-back point, a 4 × 5 block is constructed with (p, p) as the upper left corner, and 4 elements in the lower left corner of the block are subtracted, i.e., b is used1To embed a hexadecimal number.
In a specific embodiment, when different p bins the same number v, a position conflict problem may occur. For example, when positions (4, 4) and (6, 6) are both filled with the value v equal to 1, the elements of the two positions are both moved to (2, 6), which results in failure to correctly restore the original pixel. Therefore, a rule is set in the invention to move the points which can cause confusion.
Fig. 6 is a schematic diagram of a movement rule of a conflict point according to an embodiment of the present invention, where the movement rule specifically includes:
as shown in fig. 601, if the pixel p belongs to the upper tortoiseshell point (321, 322, 324) or the upper tortoise point (323), the element bf in the last column of the first row and the element bs in the last column of the second row in the hidden range are moved according to the following rule:
Figure BDA0002784304180000101
as shown in fig. 602, if the pixel p belongs to the lower turtle-edge point (311, 312, 314) or the lower turtle-back point (313), the element lf in the first column of the last row and the element ls in the first column of the second last row in the hidden range are moved according to the following rule:
Figure BDA0002784304180000102
in a specific embodiment, in step S3, if the pixel p ∈ [0, 2]]Or p e [253,255]Let p stand for1=p2P, and the step S4 is directly performed.
S104: p is to be1Assigning a value to said pixel in said original imagep, and step S3 is executed by traversing all pixels in the original image and all hexadecimal numbers in the secret information to obtain a first secret image, and p is used2Assigning the value to the position corresponding to the pixel p in the original image, and traversing all pixels in the original image and all hexadecimal numbers in the secret information to execute the step S3 to obtain a second secret image.
In a specific embodiment, the method further includes a step of extracting the secret information in the image, and specifically includes:
a1: executing the step S1 to obtain the novel tortoise shell magic matrix;
a2: sequentially extracting the p from the same position of the first secret image and the second secret image1And p2Defining the difference d ═ p1-p2Wherein, the possible value range of the difference d is shown in fig. 7, and the value range of d is [ -8, 8 [ -8 [ ]]If d is greater than 0, the original pixel p belongs to a lower turtle edge point or a lower turtle back point; if d is less than 0, the original pixel p belongs to the upper turtle edge point or the upper turtle back point;
a3: secret information extraction is performed according to the following rules:
(1) if d is 0 and p1And p2If the first secret image belongs to the edge point, secret information is not hidden in corresponding points in the first secret image and the second secret image; if d is 0 and p1And p2If the information does not belong to the edge point, the hidden hexadecimal secret information v is the midpoint (p) of the novel tortoise shell magic matrix1,p2) A value of (d);
(2) if d < 0, the hidden hexadecimal secret information v is obtained according to the following rule:
Figure BDA0002784304180000111
(3) if d > 0, the hidden hexadecimal secret information v is obtained according to the following rule:
Figure BDA0002784304180000112
wherein M (p)1,p2) Represents the midpoint (p) of the novel tortoise shell magic matrix1,p2) The value of (c).
In a specific embodiment, the method further includes a step of restoring the original picture, specifically including executing the following original picture restoration algorithm after the steps a 1-A3:
(1) if d is equal to 0, the original pixel p is equal to p1
(2) If d < 0, p can be obtained by:
Figure BDA0002784304180000113
(3) if d > 0, p can be obtained by:
Figure BDA0002784304180000114
and restoring the pixel p at the corresponding position in the original image, thereby restoring the original image.
FIG. 8 illustrates a block diagram of a two-image based reversible data hiding system, according to an embodiment of the present invention. The system comprises a novel tortoise-shell magic matrix construction module 801, a secret information preprocessing module 802, a secret information hiding module 803 and a secret image generation module 804.
In particular embodiments, novel tortoise-shell magic matrix construction module 801 is configured to construct a range of 0,255 abscissa]The matrix of (1) is used for making the values of adjacent elements in the same row in the matrix differ by 1 and sequentially increase progressively, the value of even-numbered columns of two adjacent elements in the same column is more than 2 than that of odd-numbered columns, the value of odd-numbered columns is more than 3 than that of even-numbered columns, and then the element values in the matrix are subjected to modulo-8 operation to make the element values in [0,7]]Finally, covering the matrix with a plurality of continuous hexagons to obtain a tortoise-shell magic matrix, and adding the numerical value of 8 to each element positioned at the tortoise back point (313, 323) in the tortoise-shell magic matrix "Obtaining a novel tortoise shell magic matrix; the secret information preprocessing module 802 is configured to convert secret information to be hidden into a string of binary numbers, and then convert every 4 binary numbers into a hexadecimal number; the secret information hiding module 803 is configured to take out one pixel p (p e [0,255] from the original image]) Expanding the pixel p to one coordinate (p, p) if the pixel p is a coordinate (p, p)
Figure BDA0002784304180000121
And is
Figure BDA0002784304180000122
Obtaining a hexadecimal number which is marked as v from the secret information, determining a hiding range according to the position difference of the point (p, p) in the novel tortoise shell magic matrix, and finding a coordinate (p) which leads the coordinate corresponding to the value of v in the hiding range1,p2) And aligning said coordinates (p) according to a movement rule1,p2) Moving the points where the conflict exists; secret image generation module 804 is configured to generate p1Assigning to the position corresponding to the pixel p in the original image, traversing all pixels in the original image and all hexadecimal numbers in the secret information to operate a secret information hiding module to obtain a first secret image, and assigning p to the position corresponding to the pixel p in the original image2And assigning a value to a position corresponding to the pixel p in the original image, traversing all pixels in the original image and all hexadecimal numbers in the secret information, and operating a secret information hiding module to obtain a second secret image.
The combined action of the modules is firstly to add the element value of the turtle back point to the value of 8, the range of the element value in the novel turtle shell magic matrix is enlarged, so that the hidden quantity of the hidden secret data of the novel turtle shell magic matrix is increased, a novel reversible hiding algorithm is executed again, the hidden secret data can be well hidden and the original image can be recovered under the condition that the original image is less changed, and compared with the traditional secret data hiding algorithm based on the image, the novel reversible hiding algorithm has the advantage that the quality of the hidden image is guaranteed under the condition that the hidden quantity is higher.
In order to verify the reliability and beneficial effect of the invention, the inventor carries out a series of experiments, and the advantage of the algorithm of the invention compared with other traditional algorithms in the field is measured by using the hidden quantity (ER) and the image quality (PSNR) after secret data is hidden, and the larger the value of the two is, the better the algorithm is.
Wherein, the measurement unit of ER is bpp, that is, the bit number that a single pixel can be hidden, PSNR refers to the peak signal-to-noise ratio of the image, and the unit is dB, and is calculated by the following formula:
Figure BDA0002784304180000131
Figure BDA0002784304180000132
where H and W denote the width and height of the image, m and m1Indicating the original image and the image with the hidden secret data, and the index (i, j) indicates the position of the ith row and jth column.
In this embodiment, four methods, namely a double-image reversible data hiding method [1] based on a quick-reading matrix, a double-image reversible data hiding method [2] based on an EMD matrix, a double-image reversible data hiding method [3] based on an original tortoise-shell matrix, and a real-time double-image reversible data hiding method [4] based on the tortoise-shell matrix, are selected for comparison with the method of the present invention.
Fig. 9 shows a comparison of maximum reserve values for different methods according to a specific embodiment of the invention, and it can be seen that, in addition to method [1], the method according to the invention achieves a higher reserve than the other methods.
Fig. 10 is a graph comparing image quality values of different methods in case of maximum reserve in an embodiment of the present invention, and fig. 10 is a comparison result of PSNR values of the present invention and other methods in case of maximum ER value. It can be seen that although method [1] achieves as high an ER value as the method of the present invention, the method of the present invention can maintain higher image quality, and compared to methods [2, 3, 4], the method of the present invention can achieve higher reserves than these methods although the method of the present invention has no advantage in PSNR.
Embodiments of the present invention also relate to a computer-readable storage medium having stored thereon a computer program which, when executed by a computer processor, implements the method above. The computer program comprises program code for performing the method illustrated in the flow chart. It should be noted that the computer readable medium of the present application can be a computer readable signal medium or a computer readable medium or any combination of the two.
The invention provides a reversible data hiding method and a reversible data hiding system based on double images, which are characterized in that a novel tortoise shell magic matrix is obtained by adding numerical values of '8' to element values of tortoise back points on the basis of the original tortoise shell magic matrix, the range of the element values in the matrix is expanded, the hidden quantity of hidden secret data of the matrix is increased, meanwhile, a novel reversible hiding algorithm is invented, the secret data are converted into hexadecimal numbers to be hidden in the novel tortoise shell magic matrix, and pairwise corresponding secret images are obtained; and in the stage of secret data extraction, a corresponding data extraction rule is formulated according to a novel reversible hiding algorithm to extract the secret data, and an original image is recovered. Compared with the traditional data hiding algorithm based on the image, the method has the advantage of ensuring the quality of the hidden image under the condition of higher storage capacity, so that the secret data can be hidden more safely.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (8)

1. A reversible data hiding method based on double images is characterized by comprising the following steps:
s1: constructing a matrix with a horizontal and vertical coordinate range of [0,255], enabling values of adjacent elements in the same row in the matrix to differ by 1 and sequentially increase progressively, enabling values of two adjacent even columns of elements in the same column to be more than 2 than those of odd columns and values of odd columns to be more than 3 than those of even columns, then performing modular 8 operation on the element values in the matrix to enable the element values to be between [0,7], and finally covering the matrix with a plurality of connected and spliced hexagons to obtain a tortoise shell magic matrix, wherein points in the matrix at the edges of the hexagons belong to tortoise edge points, points not at the edges of the hexagons belong to tortoise back points, and adding a numerical value of 8 to each element at the tortoise back points in the tortoise shell magic matrix to obtain a novel tortoise shell magic matrix;
s2: converting the secret information to be hidden into a string of binary numbers, and converting every 4 binary numbers into a hexadecimal number;
s3: taking a pixel p (p E [0, 255) from the original image]) Expanding the pixel p to one coordinate (p, p) if the pixel p is a coordinate (p, p)
Figure FDA0002784304170000011
And is
Figure FDA0002784304170000012
Obtaining a hexadecimal number which is marked as v from the secret information, determining a hiding range according to the position difference of the point (p, p) in the novel tortoise shell magic matrix, and finding a coordinate (p) which leads the coordinate corresponding to the value of v in the hiding range1,p2) And aligning said coordinates (p) according to a movement rule1,p2) Moving the points where the conflict exists;
s4: p is to be1Assigning to the position corresponding to the pixel p in the original image, and traversing all pixels in the original image and all hexadecimal numbers in the secret information to execute step S3 to obtain a first secret image,p is to be2Assigning the value to the position corresponding to the pixel p in the original image, and traversing all pixels in the original image and all hexadecimal numbers in the secret information to execute the step S3 to obtain a second secret image.
2. The method according to claim 1, characterized in that said determining of the hidden-in range according to the difference of the position of said point (p, p) in said new tortoise-shell magic matrix comprises the following steps: recording a point with a larger vertical coordinate in the turtle back points as an upper turtle back point, recording a point with a smaller vertical coordinate in the turtle back points as a lower turtle back point, recording three points with a minimum vertical coordinate or a vertical coordinate equal to the upper turtle back point in the turtle side points as upper turtle side points, recording three points with a maximum vertical coordinate or a vertical coordinate equal to the lower turtle back point in the turtle side points as lower turtle side points, if the pixel p belongs to the upper turtle side points or the upper turtle back points, constructing a 4 x 5 block by taking the point with the coordinate (p, p) in the novel turtle shell magic matrix as the lower right corner, deducting 4 elements in the middle upper right corner of the block, and using the remaining 16 elements to store a hexadecimal number; if the pixel p belongs to the lower turtle boundary point or the lower turtle back point, a 4 × 5 block is constructed by using (p, p) as the upper left corner, 4 elements in the lower left corner of the block are subtracted, and the remaining 16 elements are used to store one hexadecimal number.
3. The method according to claim 1, wherein the movement rules specifically include:
if the pixel p belongs to the upper turtle-edge point or the upper turtle-back point, moving the element bf of the last column of the first row and the element bs of the last column of the second row in the hidden range according to the following rule:
Figure FDA0002784304170000021
if the pixel p belongs to the lower turtle-edge point or the lower turtle-back point, the element lf of the first column of the last row and the element ls of the first column of the second last row in the hidden range are moved according to the following rule:
Figure FDA0002784304170000022
4. the method according to claim 1, wherein in step S3, if the pixel p e [0, 2]]Or p ∈ [253,255 ∈ >]Let p stand for1=p2P, and the step S4 is directly performed.
5. The method according to claim 1, further comprising the step of extracting the secret information in the image, in particular comprising:
a1: executing the step S1 to obtain the novel tortoise shell magic matrix;
a2: sequentially extracting the p from the same position of the first secret image and the second secret image1And p2Defining the difference d ═ p1-p2
A3: secret information extraction is performed according to the following rules:
(1) if d is 0 and p1And p2If the first secret image belongs to the edge point, secret information is not hidden in corresponding points in the first secret image and the second secret image; if d is 0 and p1And p2If the information does not belong to the edge point, the hidden hexadecimal secret information v is the midpoint (p) of the novel tortoise shell magic matrix1,p2) A value of (d);
(2) if d < 0, the hidden hexadecimal secret information v is obtained according to the following rule:
Figure FDA0002784304170000023
(3) if d > 0, the hidden hexadecimal secret information v is obtained according to the following rule:
Figure FDA0002784304170000031
wherein M (p)1,p2) Represents the midpoint (p) of the novel tortoise shell magic matrix1,p2) The value of (c).
6. The method according to claim 5, further comprising a step of restoring the original picture, in particular comprising performing the following original picture restoration algorithm after said steps A1-A3:
(1) if d is equal to 0, the original pixel p is equal to p1
(2) If d < 0, p can be obtained by:
Figure FDA0002784304170000032
(3) if d > 0, p can be obtained by:
Figure FDA0002784304170000033
and restoring the pixel p at the corresponding position in the original image, thereby restoring the original image.
7. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a computer processor, carries out the method of any one of claims 1 to 6.
8. A bi-image based reversible data hiding system, comprising:
novel tortoise shell magic matrix construction module: configuring a matrix with a horizontal and vertical coordinate range of [0,255], enabling values of adjacent elements in the same row in the matrix to differ by 1 and sequentially increase progressively, enabling values of two adjacent even columns of elements in the same column to be more than 2 than those of odd columns and values of odd columns to be more than 3 than those of even columns, then performing modular 8 operation on the element values in the matrix to enable the element values to be between [0,7], and finally covering the matrix with a plurality of hexagons which are connected and spliced to obtain a tortoise-shell magic matrix, wherein points in the matrix at the edge of the hexagon belong to tortoise-side points, points not at the edge of the hexagon belong to tortoise-back points, and adding a value of 8 to each element at the tortoise-back point in the tortoise-shell magic matrix to obtain a novel tortoise-shell magic matrix;
secret information preprocessing module: the device is configured to convert secret information to be hidden into a string of binary numbers, and then convert every 4 binary numbers into a hexadecimal number;
secret information hiding module: configured to take a pixel p (p e 0, 255) from the original image]) Expanding the pixel p to one coordinate (p, p) if the pixel p is a coordinate (p, p)
Figure FDA0002784304170000041
And is
Figure FDA0002784304170000042
Obtaining a hexadecimal number which is marked as v from the secret information, determining a hiding range according to the position difference of the point (p, p) in the novel tortoise shell magic matrix, and finding a coordinate (p) which leads the coordinate corresponding to the value of v in the hiding range1,p2) And aligning said coordinates (p) according to a movement rule1,p2) Moving the points where the conflict exists;
secret image generation module: is configured to couple p1Assigning to the position corresponding to the pixel p in the original image, traversing all pixels in the original image and all hexadecimal numbers in the secret information to operate a secret information hiding module to obtain a first secret image, and assigning p to the position corresponding to the pixel p in the original image2And assigning a value to a position corresponding to the pixel p in the original image, traversing all pixels in the original image and all hexadecimal numbers in the secret information, and operating a secret information hiding module to obtain a second secret image.
CN202011292406.3A 2020-11-18 2020-11-18 Reversible data hiding method and system based on double images Active CN112380551B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011292406.3A CN112380551B (en) 2020-11-18 2020-11-18 Reversible data hiding method and system based on double images

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011292406.3A CN112380551B (en) 2020-11-18 2020-11-18 Reversible data hiding method and system based on double images

Publications (2)

Publication Number Publication Date
CN112380551A true CN112380551A (en) 2021-02-19
CN112380551B CN112380551B (en) 2022-07-08

Family

ID=74584268

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011292406.3A Active CN112380551B (en) 2020-11-18 2020-11-18 Reversible data hiding method and system based on double images

Country Status (1)

Country Link
CN (1) CN112380551B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107369186A (en) * 2017-07-17 2017-11-21 西北工业大学 A kind of information concealing method and device
CN111161124A (en) * 2019-12-30 2020-05-15 福建师范大学福清分校 Image steganography method of reference matrix model based on mean square error evaluation

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107369186A (en) * 2017-07-17 2017-11-21 西北工业大学 A kind of information concealing method and device
CN111161124A (en) * 2019-12-30 2020-05-15 福建师范大学福清分校 Image steganography method of reference matrix model based on mean square error evaluation

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
XIAO-ZHU XIE ETC.: "Data Hiding Based on a Two-Layer Turtle ShellMatrix", 《SYMMETRY》 *
张亦明 等: "一种基于AES的图像篡改检测方案", 《物联网技术》 *

Also Published As

Publication number Publication date
CN112380551B (en) 2022-07-08

Similar Documents

Publication Publication Date Title
Rocha et al. Vision of the unseen: Current trends and challenges in digital image and video forensics
CN102025959B (en) The System and method for of high definition video is produced from low definition video
CN110232651B (en) Reversible information hiding method based on block prediction and differential value histogram translation
Meikap et al. Directional PVO for reversible data hiding scheme with image interpolation
CN110390623B (en) Secret sharing-based image media security authentication recovery method
Hong et al. An efficient reversible image authentication method using improved PVO and LSB substitution techniques
CN111353956B (en) Image restoration method and device, computer equipment and storage medium
CN113344826B (en) Image processing method, device, electronic equipment and storage medium
Novozámský et al. Detection of copy-move image modification using JPEG compression model
CN107346528B (en) Image tampering detection method based on double-image reversible fragile watermark
Banaeyan et al. Pyramidal connected component labeling by irregular graph pyramid
US10026009B2 (en) Methods and systems for determining a perceptual similarity between images
Lin et al. Pixel-based fragile image watermarking based on absolute moment block truncation coding
US20240005440A1 (en) Method and system for large-capacity image steganography and recovery based on invertible neural networks
Hong et al. A color image authentication scheme with grayscale invariance
Shashidhar et al. Reviewing the effectivity factor in existing techniques of image forensics
CN112380551B (en) Reversible data hiding method and system based on double images
CN115802005B (en) Security monitoring video storage method for residential building
Zheng et al. Joint residual pyramid for joint image super-resolution
CN113989092B (en) Image steganography method based on layered antagonism learning
CN115527023A (en) Image detection method, image detection device, electronic equipment and storage medium
Xiang et al. PEEL: A Provable Removal Attack on Deep Hiding
Tang et al. Reversible data hiding based on improved block selection strategy and pixel value ordering
Kunhu et al. A novel reversible watermarking scheme based on sha3 for copyright protection and integrity of satellite imagery
TWI397299B (en) Method of high capacity reversible data hiding scheme using edge prediction error

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