CN109286819B - Joint compression explicit image encryption and decryption method and device - Google Patents

Joint compression explicit image encryption and decryption method and device Download PDF

Info

Publication number
CN109286819B
CN109286819B CN201811239623.9A CN201811239623A CN109286819B CN 109286819 B CN109286819 B CN 109286819B CN 201811239623 A CN201811239623 A CN 201811239623A CN 109286819 B CN109286819 B CN 109286819B
Authority
CN
China
Prior art keywords
image
vector
dimensional vector
compressed
replacement
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
CN201811239623.9A
Other languages
Chinese (zh)
Other versions
CN109286819A (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.)
Hubei Engineering University
Original Assignee
Hubei Engineering University
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 Hubei Engineering University filed Critical Hubei Engineering University
Priority to CN201811239623.9A priority Critical patent/CN109286819B/en
Publication of CN109286819A publication Critical patent/CN109286819A/en
Application granted granted Critical
Publication of CN109286819B publication Critical patent/CN109286819B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression
    • H04N19/88Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression involving rearrangement of data among different coding units, e.g. shuffling, interleaving, scrambling or permutation of pixel data or permutation of transform coefficient data among different blocks
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/46Embedding additional information in the video signal during the compression process
    • H04N19/463Embedding additional information in the video signal during the compression process by compressing encoding parameters before transmission
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/46Embedding additional information in the video signal during the compression process
    • H04N19/467Embedding additional information in the video signal during the compression process characterised by the embedded information being invisible, e.g. watermarking

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (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)
  • Health & Medical Sciences (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)

Abstract

The invention provides a joint compression explicit image encryption and decryption method and device, and belongs to the technical field of image protection. The method comprises the following steps: acquiring a target image and a host image; performing image scrambling on the target image to obtain a scrambled image; replacing the scrambled image to obtain a replaced image; compressing the replacement image to obtain a compressed image; and hiding the compressed image into the host image to obtain an encrypted image. The invention compresses the replaced image, so that the image is easy to hide, and the risk of leakage and attack of the encrypted image in the transmission process is reduced.

Description

