CN109635576B - Method and system for hiding data in image - Google Patents

Method and system for hiding data in image Download PDF

Info

Publication number
CN109635576B
CN109635576B CN201811457755.9A CN201811457755A CN109635576B CN 109635576 B CN109635576 B CN 109635576B CN 201811457755 A CN201811457755 A CN 201811457755A CN 109635576 B CN109635576 B CN 109635576B
Authority
CN
China
Prior art keywords
image
pixel
pixels
significant bit
point
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
CN201811457755.9A
Other languages
Chinese (zh)
Other versions
CN109635576A (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.)
Shenzhen Graduate School Harbin Institute of Technology
Original Assignee
Shenzhen Graduate School Harbin Institute 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 Shenzhen Graduate School Harbin Institute of Technology filed Critical Shenzhen Graduate School Harbin Institute of Technology
Priority to CN201811457755.9A priority Critical patent/CN109635576B/en
Publication of CN109635576A publication Critical patent/CN109635576A/en
Application granted granted Critical
Publication of CN109635576B publication Critical patent/CN109635576B/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
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding

Landscapes

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

Abstract

The invention discloses a method and a system for hiding data in an image, wherein the method comprises the following steps: s1, dividing an image into a plurality of image blocks, and scrambling the positions of pixels except for central pixel points or/and the image blocks in the image blocks to form an encrypted image; s2, dividing the encrypted image into a plurality of image blocks, and marking the non-central pixel points as EP or NP according to pixel difference values of the non-central pixel points and the central pixel points; s3, modifying the most significant bits of the EP and the NP to distinguish the EP and the NP, modifying the attribute value of the EP to record pixel difference, and modifying the attribute value of the EP to record data needing to be hidden. The system performs the method. The pixel difference value between the non-central pixel point and the central pixel point is used for distinguishing the pixel which is well modified from the pixel which is not suitable for modification, so that the image distortion caused in the restoration process can be avoided, the necessary information is stored through the modification of different effective bits of the pixel value so as to realize the hiding of data, and the storage capacity of the data can be improved.

Description