Joint compression explicit image encryption and decryption method and device
Technical Field
The invention relates to the technical field of image protection, in particular to a joint compression explicit image encryption and decryption method and device.
Background
In the actual operation, the two-dimensional image is generally converted into one-dimensional data, and then encrypted by adopting a traditional encryption algorithm. Unlike ordinary text information, images and videos have temporal, spatial, visual perceptibility and lossy compression properties, and these properties make it possible to design more efficient and secure encryption algorithms for images. The technological development and the rise of the hidden image result from the embedding of the digital watermark so that intellectual property rights can be better maintained. The hidden image technology can hide the information of the image, so that the effect of image encryption can be achieved.
Currently, most image encryption algorithms protect the original image by converting it into a texture-like or noise-like encrypted image with an almost uniform distribution of pixel values. Thus, the encrypted image can withstand different types of attacks, protecting the original image information with a high level of security. However, the texture-like or noise-like features of the encrypted image are obvious visual symbols that are likely to attract more people's attention, thereby bringing about attacks and cryptanalysis, increasing the risk of information leakage, loss, or change.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a method and an apparatus for encrypting and decrypting an explicit image by joint compression, which compress a replaced image to make the image easy to be hidden, and reduce the risk of leakage and attack of the encrypted image in the transmission process.
In a first aspect, an embodiment of the present invention provides an explicit image encryption method for joint compression, where the method includes:
acquiring a target image and a host image;
performing image scrambling on the target image to obtain a scrambled image;
replacing the scrambled image to obtain a replaced image;
compressing the replacement image to obtain a compressed image;
and hiding the compressed image into the host image to obtain an encrypted image.
With reference to the first aspect, an embodiment of the present invention provides a first possible implementation manner of the first aspect, where the performing image scrambling on the target image to obtain a scrambled image specifically includes:
disturbing the pixel position of the target image according to the Ernong mapping to obtain a disordered image;
dividing the disordered image into four regions, and performing Arnold transformation on each region of the disordered image to obtain a transformed image;
and carrying out Hash table mapping on the first one-dimensional vector converted from the transformed image to obtain a second one-dimensional vector, and restoring the second one-dimensional vector into a matrix to obtain a scrambled image.
With reference to the first aspect, an embodiment of the present invention provides a second possible implementation manner of the first aspect, where the replacing the scrambled image to obtain a replaced image specifically includes:
performing XOR operation on the third one-dimensional vector converted from the scrambled image from back to front to obtain a fourth one-dimensional vector;
and restoring the fourth one-dimensional vector into a matrix to obtain a replacement image.
With reference to the first aspect, an embodiment of the present invention provides a third possible implementation manner of the first aspect, where the compressing the replacement image to obtain a compressed image specifically includes:
compressing the replacement image data by using the Chinese remainder theorem to obtain compressed data;
and storing the compressed data into an image format to obtain a compressed image.
With reference to the first aspect, an embodiment of the present invention provides a fourth possible implementation manner of the first aspect, where the hiding the compressed image into the host image to obtain an encrypted image specifically includes:
decomposing the host image into a horizontal component vector and a diagonal component vector according to discrete wavelet transform;
processing the compressed image and splitting the compressed image into a high partial vector and a low partial vector;
replacing the horizontal component vector and the diagonal component vector in the host image with the high partial vector and the low partial vector respectively to obtain a replaced image;
and restoring the horizontal component vector and the diagonal component vector of the replacement image, and carrying out image reconstruction to obtain an encrypted image.
In a second aspect, an embodiment of the present invention provides an image decryption method, where the method includes:
acquiring an encrypted image;
extracting the compressed image from the encrypted image;
decompressing the compressed image according to the Chinese remainder theorem to obtain a replacement image;
carrying out reverse replacement on the replacement image to obtain a scrambled image;
and carrying out reverse scrambling on the scrambled image to obtain a target image.
With reference to the second aspect, an embodiment of the present invention provides a first possible implementation manner of the second aspect, where the inverse scrambling is performed on the scrambled image to obtain a target image, specifically including:
and respectively carrying out inverse processes of Hash table mapping, Arnold transformation and Ernon mapping on the scrambled image to obtain a restored target image.
In a third aspect, an embodiment of the present invention provides an explicit image encryption apparatus for joint compression, where the apparatus includes:
the acquisition module is used for acquiring a target image and a host image;
the scrambling module is used for carrying out image scrambling on the target image to obtain a scrambled image;
the replacement module is used for replacing the scrambled image to obtain a replacement image;
the compression module is used for compressing the replacement image to obtain a compressed image;
and the hiding module is used for hiding the compressed image into the host image to obtain an encrypted image.
With reference to the third aspect, an embodiment of the present invention provides a first possible implementation manner of the third aspect, where the scrambling module includes:
the disordering unit is used for disordering the pixel position of the target image according to the Ernong mapping to obtain a disordering image;
the transformation unit is used for dividing the disordered image into four regions, and performing Arnold transformation on each region of the disordered image to obtain a transformed image;
and the mapping unit is used for carrying out hash table mapping on the first one-dimensional vector converted from the transformed image to obtain a second one-dimensional vector, and restoring the second one-dimensional vector into a matrix to obtain a scrambled image.
In a fourth aspect, an embodiment of the present invention provides an image decryption apparatus, where the apparatus includes:
the acquisition module is used for acquiring the encrypted image;
an extraction module for extracting the compressed image from the encrypted image;
the decompression module is used for decompressing the compressed image according to the Chinese remainder theorem to obtain a replacement image;
the reverse replacement module is used for performing reverse replacement on the replacement image to obtain a scrambled image;
and the inverse scrambling module is used for carrying out inverse scrambling on the scrambled image to obtain a target image.
The embodiment of the invention has the following beneficial effects: the embodiment of the invention provides a joint compression explicit image encryption and decryption method and device. In the method, a target image and a host image are obtained firstly; then, carrying out image scrambling on the target image to obtain a scrambled image; then, replacing the scrambled image to obtain a replaced image; then compressing the replacement image to obtain a compressed image; and finally, hiding the compressed image into the host image to obtain an encrypted image. The method includes the steps of firstly scrambling a target image, then replacing the scrambled image, and then compressing the replaced image, so that the image is easy to hide, and the risks of leakage and attack of the encrypted image in the transmission process are reduced.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the invention as set forth above.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of an explicit image encryption method with joint compression according to an embodiment of the present invention;
FIGS. 2a and 2b are a target image and a gray histogram thereof provided by an image encryption experiment in an embodiment of the present invention;
fig. 3 is a flowchart of image scrambling according to an embodiment of the present invention;
FIGS. 4a and 4b are diagrams of an image scrambling experiment provided by an image encryption experiment in an embodiment of the present invention;
FIG. 5 is a flowchart of an image replacement method according to an embodiment of the present invention;
FIGS. 6a and 6b are diagrams of image replacement experiments provided by an image encryption experiment in an embodiment of the present invention;
FIG. 7 is a flowchart of image compression according to an embodiment of the present invention;
FIGS. 8a and 8b are graphs of image compression experiments provided by an image encryption experiment in an embodiment of the present invention;
FIG. 9 is a flowchart of an image hiding method according to an embodiment of the present invention;
10a, 10b, 10c, 10d and 10e are graphs of image hiding experiments provided by an image encryption experiment in the embodiment of the present invention;
fig. 11 is a flowchart of an image decryption method according to a second embodiment of the present invention;
fig. 12 is a structural diagram of an explicit image encryption apparatus with joint compression according to a third embodiment of the present invention;
fig. 13 is a structural diagram of an image decryption apparatus according to a fourth embodiment of the present invention.
Icon: 31-an acquisition module; 32-a scrambling module; 33-a permutation module; 34-a compression module; 35-hidden module; 41-an acquisition module; 42-an extraction module; 43-a decompression module; 44-an inverse permutation module; 45-reverse scramble module.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
At present, texture-like or noise-like features of an encrypted image are obvious visual symbols, and are easy to attract attention of more people, so that attack and cryptanalysis are brought, and the risk of information leakage, loss or change is increased. Based on this, the explicit image encryption and decryption method and apparatus for joint compression provided by the embodiments of the present invention can be applied to encryption and hiding of images.
For the convenience of understanding the present embodiment, a detailed description will be first given of an image encryption and hiding method disclosed in the present embodiment.
The first embodiment is as follows:
an embodiment of the present invention provides an explicit image encryption method for joint compression, as shown in fig. 1, the method includes the following steps:
s101: and acquiring a target image and a host image.
As shown in fig. 2, an image to be encrypted, which is an image that needs to be protected from image leakage, is acquired as a target image. And acquiring a host image with a normal appearance as an image for hiding the image to be encrypted, wherein the host image and the target image have the same size.
For example, to verify the effectiveness of this method, an image encryption experiment was performed with fig. 2a as the target image and fig. 2b as the gray histogram of the target image.
S102: and carrying out image scrambling on the target image to obtain a scrambled image.
As a preferable scheme, the step S102 specifically includes the following steps (as shown in fig. 3):
s1021: and disturbing the pixel position of the target image according to the Ernong mapping to obtain a disorder image.
An input target image (of size M × N) is first divided into R non-overlapping blocks, each of which is of size block M × block N, and thus M × N is block M × block N × R. The blocks are sequentially taken out from the upper left corner, from left to right and from top to bottom, and are stored in matrix blocks, the block taken out firstly is placed at the first position of the matrix, an R multiplied by block M multiplied by block N matrix can be obtained, and the matrix block keeps each block divided by a target image.
The Ernon mapping may be based on the position p (x) of a given point in the planen,yn) Mapping conversion is carried out to obtain a new position p (x)n+1,yn+1) The following equation may be used to describe:
Figure GDA0003059041480000071
yn+1=bxn
parameters a and b are set, and when a is 1.4 and b is 0.3, the Ernon mapping shows chaotic behavior. Then by giving an initial variable x0And y0Performing R times of iterative operation to obtain a 1 xR matrix MH, then performing proper scaling on the values in the matrix, and performing remainder operation on the finally obtained values, wherein all the values in the matrix do not exceed the range of 1-R after the operation. Although the matrix MH appears chaotic and irregular, it is only necessary to not change the initial variable x in the operation0And y0The sequence can be restored without any error. By using the property, the originally ordered numerical values can be disordered.
Reordering the sequence of blocks in matrix blocks according to the sequence of a median of a matrix MH, reading the value of the matrix MH in sequence, respectively using the index i of the MH and the value of the MH at the position of the index i as new indexes, exchanging the positions of the two blocks in the matrix blocks to finally obtain a new matrix newBlocks, wherein the sequence of the square blocks in the matrix blocks is changed. For example: MH [11] ═ 27, then the 11 th position block is swapped with the 27 th position block in blocks. The squares saved in the matrix newBlocks are restored to an mxn image, and the resulting scrambled image is an image with pixel positions scrambled.
S1022: and dividing the disordered image into four areas, and independently performing Arnold transformation on each area of the disordered image to obtain a transformed image.
The disordered image is equally divided into four squares, and Arnold transformation is performed on each block of the disordered image separately. And calculating the sum Q of all pixel point values in the square, calculating the conversion period T of the square, calculating the iteration number U as mod (Q, T), and performing U times of conversion on each pixel position in the square to obtain a conversion image.
S1023: and carrying out Hash table mapping on the first one-dimensional vector converted from the transformed image to obtain a second one-dimensional vector, and restoring the second one-dimensional vector into a two-dimensional gray matrix to obtain a scrambled image.
The transformed image is converted into a one-dimensional vector, which is a first one-dimensional vector having a length of M × N. Rearranging the positions of the vector median values according to the generated sequences Kx and Ky to obtain a second one-dimensional vector, and restoring the obtained second one-dimensional vector into a two-dimensional gray value matrix to obtain a scrambled image.
Specifically, an initial value x is assigned to the 2D hyperchaotic system0,y0And parameters a, b, c and d, then iterating G + M multiplied by N times to obtain two sequences with the length of G + M multiplied by N, wherein G is a constant specified by the user, M and N are the number of rows and columns of the image respectively, and finally, the number of G in front of each sequence is truncated to obtain two sequences with new length so as to avoid the influence caused by the specified initial value. The first sequence is X ═ X1,x2,...,xinM×inNThe second sequence is Y ═ Y1,y2,...,yinM×inN
And amplifying the two sequences to a certain degree, and then carrying out rounding operation. The specific operation is as follows:
Xi=floor(Xi×1010)
Yi=floor(Yi×1010)
the two sequences are respectively X ═ X after modification1,x2,...,xinM×inNAnd Y ═ Y1,y2,...,yinM×inN
The remainder operation is performed on both sequences so that all values in both sequences are in the range of 1-mxn. The calculation is as follows:
Xi=mod(Xi,inM×inN)
Yi=mod(Yi,inM×inN)
all values in the modified sequence do not exceed mxn.
And respectively and circularly traversing the two sequences, recording subscripts of values appearing for the second time when the values in the sequences appear for the second time, and respectively recording the subscripts into the arrays vx and vy. Find the values that do not appear in the sequence and record these values in an array. Values not present in the sequence are recorded in the arrays ux and uy, respectively. The values recorded in the two sequences that do not occur are placed at the position of the repeated values, resulting in two modified sequences Kx and Ky, the sequence Kx being x1,x2,...,xpThe sequence Ky being y1,y2,...yq
Traversing the values in the sequence Kx, taking the values as indexes, taking the values from the first one-dimensional vector according to the sequence, and storing the values into a temporary array. Traversing the values in the sequence Ky, taking the values as indexes, and taking out the values from the temporary array according to the sequence to obtain data which is the second one-dimensional vector. And restoring the second one-dimensional vector into a two-dimensional gray matrix to obtain a scrambled image.
For example, fig. 4a shows a scrambled image obtained by an image encryption experiment, fig. 4b shows a gray histogram of the scrambled image, and it can be seen from fig. 4a and 4b that although the image has lost original information, its gray histogram does not change, and the gray value has a distinct feature in distribution.
S103: the random image is replaced to obtain a replaced image.
As a preferable scheme, the step S103 specifically includes the following steps (as shown in fig. 5):
s1031: and carrying out XOR operation on the third one-dimensional vector converted from the scrambled image from back to front to obtain a fourth one-dimensional vector.
The scrambled image is converted into a one-dimensional vector, which is referred to as the third one-dimensional vector. Then setting initial values and system variables for the Lorentz equation, setting step length, then using a fourth-order Runge-Kutta method to carry out iteration solution on the Lorentz equation, temporarily storing each value in the iteration, splicing the values into a sequence, and processing the sequence to ensure that decimal does not exist in the sequence. And finally, carrying out bitwise XOR operation on the gray values of the adjacent pixels, and then carrying out bitwise XOR operation on the operated result and the obtained sequence again to obtain a fourth one-dimensional vector.
The bitwise exclusive-or operation is to convert two numbers into binary numbers, and then perform exclusive-or operation on the numbers on the same bits, wherein the same value of the numerical value is 0, and the different value is 1. Such as: the binary number of 135|196 ═ 67, 135 is 1000111, the binary number of 196 is 11000100, the result of the exclusive or operation of 1000111 and 11000100 at the corresponding positions is 01000011, and the conversion to decimal number is 67. The result 67 is exclusive-ored with either 135 or 196 to obtain another number, 67|135 ═ 196.
S1032: and restoring the fourth one-dimensional vector into a matrix to obtain a replacement image.
And restoring the fourth one-dimensional vector obtained after the bitwise exclusive-or operation into a matrix with the same size as that of the target image (for example, the size of the target image is M multiplied by N). At this time, the gray-scale value statistical chart of the image shows that the values are uniformly distributed, and the image has no obvious characteristic information.
For example, as shown in fig. 6a, in order to eliminate the obvious features presented by the scrambled image gray-level value histogram, the obtained image is subjected to a replacement process again, that is, the gray level value of the image is changed to make the gray level value distribution uniform, so that the features of the gray-level value histogram image are eliminated. Although the image looks like a noisy image, the gray value statistic of the image becomes flat (as shown in FIG. 6 b), and no obvious feature is provided
S104: and compressing the replacement image to obtain a compressed image.
As a preferable scheme, the step S104 specifically includes the following steps (as shown in fig. 7):
s1041: and compressing the converted image data by utilizing the Chinese remainder theorem to obtain compressed data.
Compressing the replacement image by using the Chinese remainder theorem, setting the compression ratio as Cr, and selecting Cr positive integers n1,n2,n3,…nCrThe Cr numbers are prime numbers relative to each other and all numbers are greater than 255. The specific method comprises the following steps: from n1,n2,n3,…nCrSelecting a minimum number, assumed to be niThen ni=256,niThen, starting from 256, the newly added number is compared with the previously generated niAnd judging whether the two numbers are relatively prime, if the newly added number is not relatively prime with any previous number, skipping the number, and continuously traversing backwards. Until finding Cr numbers which are mutually prime numbers. When the two numbers are judged to be prime numbers, a rolling division method can be used.
And compressing the data by using the Chinese remainder theorem. Taking out all data in the current column from left to right by taking the column as a main part, dividing the data into a group by Cr, respectively corresponding the number of gray values in each group to Cr which are relatively prime in pairs, processing by using the Chinese remainder theorem, combining the gray values in each group into one data, and obtaining a matrix M/Cr multiplied by N after processing all the data.
S1042: and storing the compressed data into an image format to obtain a compressed image.
The compressed data is processed again so that the data can be stored in the format of one image. The obtained matrix M/Cr × N is divided by 256, and the obtained quotient is stored as key data, and the obtained remainders are numbers smaller than 256, and the numbers are stored in an image format, and the obtained image data is a compressed image.
For example, the image after the replacement processing (as shown in fig. 8 a) is compressed, the size of the image is changed, and the compressed image is shown in fig. 8 b.
S105: and hiding the compressed image into the host image to obtain an encrypted image.
As a preferable scheme, the step S105 specifically includes the following steps (as shown in fig. 9):
s1051: the host image is decomposed into horizontal component vectors and diagonal component vectors according to a discrete wavelet transform.
The host image is decomposed by a two-dimensional discrete wavelet decomposition method, and horizontal component data ch and diagonal component data cd of the host image are extracted. The horizontal and diagonal components are converted into one-dimensional vectors vch and vcd, respectively.
S1052: the compressed image is processed and split into a high portion vector and a low portion vector.
The matrix data of the compressed image is converted into a double type, and the converted data is img. Img was resolved by the following equation:
u=floor(img/10)
l=mod(img/10)
each datum in img is divided by 10, the resulting quotient is stored in the high portion u, and the resulting remainder is stored in the low portion l.
And respectively converting the obtained u and l into one-dimensional vectors vu and vl, and then carrying out proper scaling treatment on the vu and vl sequences to avoid the situation that the host image loses too many details during replacement.
The specific method comprises the following steps: since u ranges from 0 to 25, u can be scaled appropriately to have the same characteristics as the original data, and divided by 10 after subtracting 12 from u, so that the processed data has positive or negative values, the fluctuation range of the values is limited, and similar processing is also used. The data obtained after the scaling treatment has positive and negative values, the fluctuation range is small and is close to the original component fluctuation amplitude, and the detail loss of the image is reduced by using the method. The calculation is as follows:
vu=(u-12)/10
vl=(l-5)/5
s1053: and replacing the horizontal component vector and the diagonal component vector in the host image with a high partial vector and a low partial vector respectively to obtain a replaced image.
And respectively replacing vch and vcd of the host image by using the high-part one-dimensional vector vu and the low-part one-dimensional vector vl obtained by splitting the compressed image to obtain a replacement image, wherein the contents of the horizontal component data and the diagonal component data of the replacement image are vu and vl at the moment.
S1054: and restoring the sizes of the horizontal component vector and the diagonal component vector of the replacement image, and carrying out image reconstruction to obtain an encrypted image.
And restoring the horizontal component data and the diagonal component data of the replacement image to the size before the one-dimensional transformation, and then carrying out image reconstruction on other unchanged components and changed components of the replacement image to obtain a final encrypted image.
For example, in order to make the final image unsuspecting an encrypted compressed image, the image needs to be hidden, a new visually meaningful image is given to the encrypted image, and the hidden encrypted image needs to be an image in which the encrypted data can be hidden, and the image can be called a host image. Fig. 10a shows a host image in an image encryption experiment, and fig. 10b shows a grayscale histogram of the host image.
Hiding the compressed image into the host image, as shown in fig. 10c, obtaining the final encrypted image, where the host image does not have obvious change, the gray histogram of the final encrypted image is as shown in fig. 10d, the gray values of fig. 10b and fig. 10d have a small change, comparing fig. 10b with fig. 10d with a gray value, and subtracting the gray value of the corresponding position in fig. 10d from the gray value of fig. 10b, to obtain the result as shown in fig. 10 e.
The embodiment of the invention provides a joint compression explicit image encryption method, which comprises the steps of scrambling a target image, replacing the scrambled image, and compressing the replaced image, so that the image is easy to hide, and the risk of leakage and attack of the encrypted image in the transmission process is reduced.
Example two:
an image decryption method provided in an embodiment of the present invention is, as shown in fig. 11, an image decryption method corresponding to the explicit image encryption method of joint compression provided in the first embodiment, and includes:
s201: an encrypted image is obtained.
And acquiring or receiving the encrypted image corresponding to the target image sent by other terminals.
S202: a compressed image is extracted from the encrypted image.
And decomposing the encrypted image by using a two-dimensional discrete wavelet decomposition method, and taking out horizontal component data and diagonal component data of the encrypted image. The horizontal component data and the diagonal component data are high-part one-dimensional vectors vu and low-part one-dimensional vectors vl of the compressed image, and vu and vl of the compressed image are restored to u and l by the following formulas:
u=10*vu+12
l=5*vl+5
and then u and l are substituted into the following equation:
u=floor(img/10)
l=mod(img/10)
and calculating to obtain the data img with the data type of double, and converting the data img into an image through data type conversion so as to obtain a compressed image.
S203: and decompressing the compressed image according to the Chinese remainder theorem to obtain a replacement image.
Obtaining a compressed image, and obtaining Cr positive integers n when the replacement image is compressed1,n2,n3,…nCrAnd key data. The compressed image is converted into a matrix form, the obtained key data is used as a quotient, and an M/Cr multiplied by N matrix is restored according to a remainder, the quotient and a multiplier factor 256. According to the Chinese remainder theorem, through Cr positive integers n1,n2,n3,…nCrAnd respectively decompressing each numerical value in the M/Cr multiplied by N matrix into Cr gray-scale values, and decompressing to obtain a replacement image corresponding to the target image.
S204: the replacement image is inversely replaced to obtain a scrambled image.
And converting the replacement image into a fourth one-dimensional vector, carrying out bitwise XOR operation on the fourth one-dimensional vector to obtain a result, namely a third one-dimensional vector corresponding to the scrambled image, and converting the third one-dimensional vector into the scrambled image.
S205: and carrying out inverse scrambling on the scrambled image to obtain a target image.
The step S205 specifically includes:
and respectively carrying out inverse processes of Hash table mapping, Arnold transformation and Ernon mapping on the scrambled image to obtain a restored target image.
And carrying out the inverse process of hash table transformation on the scrambled image. And performing Arnold transformation, wherein when the iteration times are integral multiple of the period, the image can be restored to achieve the purpose of decryption, and the Arnold transformation period can be calculated according to the size of the image. Then, the inverse process of the Ernon mapping is carried out, and the initial variable x in the Ernon mapping operation is calculated0And y0The image sequence can be restored without any error to obtain the target image.
The embodiment of the invention provides an image decryption method, which is the reverse process of the image encryption method provided by the embodiment one. The method can realize the decryption of the encrypted image obtained by the image encryption method provided by the first embodiment, thereby avoiding the loss or change of the encrypted image information.
Example three:
an embodiment of the present invention provides an explicit image encryption apparatus with joint compression, as shown in fig. 12, including:
and an obtaining module 31, configured to obtain the target image and the host image. And acquiring an image to be encrypted as a target image, wherein the image to be encrypted is an image which needs to be protected to prevent the image from leaking. And acquiring a host image with a normal appearance as an image for hiding the image to be encrypted, wherein the host image and the target image have the same size.
And a scrambling module 32, configured to perform image scrambling on the target image to obtain a scrambled image. The scrambling module 32 includes: and the disorder unit is used for disturbing the pixel position of the target image according to the Ernong mapping to obtain a disorder image. And the transformation unit is used for dividing the disordered image into four areas and independently carrying out Arnold transformation on each area of the disordered image to obtain a transformed image. And the mapping unit is used for carrying out hash table mapping on the first one-dimensional vector converted from the transformed image to obtain a second one-dimensional vector, and restoring the second one-dimensional vector into a matrix to obtain the scrambled image.
And a replacement module 33 configured to replace the random image to obtain a replaced image. The main function of the permutation module 33 is to perform xor operation on the third one-dimensional vector converted from the scrambled image from back to front to obtain a fourth one-dimensional vector. And restoring the fourth one-dimensional vector into a matrix to obtain a replacement image.
And a compression module 34, configured to compress the transformed image to obtain a compressed image. The compression module 34 mainly functions to compress the converted image data by using the chinese remainder theorem to obtain compressed data. And storing the compressed data into an image format to obtain a compressed image.
And a hiding module 35, configured to hide the compressed image into the host image, so as to obtain an encrypted image. The main function of the concealment module 35 is to decompose the host image into horizontal component vectors and diagonal component vectors according to a discrete wavelet transform. The compressed image is processed and split into a high portion vector and a low portion vector. And replacing the horizontal component vector and the diagonal component vector in the host image with a high partial vector and a low partial vector respectively to obtain a replaced image. And restoring the sizes of the horizontal component vector and the diagonal component vector of the replacement image, and carrying out image reconstruction to obtain an encrypted image.
The jointly compressed explicit image encryption device provided by the embodiment of the present invention has the same technical features as the jointly compressed explicit image encryption method provided by the first embodiment of the present invention, so that the same technical problems can be solved, and the same technical effects can be achieved.
Example four:
an image decryption apparatus provided in an embodiment of the present invention, as shown in fig. 13, includes:
an obtaining module 41, configured to obtain an encrypted image. And acquiring or receiving the encrypted image corresponding to the target image sent by other terminals.
An extraction module 42 for extracting the compressed image from the encrypted image. And decomposing the encrypted image by using a two-dimensional discrete wavelet decomposition method, and taking out horizontal component data and diagonal component data of the encrypted image. And restoring the compressed image through calculation conversion.
And the decompression module 43 is configured to decompress the compressed image according to the chinese remainder theorem to obtain a replacement image. Obtaining a compressed image, and obtaining Cr positive integers n when the replacement image is compressed1,n2,n3,…nCrAnd key data. The compressed image is converted into a matrix form, the obtained key data is used as a quotient, and an M/Cr multiplied by N matrix is restored according to a remainder, the quotient and a multiplier factor 256. According to the Chinese remainder theorem, through Cr positive integers n1,n2,n3,…nCrAnd respectively decompressing each numerical value in the M/Cr multiplied by N matrix into Cr gray-scale values, and decompressing to obtain a replacement image corresponding to the target image.
And an inverse permutation module 44, configured to perform inverse permutation on the permuted image, so as to obtain a scrambled image. And converting the replacement image into a fourth one-dimensional vector, carrying out bitwise XOR operation on the fourth one-dimensional vector to obtain a result, namely a third one-dimensional vector corresponding to the scrambled image, and converting the third one-dimensional vector into the scrambled image.
And an inverse scrambling module 45, configured to perform inverse scrambling on the scrambled image to obtain a target image. And respectively carrying out inverse processes of Hash table mapping, Arnold transformation and Ernon mapping on the scrambled image to obtain a restored target image.
The image decryption device provided by the embodiment of the invention has the same technical characteristics as the image decryption method provided by the second embodiment, so that the same technical problems can be solved, and the same technical effects can be achieved.
Unless specifically stated otherwise, the relative steps, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In all examples shown and described herein, any particular value should be construed as merely exemplary, and not as a limitation, and thus other examples of example embodiments may have different values.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