Method and system for hiding data in image
Technical Field
The invention relates to the technical field of data encryption, in particular to a method and a system for hiding data in an image.
Background
Image encryption and data hiding are two different techniques for protecting the privacy of digital images, the image encryption technique aims to encrypt an original plaintext image into a noisy image so that an unauthorized user cannot recognize and acquire valid information, and the data hiding technique can embed secret data to be hidden in a carrier image and make the carrier image after embedding the data undistorted (or with a low degree of distortion) so that the secret data cannot be extracted from the carrier image without a key. Reversible data hiding is a data hiding technology capable of perfectly restoring a carrier picture after secret data is extracted, and with the development and application of cloud computing, the reversible data hiding technology acting on an encrypted domain image attracts wide attention and research in recent years. The technology combines two technologies of image encryption and reversible data hiding, inherits all the advantages of the two technologies, and has application functions of privacy protection, content integrity identification, multimedia ciphertext information management and the like. Due to the technical characteristic of reversible data hiding of the encrypted domain image, the method can be applied to scenes which need to ensure the safety of digital content and high fidelity after restoration at the same time, such as: medical imaging, legal evidence collection, military use, and the like. In order to protect the privacy of the patient, a doctor encrypts a related medical image before uploading the medical image to a cloud server, and the cloud server embeds a plurality of identifications (such as picture sources and classifications) in a ciphertext image so as to manage the ciphertext image without knowing the content of the original text. An authorized user can download the relevant picture at the cloud, and then extract the data (identification) or restore the ciphertext picture without loss.
In order to ensure lossless restoration of a ciphertext image, complete recording of image information is required to be ensured when a ciphertext storage space is compressed, and a reserved space is small, so that the embedding rate of the reversible data hiding method is low under a general condition. Besides, the reversible data hiding methods applied to the encrypted domain image are broadly divided into two categories: one is to reserve a spatial position (VRAE) after encryption, and the other is to reserve a spatial position (RRBE) before encryption, the method of the RRBE structure requires additional preprocessing before image encryption, which increases the workload of an image owner, a content holder generally cannot complete excessively complicated operations and notifies a cloud service end of the operation result, which greatly increases communication cost, so the method of the RRBE structure has poor applicability. The method of the VRAE structure has good applicability, but because the image chaos degree after encryption is high and the available space is small, the embedding rate of the method is low, and excessive secret data cannot be embedded.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the related art. To this end, it is an object of the present invention to provide a method and system for hiding data in an image.
The technical scheme adopted by the invention is as follows:
a method of hiding data in an image, comprising: s1, dividing an image into a plurality of non-overlapping image blocks with odd-number square pixels, and scrambling the positions of the pixels or/and the image blocks in the image blocks to form an encrypted image; s2, dividing the encrypted image into a plurality of non-overlapping image blocks of pixels with odd-number square specifications, and marking the non-central pixel points as EP or NP according to pixel difference values of the non-central pixel points and the central pixel points, wherein the EP is an embeddable pixel point, and the NP is a non-embeddable point; s3, modifying the most significant bit of the attribute value corresponding to the EP and the NP to distinguish the EP and the NP, modifying a part of the attribute value of the EP to record the pixel difference between the EP and the central pixel point, and modifying a part of the attribute value of the EP to record the data to be hidden.
Preferably, step S1 specifically includes: the image is divided into a plurality of non-overlapping image blocks with odd square pixels, a random sequence is generated, the random sequence is sequenced, and the pixels in the image blocks or/and the positions of the image blocks are scrambled according to the sequenced index relationship to form an encrypted image, wherein the pixels in the image blocks are provided with central pixel points, and the positions of the central pixel points are not involved in scrambling.
Preferably, step S1 specifically includes: the image is divided into a plurality of non-overlapping image blocks with odd-number square pixels, the positions of the pixels and/or the image blocks in the image blocks are scrambled, and the pixel values of each image block are modified respectively to form the encrypted image.
Preferably, step S3 specifically includes: modifying the most significant bits of the attribute values corresponding to the EP and the NP to distinguish the EP from the NP, wherein the most significant bit of the EP is 1, and the most significant bit of the NP is 0; modifying a second most significant bit in the attribute value, wherein when the second most significant bit is 1, the pixel difference is represented as a non-positive value, and when the second most significant bit is 0, the pixel difference is represented as a positive value, and the non-most significant bit and a part of the second most significant bit are selected to store the value of the pixel difference; a portion of the unmodified valid bits of the EP's attribute values are modified to record the data that needs to be hidden.
Preferably, the step of generating the random sequence specifically includes: a random sequence is generated based on a random function and a preset key.
The technical scheme adopted by the invention is as follows:
a system for hiding data in an image, comprising: the image encryption device comprises a scrambling module, a storage module and a processing module, wherein the scrambling module is used for dividing an image into a plurality of non-overlapping image blocks with odd-number square pixels, and scrambling the positions of the pixels or/and the image blocks in the image blocks to form an encrypted image; the processing module is used for dividing the encrypted image into a plurality of non-overlapping image blocks of pixels with odd-number square specification, and marking the non-central pixel points as EP or NP according to the pixel difference value of the non-central pixel points and the central pixel points, wherein the EP is an embeddable pixel point, and the NP is a non-embeddable point; and the modification module is used for modifying the most significant bits of the attribute values corresponding to the EP and the NP to distinguish the EP and the NP, modifying a part of the attribute values of the EP to record the pixel difference between the EP and the central pixel point, and modifying a part of the attribute values of the EP to record the data to be hidden.
Preferably, the scrambling module is specifically configured to divide an image into a plurality of non-overlapping image blocks with odd-numbered square pixels, generate a random sequence, sort the random sequence, and scramble positions of the pixels or/and the image blocks in the image block according to the sorted index relationship to form an encrypted image, where the pixels in the image block are provided with a center pixel point, and the position of the center pixel point is not involved in scrambling.
Preferably, the scrambling module is specifically configured to divide the image into a plurality of non-overlapping image blocks with odd-square pixels, scramble the positions of the pixels or/and the image blocks in the image block, and modify the pixel value of each image block to form an encrypted image.
Preferably, the modifying module is specifically configured to modify the most significant bits of the attribute values corresponding to the EP and the NP to distinguish the EP and the NP, where the most significant bit of the EP is 1, and the most significant bit of the NP is 0; modifying a second most significant bit in the attribute value, wherein when the second most significant bit is 1, the pixel difference is represented as a non-positive value, and when the second most significant bit is 0, the pixel difference is represented as a positive value, and the non-most significant bit and a part of the second most significant bit are selected to store the value of the pixel difference; a portion of the unmodified valid bits of the EP's attribute values are modified to record the data that needs to be hidden.
Preferably, the step of generating the random sequence specifically includes: a random sequence is generated based on a random function and a preset key.
The beneficial effects of the invention are:
according to the invention, the pixel which is well modified and the pixel which is not suitable for modification are distinguished through the pixel difference value between the non-central pixel point and the central pixel point, so that the image distortion caused in the restoration process can be avoided, the necessary information is stored through the modification of different effective bits of the pixel value so as to realize the hiding of data, and the storage capacity of the data can be improved.
Drawings
FIG. 1 is a schematic diagram of a method for hiding data in an image according to the present invention;
FIG. 2 is an overall frame diagram of the present invention;
FIG. 3 is a schematic diagram of a system for hiding data in an image according to the present invention.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
Example 1
The purpose of this embodiment is to explain the solution idea of the invention.
The present example provides a method of hiding data in an image as shown in fig. 1, comprising: s1, dividing an image into a plurality of non-overlapping image blocks with odd-number square pixels, and scrambling the positions of the pixels or/and the image blocks in the image blocks to form an encrypted image; s2, dividing the encrypted image into a plurality of non-overlapping image blocks of pixels with odd-number square specifications, and marking the non-central pixel points as EP or NP according to pixel difference values of the non-central pixel points and the central pixel points, wherein the EP is an embeddable pixel point, and the NP is a non-embeddable point; and S3, modifying the most significant bit of the attribute values corresponding to the EP and the NP (namely binary data corresponding to the pixel value of the pixel point) to distinguish the EP and the NP, modifying a part of the attribute values of the EP to record the pixel difference between the EP and the central pixel point, and modifying a part of the attribute values of the EP to record data needing to be hidden. The method comprises the following specific steps of scrambling and modifying:
scrambling stage: a1, dividing an original plaintext image into odd-square (3 × 3 in this embodiment, which aims to have an obvious central pixel easy to locate and determine in an image block, regardless of a specific shape, in this embodiment, since an image block whose number of pixels is an odd square has higher efficiency and lower difficulty in an actual image block than an irregular image block and an even-square image block, a (preset) key is used as a control parameter, a random sequence is generated by using a chaotic system or other random functions, the random sequence is ordered, and an index relationship before and after the random sequence is ordered can determine a replacement rule of the image block, thereby completing image block scrambling (specifically, other replacement rules can also be adopted, which aims to require a controllable replacement rule to complete image block scrambling).
a2, generating a random sequence ordering by using a chaotic system, and then scrambling pixels in each image block according to an index relationship, but keeping the position of a central point (central pixel point) of each image block unchanged (only replacing the image block or only replacing the pixels in the image block, but the embodiment is a combination of the two).
a3, after the inter-block scrambling and the intra-block scrambling are completed, each image block is respectively added with a random number to uniformly change the pixel values in the image block (the purpose is to increase the confidentiality), and the random number sequence can still be obtained by a chaotic system or other random functions by taking a key as a control parameter (namely, the key is taken as input and is processed by the random functions to output the random number sequence).
In the data embedding stage (i.e., modification stage), the pixel relevance coding can be performed on the pixels (except for the central point) in each image block by using the pixel relevance (i.e., scrambled pre-and post-relevance) reserved in the ciphertext image, and the pixel value information storage space is compressed, so that the space is saved for embedding the data to be hidden, and the specific steps are as follows:
and b1, dividing the encrypted ciphertext image into 3 multiplied by 3 non-overlapping ciphertext image blocks, and classifying pixel points in each image block firstly. Setting a central pixel point of an image block (in the image block with an odd number square specification, the central pixel point is a central point of physical significance, or the position of the center of a circumscribed circle of the image block) as a reference pixel point (RP), and classifying other 8 pixel points in the image block into embeddable pixel points (EP) or non-embeddable pixel points (NP); assume that the jth pixel point value in the ith pixel block is
Figure GDA0003990306240000041
The RP point of each image block is a central point
Figure GDA0003990306240000042
Difference in pixel value between two points is
Figure GDA0003990306240000043
If e is more than or equal to-7 and less than or equal to 7, the jth point belongs to the EP point (namely, the mark is determined according to the pixel difference), otherwise, the jth point is the NP point.
And b2, after classifying all the pixel points in the image block, carrying out pixel correlation coding. The value (attribute value) of a pixel is generally represented by 8 bits (significant bits), and first, in order to distinguish EP from NP, the 8 th bit (most significant bit) is marked with "1" and "0" respectively to indicate that the pixel is an EP point or an NP point, and "1" is defined to indicate that the point is an EP point and "0" indicates that the point is an NP point. The RP point is a point where the reference point does not need to be changed in all encoding processes, the NP point is a point where embedding is impossible, only the most significant bit needs to be marked, the following bit does not need to be changed, and the original most significant bit value of the NP point is recorded to be embedded into ciphertext along with data to be embedded.
b3, marking the 7 th bit (second most significant bit) of the EP point, representing that the difference of the pixel values of the point and the RP point is positive or negative, and defining that "1" represents that the difference e of the pixel values is less than or equal to 0, and "0" represents that the difference e of the pixel values is more than 0.
b4, recording the absolute value | e | of the difference between the pixel values of the change point and the RP point by using the 4 th bit to the 6 th bit of the EP point, wherein 3 bits can represent decimal numbers of 0-7.
And b5, embedding the load (including the data to be embedded and the original most significant bit of the NP point of all the image blocks) into the 1 st to 3 rd bits (the last 3 bits) of the EP point.
The modification position of the specific effective bit can be changed according to actual needs.
Example 2
This example provides a detailed example based on example 1.
Fig. 2 is an overall frame diagram of the proposed scheme of the present invention, and the encryption domain image reversible data hiding method based on pixel correlation coding includes three working stages, which are respectively: the method comprises an image encryption stage, a data embedding stage and an image restoration and data extraction stage: image encryption phase, using the secret key K e Encrypting the image, and preserving the information redundancy among the pixel points in the divided small image blocks while encrypting the original plaintext image; data embedding phase, using secret key K h Original data are encrypted, secret data can be embedded into a ciphertext image by utilizing pixel correlation codes, and each embeddable pixel point in the ciphertext image can be embedded into 3-bit data, so that the embedding rate is extremely high; image restoration and data extraction stages, holding corresponding key K e Or K h The image decryption and the secret information can be respectively carried out, the two processes are not influenced mutually, the decrypted image has no distortion phenomenon, and the secret information and the ciphertext image can be restored in a lossless mode. The method comprises the following specific steps:
a1, dividing an original plaintext image with the size of M multiplied by N into 3 multiplied by 3 non-overlapped image blocks, and utilizing a one-dimensional Logistic chaotic system, wherein X (N + 1) = u X X (N) × [1-X (N)],n=0.1.2·K, generating a set of lengths of
Figure GDA0003990306240000051
Wherein the control parameter u and the initial value X (0) are derived from the secret key K e Determining, ordering X for the random sequence X sort = sort (X), recording index relation sequence U, let X sort (i) = X (U (i)), scrambling image blocks according to an index relation sequence, rearranging image blocks at positions recorded in the sequence U, thereby completing image block scrambling; let B i Representing the ith image block of plaintext, let P i =B U(i) ,P i The image block is represented as the ith image block in the scrambled image, the correlation of adjacent pixel points in the image block cannot be disturbed when the pixel scrambling of the image block is encrypted, and the spatial position of a reserved position can be utilized by utilizing the pixel correlation in the stage of embedding data, so that the secret data can be embedded.
a2, by using the chaotic system mentioned in a1, performing position scrambling on pixels in each image block by the same method, and simultaneously keeping the position of the central point of each image block unchanged, wherein the relevance of the central point and the peripheral points cannot be changed as long as the two points are adjacent, so that the pixel replacement in the image block cannot damage the pixel relevance as long as the position of the central point is kept unchanged, and the image encryption safety performance can be improved.
and a3, after the inter-block scrambling and the intra-block scrambling are finished, each image block is respectively added with a random number to uniformly change the pixel value in the image block, and the random numbers can be obtained by a chaotic system or other random functions by taking a key as a control parameter. Setting the ith image block in the image after the scrambling in the steps a1 and a2 as D i Let us order
Figure GDA0003990306240000061
Wherein
Figure GDA0003990306240000062
Represents D i J-th pixel point of (1), R i Is a random number and has a value of 0,255]Uniformly changing the image of an image block within a section by using a random numberThe intensity of the pixel does not affect the internal pixel correlation because the difference between the pixel values does not change, and the image encryption security is further improved.
The division of the image into 3 x 3 (pixel) image blocks aims at making full use of a central point f 5 And all peripheral pixels f 1 ~f 9 Therefore, 1 image block whose center point is surrounded by 8 adjacent points can utilize the pixel relevance reserved in the ciphertext image block to the maximum extent, the pixel relevance coding can be performed on the pixels (except the center point) in each image block in the data embedding stage, and the pixel value information storage space is compressed, so that the space for embedding the data to be hidden is saved, and the specific process is as follows:
b1, the encrypted ciphertext image is equally divided into 3 multiplied by 3 (pixel) non-overlapping ciphertext image blocks, and pixel points in each image block are firstly classified. Setting a central pixel f of an image block 5 For Reference Pixels (RP), the other 8 pixels in the image block can be classified as Embeddable Pixels (EP) or non-embeddable pixels (NP). Assume that the jth pixel point value in the ith pixel block is
Figure GDA0003990306240000063
The RP point of each image block is a central point
Figure GDA0003990306240000064
Difference in pixel value between two points is
Figure GDA0003990306240000065
When-7. Ltoreq. E.ltoreq.7 then the jth point belongs to EP, otherwise it is the NP point, e.g. f 5 The pixel value is 128,f 1 The pixel value is 125,f 1 -f 5 =-3∈[-7,7]Thus f is 1 Is an EP point. Suppose f 2 The value of the pixel is 136 and,
Figure GDA0003990306240000066
thus f 2 Is the NP point.
b2, classifying all the pixel points in the image block, and then carrying outAnd (4) pixel correlation coding. The value of a pixel is generally represented by 8 bits, and first, in order to distinguish EP from NP, the 8 th bit (most significant bit) is marked with "1" and "0" respectively to indicate that the pixel is an EP point or an NP point, and "1" is defined to indicate that the pixel is an EP point and "0" indicates that the pixel is an NP point. The RP point is a point which does not need to be changed in all encoding processes, the NP point is a point which can not be embedded, only the most significant bit needs to be marked, the subsequent bit does not need to be changed, and the original most significant bit value of the NP point is recorded to be embedded into the ciphertext along with the data to be embedded. With f 1 And f 2 For example, according to the pixel value set in b1, the corresponding binary number is f 1 =(01111101) 2 And f 2 =(10001000) 2 。f 1 Is the EP point, modifies the most significant bit to the binary number f 1 =(11111101) 2 ,f 2 Is NP point, the binary number after modifying the most significant bit is f 2 =(00001000) 2
b3, marking the 7 th bit of the EP point, representing that the difference of the pixel values of the point and the RP point is positive or negative, and defining that "1" represents the difference e of the pixel values less than or equal to 0, and "0" represents the difference e of the pixel values>0. At EP point f 1 For example, f after step b2 1 =(11111101) 2 In this step, f should be maintained 1 =(11111101) 2 And is not changed.
b4, recording the absolute value | e | of the difference between the pixel values of the change point and the RP point by using the 4 th bit to the 6 th bit of the EP point, wherein 3 bits can represent 0 to 7 decimal numbers and the EP point f is still used 1 For example, f after step b3 1 =(11111101) 2 Since original | e | = | f 1 -f 5 A binary number of | = | -3| =3,3 is (011) 2 Thus modified f 1 =(11011101) 2
b5, embedding loads (including data to be embedded and original most significant bits of NP points of all image blocks, wherein the original most significant bits of the NP points are used for restoring) into 1-3 bit (last 3 bit) of the EP points. EP point f 1 The last three bits of the data can be replaced by payload information (i.e., information to be hidden), and each EP point can provide 3-bit embedding positions, so that the embedding rate is highGreatly improved.
Image restoration and data extraction stages, holding corresponding key K e Or K h The image restoration or data extraction can be performed without affecting each other, and the decoding process includes:
(1) Data extraction: scanning all pixel points (except RP points), extracting load information from the last 3 bits of all EP points (the most significant bit is marked as '1'), and recording the number of the EP points as N 1 And the number of NP points (the most significant bit is marked as "0") is recorded as N 2 First N of extracted load information 2 bit is the original value of the most significant bit of all NP points, nth 2 +1 bit to 3N bit 1 The bit is the embedded secret data. In order, the effective embedding rate E = (3N) can be calculated 1 -N 2 ) /MN, (bpp, i.e. pixels), where MN represents the number of all pixels in the image, followed by the use of a (preset) key K h The extracted secret data can be decrypted to obtain the hidden information. The data extraction process does not require knowledge of the original image content and does not require the recipient to provide the secret key K e
(2) And (3) image restoration: the first N extracted from the load can be known from (1) 2 The bit information can restore all encrypted NP points, for the EP point, the pixel value difference e of the EP point and the RP point can be calculated by the 7 th bit and 4-6 bit data, and the pixel value of the RP point plus the e value is the encrypted pixel value of the EP point. At EP point f 1 For example, after step f of b5 1 Embedding unknown data, whose binary number representation is f1= (11011 XXX) 2 XXX represents an unknown sequence; according to the 7 th bit being "1", e is less than or equal to 0,4 to 6 bits are (011) 2 It can be known that | e | =3,f 1 -f 5 = e = -3, and RP point f 5 =128, from which f can be reduced 1 = -3+128=125. After all the pixel values of the EP points and the NP points are calculated, a complete ciphertext image without embedded data is restored, and then a decryption key K is utilized e The original plaintext image can be obtained by performing decryption (the inverse operation of the encryption operation), and the decryption steps are as follows:
d1, dividing the ciphertext image with the size of M multiplied by N into 3 multiplied by 3 non-overlapping image blocksThe ith image block in the text image is E i Let us order
Figure GDA0003990306240000081
Wherein
Figure GDA0003990306240000082
Represents E i J-th pixel point of (1), R i Is a random number generated by the decryption key control and has a value of 0,255]Within the interval.
D2, orderly carrying out the inverse operation of the steps a2 and a1, and utilizing the same chaotic system and the secret key K e Generating the same random sequence, carrying out inverse scrambling on pixels in the image block, then carrying out inverse scrambling on the position of the image block in the image, and then restoring the complete original plaintext image.
Example 3
The present embodiment provides a system for hiding data in an image as shown in fig. 3, including: the image encryption device comprises a scrambling module 1, a storage module and a processing module, wherein the scrambling module 1 is used for dividing an image into a plurality of non-overlapping image blocks with odd-number square pixels, and scrambling the positions of the pixels or/and the image blocks in the image blocks to form an encrypted image; the processing module 2 is used for dividing the encrypted image into a plurality of non-overlapping image blocks with odd-number square specification, and marking the non-central pixel points as EP or NP according to the pixel difference value of the non-central pixel points and the central pixel points, wherein the EP is an embeddable pixel point, and the NP is a non-embeddable point; and the modification module 3 is used for modifying the most significant bits of the attribute values corresponding to the EP and the NP to distinguish the EP and the NP, modifying a part of the attribute values of the EP to record the pixel difference between the EP and the central pixel point, and modifying a part of the attribute values of the EP to record the data to be hidden.
While the preferred embodiments of the present invention have been illustrated and described, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A method for hiding data in an image, comprising:
s1, dividing an image into a plurality of non-overlapping image blocks with odd-number square specification, and scrambling the positions of pixels except for a central pixel point or/and the image blocks in the image blocks to form an encrypted image;
s2, dividing the encrypted image into a plurality of non-overlapping image blocks of pixels with odd-number square specifications, and marking the non-central pixel points as EP or NP according to pixel difference values of the non-central pixel points and the central pixel points, wherein the EP is an embeddable pixel point, and the NP is a non-embeddable point;
s3, modifying the most significant bit of the attribute value corresponding to the EP and the NP to distinguish the EP and the NP, modifying a part of the attribute value of the EP to record the pixel difference between the EP and the central pixel point, and modifying a part of the attribute value of the EP to record the data to be hidden.
2. The method according to claim 1, wherein the step S1 specifically comprises:
the image is divided into a plurality of non-overlapping image blocks with odd-number square pixel specification, a random sequence is generated, the random sequence is sequenced, and the pixels in the image blocks or/and the positions of the image blocks are scrambled according to the sequenced index relation to form an encrypted image, wherein the pixels in the image blocks are provided with central pixel points, and the positions of the central pixel points are not involved in scrambling.
3. The method according to claim 1, wherein the step S1 specifically comprises:
the image is divided into a plurality of non-overlapping image blocks with odd square pixels, the positions of the pixels or/and the image blocks except for the central pixel point in the image blocks are scrambled, and the pixel value of each image block is modified respectively to form an encrypted image.
4. The method according to claim 1, wherein the step S3 specifically comprises:
modifying the most significant bits of the attribute values corresponding to the EP and the NP to distinguish the EP from the NP, wherein the most significant bit of the EP is 1, and the most significant bit of the NP is 0;
modifying a second most significant bit in the attribute value, wherein when the second most significant bit is 1, the pixel difference is represented as a non-positive value, and when the second most significant bit is 0, the pixel difference is represented as a positive value, and the non-most significant bit and a part of the second most significant bit are selected to store the value of the pixel difference;
a portion of the unmodified valid bits of the EP's attribute values are modified to record the data that needs to be hidden.
5. The method according to claim 2, wherein the step of generating the random sequence specifically comprises:
and generating a random sequence based on the random function and a preset secret key.
6. A system for hiding data in an image, comprising:
the scrambling module is used for dividing the image into a plurality of non-overlapping image blocks with odd square pixels, and scrambling the positions of the pixels or/and the image blocks except the central pixel point in the image blocks to form an encrypted image;
the processing module is used for dividing the encrypted image into a plurality of non-overlapping image blocks of pixels with the specification of odd number square, and marking the non-central pixel points as EP or NP according to the pixel difference value of the non-central pixel points and the central pixel points, wherein the EP is an embeddable pixel point, and the NP is a non-embeddable point;
and the modification module is used for modifying the most significant bits of the attribute values corresponding to the EP and the NP to distinguish the EP and the NP, modifying a part of the attribute values of the EP to record the pixel difference between the EP and the central pixel point, and modifying a part of the attribute values of the EP to record the data to be hidden.
7. The system according to claim 6, wherein the scrambling module is specifically configured to divide the image into a plurality of non-overlapping image blocks with odd-numbered square pixels, generate a random sequence, sort the random sequence, and scramble positions of the pixels and/or the image blocks in the image block according to the sorted index relationship to form an encrypted image, wherein the pixels in the image block are provided with center pixels, and the positions of the center pixels are not involved in the scrambling.
8. The system according to claim 6, wherein the scrambling module is specifically configured to divide the image into a plurality of non-overlapping image blocks with odd-squared pixels, scramble positions of pixels other than the central pixel point in the image block or/and the image block, and modify pixel values of each image block respectively to form the encrypted image.
9. A system for hiding data in an image as claimed in claim 6, wherein said modifying module is specifically configured to modify the most significant bits of the attribute values corresponding to EP and NP to distinguish between EP and NP, wherein the most significant bit of EP is 1, the most significant bit of NP is 0;
modifying a second most significant bit in the attribute value, wherein when the second most significant bit is 1, the pixel difference is represented as a non-positive value, and when the second most significant bit is 0, the pixel difference is represented as a positive value, and the non-most significant bit and a part of the second most significant bit are selected to store the value of the pixel difference;
a portion of the unmodified valid bits of the EP's attribute values are modified to record the data that needs to be hidden.
10. The system for hiding data in an image according to claim 7, wherein the step of generating a random sequence specifically comprises:
a random sequence is generated based on a random function and a preset key.
CN201811457755.9A 2018-11-30 2018-11-30 Method and system for hiding data in image Active CN109635576B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811457755.9A CN109635576B (en) 2018-11-30 2018-11-30 Method and system for hiding data in image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811457755.9A CN109635576B (en) 2018-11-30 2018-11-30 Method and system for hiding data in image