Claims (4)

1. A method for jointly compressing explicit image encryption, the method comprising:
acquiring a target image and a host image;
performing image scrambling on the target image to obtain a scrambled image; specifically, pixel positions of the target image are disturbed according to Ernong mapping, and a disorder image is obtained; dividing the disordered image into four regions, and performing Arnold transformation on each region of the disordered image to obtain a transformed image; performing hash table mapping on the first one-dimensional vector converted from the transformed image to obtain a second one-dimensional vector, and restoring the second one-dimensional vector into a matrix to obtain a scrambled image;
replacing the scrambled image to obtain a replaced image; specifically, the xor operation is performed on the third one-dimensional vector converted from the scrambled image from back to front to obtain a fourth one-dimensional vector; reducing the fourth one-dimensional vector into a matrix to obtain a replacement image;
compressing the replacement image to obtain a compressed image; compressing the replacement image data by using the Chinese remainder theorem to obtain compressed data; storing the compressed data into an image format to obtain a compressed image;
hiding the compressed image into the host image to obtain an encrypted image; decomposing a host image into a horizontal component vector and a diagonal component vector according to discrete wavelet transform; processing the compressed image and splitting the compressed image into a high partial vector and a low partial vector; replacing the horizontal component vector and the diagonal component vector in the host image with the high partial vector and the low partial vector respectively to obtain a replaced image; and restoring the horizontal component vector and the diagonal component vector of the replacement image, and carrying out image reconstruction to obtain an encrypted image.
2. An image decryption method, characterized in that the method comprises:
acquiring an encrypted image; the encrypted image is obtained by the encryption method of claim 1;
extracting the compressed image from the encrypted image; decomposing an encrypted image by using a two-dimensional discrete wavelet decomposition method, and taking out horizontal component data and diagonal component data of the encrypted image; restoring the compressed image through calculation conversion;
decompressing the compressed image according to the Chinese remainder theorem to obtain a replacement image; converting a compressed image into a matrix form, decompressing the compressed image in the matrix form into a gray value according to the Chinese remainder theorem, and decompressing to obtain a replacement image corresponding to a target image;
carrying out reverse replacement on the replacement image to obtain a scrambled image; specifically, the replacement image is converted into a fourth one-dimensional vector, the fourth one-dimensional vector is subjected to bitwise XOR operation, the operation result is a third one-dimensional vector corresponding to the scrambled image, and the third one-dimensional vector is converted into the scrambled image;
carrying out reverse scrambling on the scrambled image to obtain a target image; specifically, a matrix corresponding to a scrambled image is converted into a second one-dimensional vector, the second one-dimensional vector is subjected to a Hash table mapping inverse process to obtain a first one-dimensional vector, and the first one-dimensional vector is converted into a transformed image; performing an Arnold transformation inverse process on the transformed image to obtain disordered images of the four regions; and carrying out an Ernong mapping inverse process on the disordered image to obtain a restored target image.
3. An explicit image encryption apparatus for joint compression, the apparatus comprising:
the acquisition module is used for acquiring a target image and a host image;
the scrambling module is used for carrying out image scrambling on the target image to obtain a scrambled image; specifically, pixel positions of the target image are disturbed according to Ernong mapping, and a disorder image is obtained; dividing the disordered image into four regions, and performing Arnold transformation on each region of the disordered image to obtain a transformed image; performing hash table mapping on the first one-dimensional vector converted from the transformed image to obtain a second one-dimensional vector, and restoring the second one-dimensional vector into a matrix to obtain a scrambled image;
the replacement module is used for replacing the scrambled image to obtain a replacement image; specifically, the xor operation is performed on the third one-dimensional vector converted from the scrambled image from back to front to obtain a fourth one-dimensional vector; reducing the fourth one-dimensional vector into a matrix to obtain a replacement image;
the compression module is used for compressing the replacement image to obtain a compressed image; compressing the replacement image data by using the Chinese remainder theorem to obtain compressed data; storing the compressed data into an image format to obtain a compressed image;
a hiding module, configured to hide the compressed image into the host image to obtain an encrypted image; decomposing a host image into a horizontal component vector and a diagonal component vector according to discrete wavelet transform; processing the compressed image and splitting the compressed image into a high partial vector and a low partial vector; replacing the horizontal component vector and the diagonal component vector in the host image with the high partial vector and the low partial vector respectively to obtain a replaced image; and restoring the horizontal component vector and the diagonal component vector of the replacement image, and carrying out image reconstruction to obtain an encrypted image.
4. An image decryption apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring the encrypted image and acquiring or receiving the encrypted image corresponding to the target image sent by other terminals;
an extraction module for extracting a compressed image from the encrypted image; decomposing an encrypted image by using a two-dimensional discrete wavelet decomposition method, and taking out horizontal component data and diagonal component data of the encrypted image; restoring the compressed image through calculation conversion;
the decompression module is used for decompressing the compressed image according to the Chinese remainder theorem to obtain a replacement image; converting a compressed image into a matrix form, decompressing the compressed image in the matrix form into a gray value according to the Chinese remainder theorem, and decompressing to obtain a replacement image corresponding to a target image;
the reverse replacement module is used for performing reverse replacement on the replacement image to obtain a scrambled image; specifically, the replacement image is converted into a fourth one-dimensional vector, the fourth one-dimensional vector is subjected to bitwise XOR operation, the operation result is a third one-dimensional vector corresponding to the scrambled image, and the third one-dimensional vector is converted into the scrambled image;
the reverse scrambling module is used for performing reverse scrambling on the scrambled image to obtain a target image; specifically, a matrix corresponding to a scrambled image is converted into a second one-dimensional vector, the second one-dimensional vector is subjected to a Hash table mapping inverse process to obtain a first one-dimensional vector, and the first one-dimensional vector is converted into a transformed image; performing an Arnold transformation inverse process on the transformed image to obtain disordered images of the four regions; and carrying out an Ernong mapping inverse process on the disordered image to obtain a restored target image.
CN201811239623.9A 2018-10-23 2018-10-23 Joint compression explicit image encryption and decryption method and device Active CN109286819B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811239623.9A CN109286819B (en) 2018-10-23 2018-10-23 Joint compression explicit image encryption and decryption method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811239623.9A CN109286819B (en) 2018-10-23 2018-10-23 Joint compression explicit image encryption and decryption method and device