Publications (2)

Publication Number Publication Date
CN109635576A CN109635576A (en) 2019-04-16
CN109635576B true CN109635576B (en) 2023-03-21

Family

ID=66070439

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811457755.9A Active CN109635576B (en) 2018-11-30 2018-11-30 Method and system for hiding data in image

Country Status (1)

Country Link
CN (1) CN109635576B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112035847B (en) * 2019-06-03 2023-10-27 湖北微模式科技发展有限公司 Image encryption and decryption methods and devices, electronic equipment and storage medium
CN111260532B (en) * 2020-01-10 2023-04-28 中移(杭州)信息技术有限公司 Privacy image encryption method, device, electronic equipment and computer readable storage medium
CN111970507B (en) * 2020-08-26 2022-02-18 安徽大学 Reversible data hiding method of ciphertext domain image based on pixel difference coding
CN114997843A (en) * 2022-08-03 2022-09-02 清华大学苏州汽车研究院(吴江) Enterprise operation management information storage system
CN117313142A (en) * 2023-09-13 2023-12-29 哈尔滨工业大学重庆研究院 Video face privacy protection method based on image steganography
CN117499872B (en) * 2023-10-25 2024-04-30 北京金信瑞通科技股份有限公司 Method and system for realizing short message sending platform

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107809644A (en) * 2017-10-26 2018-03-16 宁波工程学院 A kind of encryption area image reversible data concealing method of double-encryption
CN108537049A (en) * 2018-03-14 2018-09-14 中山大学 A kind of adaptive steganographic algorithm based on bianry image

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105160694B (en) * 2015-10-15 2017-05-03 深圳大学 Data hiding method and data hiding system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107809644A (en) * 2017-10-26 2018-03-16 宁波工程学院 A kind of encryption area image reversible data concealing method of double-encryption
CN108537049A (en) * 2018-03-14 2018-09-14 中山大学 A kind of adaptive steganographic algorithm based on bianry image