Publications (2)

Publication Number Publication Date
CN109286819A CN109286819A (en) 2019-01-29
CN109286819B true CN109286819B (en) 2021-07-23

Family

ID=65177127

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811239623.9A Active CN109286819B (en) 2018-10-23 2018-10-23 Joint compression explicit image encryption and decryption method and device

Country Status (1)

Country Link
CN (1) CN109286819B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109920015B (en) * 2019-03-05 2022-11-29 重庆工程学院 Image visual meaningful encryption method based on fractal graph generation
CN111460486B (en) * 2020-04-30 2023-04-07 中国矿业大学 Image fast scrambling method based on pre-storage and two-dimensional Arnold transformation
CN111526261B (en) * 2020-05-07 2022-03-22 中国科学院大学 Method and system for recovering hidden information of image information based on white light interference
CN112272262B (en) * 2020-10-23 2021-09-03 北京邮电大学 Image encryption and decryption method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010046104A2 (en) * 2008-10-23 2010-04-29 University Of Ulster An encryption method
CN104063833A (en) * 2013-03-21 2014-09-24 中国水利水电科学研究院 Image encryption and reading methods and devices
CN104680475A (en) * 2015-02-27 2015-06-03 柳州职业技术学院 Image hybrid encrypting method based on hyperchaotic system
CN107563949A (en) * 2017-08-31 2018-01-09 湖北工程学院 Image guard method and device, image restoring method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2661585B1 (en) * 1990-04-25 1992-08-07 Telediffusion Fse METHOD AND DEVICE FOR SCRAMBLING-SCRATCHING DIGITAL IMAGE DATA.
US5903648A (en) * 1996-02-06 1999-05-11 The University Of Connecticut Method and apparatus for encryption
CN102930500A (en) * 2012-11-19 2013-02-13 海南大学 Medical image robust watermarking method based on Arnold scrambling transformation and DCT (discrete cosine transformation)

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010046104A2 (en) * 2008-10-23 2010-04-29 University Of Ulster An encryption method
CN104063833A (en) * 2013-03-21 2014-09-24 中国水利水电科学研究院 Image encryption and reading methods and devices
CN104680475A (en) * 2015-02-27 2015-06-03 柳州职业技术学院 Image hybrid encrypting method based on hyperchaotic system
CN107563949A (en) * 2017-08-31 2018-01-09 湖北工程学院 Image guard method and device, image restoring method and device

Also Published As

Publication number Publication date
CN109286819A (en) 2019-01-29

Similar Documents

Publication Publication Date Title
CN109286819B (en) Joint compression explicit image encryption and decryption method and device
Zhang et al. A novel image compression–encryption hybrid algorithm based on the analysis sparse representation
Chang et al. Reversible hiding in DCT-based compressed images
Zhou et al. Image encryption using P-Fibonacci transform and decomposition
Tedmori et al. Image cryptographic algorithm based on the Haar wavelet transform
Chang et al. A novel secret image sharing scheme in color images using small shadow images
CN109547797B (en) Separable encryption domain information hiding method
Mstafa et al. A DCT-based robust video steganographic method using BCH error correcting codes
Ong et al. Beyond format-compliant encryption for JPEG image
Charan et al. A novel LSB based image steganography with multi-level encryption
Shiu et al. An interpolative AMBTC-based high-payload RDH scheme for encrypted images
Ong et al. A scalable reversible data embedding method with progressive quality degradation functionality
Mstafa et al. A novel video steganography algorithm in DCT domain based on hamming and BCH codes
Rakesh et al. Image encryption using block based uniform scrambling and chaotic logistic mapping
Ong et al. Scrambling–embedding for JPEG compressed image
Houssein et al. An image steganography algorithm using haar discrete wavelet transform with advanced encryption system
CN111832035A (en) Image encryption storage method and device
Mukherjee et al. An efficient multi-bit steganography algorithm in spatial domain with two-layer security
Ponnaian et al. Crypt analysis of an image compression–encryption algorithm and a modified scheme using compressive sensing
Baba et al. Watermarking of digital images in frequency domain
Caragata et al. Cryptanalysis of an improved fragile watermarking scheme
Gao et al. A secure lossless recovery for medical images based on image encoding and data self-embedding
Jung Comparative histogram analysis of LSB-based image steganography
Chang et al. A reversible data hiding scheme for image interpolation based on reference matrix
Wang et al. Multi-level reversible data hiding for crypto-imagery via a block-wise substitution-transposition cipher

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