Non-Patent Citations (6)

* Cited by examiner, † Cited by third party
Title
2D Logistic-Sine-coupling map for image encryption;Zhongyun Hua et;《Signal Processing》;20180801;第148-161页 *
Reversible Data Hiding in Encrypted Image;Xinpeng Zhang;《IEEE SIGNAL PROCESSING LETTERS》;20110531;第18卷(第4期);第255-258页 *
基于图像块分组的加密域可逆信息隐藏;程航等;《北京工业大学学报》;20160510;第42卷(第05期);第722-728页 *
基于图像块动态参照像素的无损信息隐藏算法;曾宪庭等;《电信科学》;20120131;第28卷(第01期);第102-108页 *
基于图像相邻像素差值的隐写分析;张雅琴等;《微计算机信息》;20080325;第24卷(第09期);第74-76页 *
基于非对称直方图修改的可逆信息隐藏方案;吕志恒等;《网络与信息安全学报》;20180515;第4卷(第05期);第69-75页 *

Also Published As

Publication number Publication date
CN109635576A (en) 2019-04-16

Similar Documents

Publication Publication Date Title
CN109635576B (en) Method and system for hiding data in image
Saha et al. Steganographic techniques of data hiding using digital images
CN109800585B (en) Image interpolation space completely reversible separable ciphertext domain information hiding algorithm
CN109803142B (en) Encrypted domain image reversible data hiding method based on neighborhood prediction
Dragoi et al. On the security of reversible data hiding in encrypted images by MSB prediction
CN112040086A (en) Image encryption and decryption method and device, equipment and readable storage medium
Kanzariya Nitin et al. Comparison of various images steganography techniques
Rejani et al. Pixel pattern based steganography on images
CN110110535A (en) A kind of low distortion steganography method based on picture element matrix
CN113114869A (en) Ciphertext domain high-capacity image reversible data hiding method based on MSB prediction
CN114553589B (en) Cloud file secure transmission method based on multi-stage encryption
Kazi et al. A novel approach to Steganography using pixel-based algorithm in image hiding
CN112035847A (en) Image encryption and decryption method and device, electronic equipment and storage medium
Rajput et al. A novel approach for image steganography based on LSB technique
Dhane et al. A novel high capacity reversible data hiding through encryption scheme by permuting encryption key and entropy analysis
Lin et al. Reversible Data Hiding in Encrypted Images Based on Bit-plane Block Embedding.
CN113206926B (en) Method for balancing privacy and usability of image based on three-pixel-point encryption
KR970005596B1 (en) Method for encrypting and decryting digital information
Xu et al. A Steganography Based on Optimal Multi-Threshold Block Labeling.
Choi et al. Adaptive image encryption for high capacity reversible data hiding
Rejani et al. STEGANODB-A Secure Database using Steganography
Walidaniy et al. Improvement of PSNR by Using Shannon-Fano Compression Technique in AES-LSB StegoCrypto
Dhannoon An indirect MSB data hiding technique
Devi et al. Novel secured reversible covert communication over encrypted domain using SVM classifier
Aiswaria et al. Reversible image data hiding with contrast enhancement

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
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Hua Zhongyun

Inventor after: Xu Binhui

Inventor after: Huang Hejiao

Inventor after: Xu Guoai

Inventor before: Hua Zhongyun

Inventor before: Xu Binhui

Inventor before: Huang Hejiao