CN108810555B - Thumbnail image privacy protection method based on image compression and elastic resolution - Google Patents
Thumbnail image privacy protection method based on image compression and elastic resolution Download PDFInfo
- Publication number
- CN108810555B CN108810555B CN201810617319.7A CN201810617319A CN108810555B CN 108810555 B CN108810555 B CN 108810555B CN 201810617319 A CN201810617319 A CN 201810617319A CN 108810555 B CN108810555 B CN 108810555B
- Authority
- CN
- China
- Prior art keywords
- image
- block
- thumbnail
- scrambling
- dct
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 40
- 230000006835 compression Effects 0.000 title claims abstract description 31
- 238000007906 compression Methods 0.000 title claims abstract description 31
- 230000009466 transformation Effects 0.000 claims abstract description 16
- 238000000638 solvent extraction Methods 0.000 claims abstract description 11
- 238000013139 quantization Methods 0.000 claims description 19
- 238000010586 diagram Methods 0.000 claims description 18
- 230000000694 effects Effects 0.000 claims description 11
- 230000008569 process Effects 0.000 claims description 5
- 238000011084 recovery Methods 0.000 claims description 3
- 238000006243 chemical reaction Methods 0.000 claims description 2
- 230000009467 reduction Effects 0.000 claims description 2
- 238000001914 filtration Methods 0.000 claims 1
- 238000005516 engineering process Methods 0.000 abstract description 4
- 238000012545 processing Methods 0.000 abstract description 3
- 238000003708 edge detection Methods 0.000 description 6
- 230000008901 benefit Effects 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000000903 blocking effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
- 230000001131 transforming effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/85—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression
- H04N19/88—Methods 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N1/00—Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
- H04N1/00095—Systems or arrangements for the transmission of the picture signal
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/60—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
- H04N19/625—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using discrete cosine transform [DCT]
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- Discrete Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
- Facsimile Transmission Control (AREA)
- Editing Of Facsimile Originals (AREA)
Abstract
A thumbnail image privacy protection method based on image compression and elastic resolution; partitioning an original image into blocks, performing secondary sub-block partitioning on each block, and performing random scrambling on the sub-blocks in corresponding degrees in each block according to the requirement of resolution of the thumbnail; combining JPEG compression and cryptography technologies, carrying out encryption processing of DC and AC coefficients in 8 x 8 blocks subjected to DCT transformation to different degrees to obtain thumbnails of public parts and completely encrypted data of private parts; the public part thumbnail in the invention can be used for previewing pictures of network applications and simultaneously provides a certain degree of privacy protection. The storage cost of the whole encrypted image, especially the public part, is reduced by using an image compression technology, so that the bandwidth can be greatly saved. The invention also provides thumbnail privacy protection with flexible resolution, the security of the image is affected by the resolution, the lower the resolution is controlled, the higher the security of the image.
Description
[ technical field ] A method for producing a semiconductor device
The invention belongs to the technical field of digital image encryption, digital image privacy protection and information security, and particularly relates to a thumbnail image privacy protection method based on image compression and elastic resolution.
[ background of the invention ]
Digital images, because of their vivid and vivid contents, overcome the difficulty of large storage space compared with sound and text information, and can convey more information, thus becoming one of the most important ways to propagate information [1 ]. With the rapid development of internet applications, various cloud storage devices have begun to be used as management tools for digital images, which can asynchronously and easily share large files without peer-to-peer transmission, can be accessed and recovered from the cloud even if a mobile device is lost or damaged, and is low in cost, saving a lot of expenses for users to transmit and manage data, and therefore, almost billions of new photos per week are uploaded to cloud applications.
However, the privacy of the user is threatened while the cloud storage brings convenience, because any meaningful image is uploaded to the cloud application, which is equivalent to backup on an untrusted third-party server, the privacy of the user is likely to be revealed, and the hidden danger is caused by: firstly, the service provider can reveal the photos of the user to the partner for some business interests; secondly, the account of the user may be attacked by an attacker, which may cause the photos of the user to flow down to the attacker, resulting in leakage of face information, life information, and the like of the user.
The method for solving the problem is to implement end-to-end encryption, namely, the image is encrypted before being uploaded to the server at the sending end, so that the image obtained at the server end is the encrypted image, and an unauthorized third party cannot restore the ciphertext image to the original image without a secret key, so that the security that the image content is not stolen is greatly improved, and the digital image related to personal privacy is well protected. Techniques in this regard include image encryption techniques based on matrix-transformed pixel permutation, image encryption techniques based on secret segmentation and sharing, and image encryption techniques based on modern cryptosystems, etc. [2 ].
However, although the conventional classical image encryption algorithm has well solved the problem of image privacy protection, the user cannot perform online preview on the image due to format incompatibility or extremely disordered encrypted image, so that the image retrieval is very difficult. While documents [3] and [4] solve the problem of format incompatibility, but do not solve the problem of image preview, Wright et al in [5] propose a thumbnail image privacy protection algorithm (TPE) in the information hiding and multimedia security conference, and choose to provide a low-resolution JPEG thumbnail for each image, so as to provide a compatible image format, and hide the detailed content of the image, so that the user privacy can be protected to a certain extent, and online preview is possible.
However, the space correlation of the image is changed no matter in the traditional image encryption algorithm or the latest thumbnail image privacy protection algorithm, so that the storage overhead of the encrypted image file is greatly increased, and the image reconstruction of the TPE algorithm has an obvious blocking effect, so that the visual quality cannot reach the effect accepted by human eyes. The thumbnail privacy protection algorithm proposed in reference [6] improves image security, file size, and image reconstruction quality, but the overall effect is still poor.
Reference to the literature
[1]Gonzalez,Rafael C.,and Richard E.Woods."Digital image processing."(2012).
[2] Li Chang, Han Zheng, and Zhang Hao, "review of image encryption techniques," computer research and development 39.10(2002): 1317-.
[3]Tierney,Matt,et al."Cryptagram:Photo privacy for online socialmedia."Proceedings of the firstACM conference on Online social networks.ACM,2013.
[4]Ra,Moo-Ryong,Ramesh Govindan,and Antonio Ortega."P3:TowardPrivacy-Preserving Photo Sharing."Nsdi.2013.
[5]Wright,Charles V.,Wu-chi Feng,and Feng Liu."Thumbnail-preservingencryption for JPEG."Proceedings of the 3rd ACM Workshop on InformationHiding and Multimedia Security.ACM,2015.
[6]Marohn,Byron,et al."Approximate Thumbnail Preserving Encryption."Proceedings of the 2017on MultimediaPrivacy and Security.ACM,2017.
[ summary of the invention ]
The invention aims to solve the following key technical problems:
firstly, an image encryption method for storing an original image format is provided, and the problem that the encrypted image format is incompatible is solved.
Secondly, a thumbnail image privacy protection method is provided, and an encrypted image can not only protect the privacy of a user, but also perform online preview through a thumbnail.
And thirdly, an image encryption method based on image compression is provided, so that the encrypted image saves file storage space and transmission bandwidth as much as possible.
Fourthly, a thumbnail image encryption method with elastic resolution is provided, and the thumbnail resolution of the image can be controlled by a user.
In order to solve the problems, the format of the original image is read and still stored as the format of the original image after the image encryption processing is carried out, so that the encrypted image has stronger usability.
In order to solve the above problems, the present invention proposes to create a low-resolution thumbnail of an original image. Detailed parts of the image are discarded from the thumbnail, only the rough outline of the image is retained, and it is difficult to restore the approximate original image from the thumbnail. The method not only protects the privacy information in the image, but also can carry out online preview by encrypting the image.
In order to solve the problems, the invention uses an image compression technology to control the extra storage overhead brought by image encryption, removes the redundancy of the image through reasonable image quantization and reduces the size of the original file as much as possible. And the characteristics of the image compression technology are combined, and the encrypted image is divided into a public part and a private part. The public part is a thumbnail with a small volume, and only the public part is loaded when online preview is carried out through the thumbnail, so that the bandwidth can be greatly saved.
In order to solve the above problems, the present invention provides a thumbnail image encryption technique of an elastic resolution, and the degree of detail exposure of an image is controlled by a user himself. Meanwhile, the security of the image depends not only on the security of the algorithm, but also on the resolution of the thumbnail. The higher the resolution of the image, the less detail exposed and the higher the security of the image.
In order to solve the problems, the invention also provides a prototype system for storing the thumbnail-encrypted pictures. And the flexible selection of uploading of the picture at the picture encryption level and the corresponding resolution level is supported, and the picture is decrypted into a high-definition image at the terminal during downloading.
The technical scheme of the invention is as follows:
a thumbnail image privacy protection method based on image compression and elastic resolution comprises a thumbnail encryption method and a thumbnail decryption method;
first, thumbnail encryption method
1, partitioning an image in a spatial domain: reading image information in a bitmap image file, and partitioning an original image according to N multiplied by N, wherein N is less than N, and the same is carried out below, assuming that the image size of the image is N multiplied by N;
1.1, carrying out secondary block division on each n × n block, wherein the size of each sub-block is b × b, b is less than n, and the same is carried out below;
1.2, randomly scrambling a plurality of sub-blocks in each n × n block, taking the properties of JPEG compression into consideration, and adopting n mod8 ≡ 0 and b mod8 ≡ 0 in order to better obtain the image recovery quality, wherein the number of the sub-blocks b × b participating in scrambling is determined by a sub-key k0Deciding to elastically control a resolution of the thumbnail image, and a random position of the sub-block participating in the scrambling is generated by a pseudo random number generator;
assuming that each nxm block contains M b x b sub-blocks, the scrambling level of the image is divided into 5 levels: when the level is 0, the image is not scrambled and is not compressed, and the original image is completely reserved; level is 1, and m/4 subblocks participate in scrambling; 2, m/2 subblocks participate in scrambling; sub-blocks with the level of 3, 3m/4 participate in scrambling; level is 4, and m subblocks participate in scrambling; the level is used as the seed of a pseudo-random number generator to determine the random scrambling position of the subblocks;
2, transforming the image into a frequency domain by using a JPEG compression method for reference, wherein the DCT transformation of the image follows the following rules:
2.1, subtracting 128 from each pixel data of the image to make the range of the pixel value fall into the range between-128 and 127, thus greatly reducing the probability that the decimal number is 3 bits after DCT conversion and being convenient for reducing the coded digit when VIL coding is used;
2.2, by combining the properties of JPEG compression, applying DCT (discrete cosine transformation) to each 8 x 8 image block to obtain 1 DC coefficient and 63 AC coefficients, and simultaneously, calling the DC coefficient as a low-frequency coefficient and the AC coefficient as a high-frequency coefficient;
3, quantizing the DCT transformation result in the step 2, namely dividing each 8 multiplied by 8 block of the image by a default quantization table in JPEG compression, and rounding the result to a reserved integer; thus, most of the high frequency coefficients in the DCT coefficients become "0", and some of the coefficients that are not set to "0" will also suffer some loss in accuracy; the quantization aims to filter high-frequency coefficients in an image, and main information of the image is concentrated in a low-frequency part of the image, so that the effect of compression can be achieved, and the main information of the image is not greatly influenced.
4, zigzag scanning is carried out on each 8 × 8 DCT coefficient quantized in the step 3, so that a 1 × 64 one-dimensional sequence is obtained for the 8 × 8 DCT coefficients;
4.1, separating a high-frequency coefficient AC from a low-frequency coefficient DC, storing the high-frequency coefficient as a private part, and replacing the position of the high-frequency coefficient with '0';
4.2, carrying out zero run coding and Huffman coding on the separated high-frequency coefficient, further compressing the sequence coding length of the data to obtain a binary sequence w0,w1,...,wi;
4.3, carrying out stream cipher encryption on the high-frequency coefficient subjected to the step 4.2;
the specific method for encrypting the stream cipher comprises the following steps: using subkey k1Generating a binary keystream r by a stream cipher generator0,r1,...,riAnd for the binary value w in the 4.2 stepiThe sequence is encrypted as follows to obtain wi' sequence:
wi' will be saved as a private part;
5, carrying out the alizgzag scanning and inverse quantization on the coefficient with the high-frequency coefficient set to be 0, discarding the detailed part of the image as the result of inverse quantization, and only keeping the rough characteristic of the image;
6, performing Inverse Discrete Cosine Transform (IDCT) on the DCT coefficient processed in the step 5 to transform the DCT coefficient into a spatial domain;
8, carrying out block encryption on the thumbnail in the step 7 again, wherein the size of each block is 8 multiplied by 8;
8.1, when the pixel value in each block of the thumbnail is the average value of the block, the lower six bits of the pixel in each block need to be randomly scrambled, so that the pixel value of the block is not the exact average value but is close to the average value;
8.2, to ensure the compression effect of the image, the same sub-key k is used for 64 pixels in the same block2Carrying out pixel value lower six-position scrambling;
in the 3 rd to 4.1 th steps, DCT transformation is carried out on each 8 × 8 block, all ACs are set to be 0, and due to the characteristic of DCT transformation, after the image is subjected to IDCT transformation, the value of each pixel point in each 8 × 8 block is the average value of the block, so that the average value of each 8 × 8 block after the block is scrambled is accurately exposed, and therefore, a sub-key k is adopted in the 8.2 th step2The lower six bits of each pixel value in each 8 × 8 block are randomly scrambled as the 'seed' of the random number generator, and in order to keep the correlation of the pixels in the block and to facilitate the compression, the sub-keys in each block are the same, so that the average value of the block is hidden to a certain extent, and each block has a certain similarity with the original image.
Second, thumbnail decryption method
9 th, the encrypted thumbnail image is blocked as 8 × 8 and a subkey k is used2Carrying out lower six-bit reduction decryption operation on the pixel value in each block;
10 th, according to the subkey k1Decrypting the high-frequency coefficient AC separated in the step 4 according to the following formula;
11, performing DCT transformation and quantization on the thumbnail as in steps 2-3;
11.1, replacing the high-frequency coefficient in the DCT coefficient by the decrypted high-frequency coefficient in the step 10;
11.2, carrying out inverse quantization and IDCT (inverse discrete cosine transform) on the thumbnail to obtain a thumbnail with a slightly high resolution;
12 th, use of subkey k0Restoring the scrambled block to the originalAnd restoring the position of the initial image to a high-definition original image.
It can be seen that the final restored image is not the original image because the lossy mode of the compression algorithm in the encryption algorithm of the present invention performs quantization operations on the transformed coefficients, in other words the algorithm of the present invention is lossy, but the final image restoration quality is acceptable.
The invention has the advantages and beneficial effects that:
1. the invention provides a privacy protection scheme with elastic resolution, and the resolution of the image can be controlled by a user in practical application. Meanwhile, the elastic resolution also telescopically controls the safety of the thumbnail, and the image with not very high safety requirements can be subjected to higher resolution, so that online preview is facilitated; the image with strong safety requirement adopts low resolution, which is convenient for protecting image privacy;
2. in addition, the public part and the private part of the image are stored separately, and any one of the two parts cannot decrypt the image independently, so that difficulty is increased for an attacker to crack the encrypted image;
3. compared with the prior thumbnail image privacy protection scheme, the method combines a JPEG image compression algorithm, not only removes the detail information part in the image, but also reduces the storage overhead of the image after encryption with higher efficiency, and because the resolution in the scheme of the invention is elastic, the advantage of saving the storage overhead of the image after encryption is more obvious when the selected resolution is higher, and the size of the image after high-resolution or low-resolution encryption is obviously smaller than that of the original image, which is not realized by the prior scheme;
4. in the algorithm of the present invention, in order to reduce the storage overhead, DCT transform is used and coefficients are quantized, which results in the original image losing some information irretrievably, in other words, the scheme of the present invention is lossy, but provides acceptable image restoration quality on the premise of ensuring image security and compression efficiency.
These and other advantages of the present invention will become more apparent from the following detailed description of the preferred embodiments of the invention, which is to be read in connection with the accompanying drawings.
[ description of the drawings ]
FIG. 1 is a diagram illustrating an example of partitioning an image of size N × N in the present invention;
FIG. 2 is a flow diagram of M200 for elastic resolution thumbnail encryption of images, according to an embodiment of the present invention;
fig. 3 shows a flow diagram of M300 for partitioning and scrambling sub-blocks in the present invention.
FIG. 4 is an example of random scrambling among sub-blocks for 32 × 32 partitions at a scrambling level of 1-4 in accordance with an embodiment of the present invention;
FIG. 5 is a diagram showing the effect of scrambling among image sub-blocks at different scrambling levels;
a schematic diagram of setting the DCT transformed AC coefficients to 0 is shown in fig. 6, where the smallest unit block represents one pixel.
FIG. 7 is a specific example of setting 0 to the AC coefficients after the DCT transform after the inter-block scrambling;
FIG. 8 is a diagram illustrating a six-bit low random scrambling of pixel values in accordance with the present invention;
FIG. 9 shows a comparison of the size of the encrypted image common portion to the original image file, in data units KB;
FIG. 10 shows a comparison of the overall size of the encrypted image compared to the original image file size, in data units KB;
FIG. 11 is a table that lists the results of edge detection on a thumbnail at different scrambling levels;
FIG. 12 is a flowchart of thumbnail image decryption algorithm M1200;
FIG. 13 uses PSNR values to measure the reconstruction quality of the decrypted image, with data units in db;
fig. 14 shows the image reconstruction effect of 3 different resolution images.
[ detailed description ] embodiments
The following description will describe embodiments of the present invention with reference to the accompanying drawings.
For convenience, fig. 1 shows an exemplary diagram of partitioning in the present invention, where an N × N image is divided into N × N blocks, and each N × N block is divided into b × b sub-blocks by sub-division.
Example 1:
fig. 2 shows a flow diagram of an M200 embodiment of the algorithmic encryption process of the present invention.
As shown in fig. 2, the thumbnail encryption process starts at step S210.
S220, partitioning the image with the image size of 256 × 256 into 64 blocks of 32 × 32, partitioning each block of 32 × 32 into sub-blocks of 8 × 8, S230, randomly scrambling the sub-blocks in each block, wherein the degree of inter-block scrambling is determined by the scrambling level, the levels are different, the degree of inter-block scrambling is different, and the resolution of the final image is directly determined, and the random scrambling position of the sub-blocks is determined by the sub-key k0Decision (see M300 for detailed inter-sub-block scrambling procedure).
Fig. 4 shows a specific example of random scrambling among blocks, where for a 32 × 32 image block, a secondary division is performed, and the size of each sub-block is 8 × 8, so that the 32 × 32 block includes 16 sub-blocks, the left diagram in each unit in fig. 4 is an original block, the right diagram is the result of random scrambling of the sub-blocks in the left diagram, and the shaded block is a randomly selected block to be scrambled. According to the definition in step 1.2 of the thumbnail encryption algorithm, when the scrambling level is 0, no scrambling is performed, when the scrambling level is 1, 4 blocks needing scrambling are randomly selected, …, and so on, when the scrambling level is 4, all 16 sub-blocks are randomly scrambled, as shown in fig. 4.
Fig. 5 sequentially shows a graph of scrambling effects among image sub-blocks at different scrambling levels, and it can be seen that the rough outline of the image can still be seen from the effect of local block scrambling. When the level is 0, the image keeps the original image, and the image becomes more and more fuzzy with the increase of the scrambling level, which lays a foundation for the elastic resolution thumbnail in the algorithm.
In fig. 2, S240 is to perform DCT transform on each 8 × 8 block of the image according to the method in JPEG compression, quantize the DCT transform to obtain a high-frequency coefficient DC and a low-frequency coefficient AC, and leave DC and separate AC.
S250 in fig. 2 sets the portion of the original AC coefficient in S240 to 0, and performs inverse quantization and IDCT transform to obtain a thumbnail image with lower resolution.
Fig. 6 shows a schematic diagram of setting the AC coefficient to 0 after DCT transformation is performed on each 8 × 8 block, the upper left corner in the left diagram is the DC coefficient, the rest are the AC coefficients, and the right diagram shows that the original position of the AC after separation is set to 0.
Fig. 7 is a schematic diagram of an image after DCT-transforming the scrambled image and AC-0 according to a scrambling level of 3, the DC-concentrating the most important energy in the image, so that most of the information of the image is preserved and the detail is less when the AC is separated, so the resolution of the image will be lower.
S260 in FIG. 2 is a step of scanning the DCT coefficients of S240 using zigzag to obtain a one-dimensional block sequence, separating the AC coefficients therein, and using the subkey k1Stream cipher encryption is performed and stored as a private part.
S270 in fig. 2 is to re-divide the thumbnail generated in S250 into blocks, each block having a size of 8 × 8, scramble the lower six bits of the pixel value in each block using the same seed key, and store the scrambled pixel value as a common portion.
Fig. 8 shows a schematic diagram of low six-bit scrambling of 256 gray-scale pixel values, and the scrambled pixel values are no longer the exact average of the original image, but because the 2-bit high bit has not changed, the pixel values are still close to the average.
Ending the thumbnail encryption process in S280;
therefore, the encrypted image of the elastic resolution thumbnail of the public part and the encrypted sequence of the private part are obtained, and in order to measure the cost of consuming the storage space after the image is encrypted, the storage space consumed by the ciphertext and the plaintext is compared.
FIG. 9 compares the file sizes (in KB) between the public part of the encrypted image and the plaintext at different scrambling levels. When the level is 0, the original image is represented, the file size is 39.7KB, and when the scrambling level is more than 1, the public part is about 0.5KB, namely, the thumbnail part which is stored on the server and provides picture management and preview is greatly reduced compared with the original image, so that the storage expense of the server of the public part is greatly saved, the bandwidth can be saved to a greater extent, and the working performance of the server is improved.
Fig. 10 shows a comparison between the total file size (public part + private part) after encryption and the file size of the original image, and it can be seen from the figure that the scheme of the present invention not only has no additional overhead, but also greatly reduces the storage space of the original image, which is greatly improved compared with the previous thumbnail image privacy protection algorithm.
Edge detection is a common method of attacking privacy today because the most important information in an image is contained in the border portion of the image. The invention uses the most common Canny operator edge detection method in the MATLAB toolbox to evaluate the safety of the thumbnail image.
FIG. 11 shows that some feature points can be detected by using edge detection at different levels of the artwork and levels 0-4, where level0 and level1-level4 respectively represent the results of edge detection on the artwork and different resolution thumbnails. It can be seen that as the level of scrambling increases, the image edge detection becomes less and less effective, and for experts in the field of computer vision or signal processing, who have collected various data sets, it may be possible to analyze some information from these exposed feature points, but if the picture is not in any data set, the content in the image cannot be identified, or for a layman, no information can be obtained from the result in the picture.
FIG. 12 is a flowchart of a method M1200 for decrypting a thumbnail image, which starts at step S1210 and proceeds to step S1220 via a subkey k2The lower six bits of all pixel values are restored. S1230 will use the subkey k1And decrypting the private part of data to obtain a decrypted AC sequence.
In step S1240, DCT transform is applied to the thumbnail image according to JPEG compression and quantization, and step S1250 replaces the AC coefficient obtained in step S1240 with the decrypted AC coefficient in step S1230, and performs inverse quantization and IDCT transform to obtain a restored image.
S1260 according to the subkey k0And (4) performing reverse scrambling operation on the image to obtain a recovered high-definition original image, wherein the thumbnail image decryption algorithm is finished in S1270.
It should be noted that the final restored image is not the original image because the lossy mode in JPEG compression is used in the encryption algorithm, and the quantization operation is performed on the DCT-transformed coefficients, so that a part of the information of the original image is lost, in other words, the algorithm of the present invention is lossy, but the final image restoration quality is acceptable.
Fig. 13 shows the data of the image restoration quality according to the present invention, and it has been found that the image quality acceptable to human eyes is achieved when the PSNR values of the reconstructed image and the original image are above 28 db.
As can be seen from fig. 13, the recovery quality of the image is within the range acceptable to human eyes, and the reconstruction quality of the image hardly changes due to the change of the size of the sub-blocks and the scrambling level, because the loss of the image is only reflected in the quantization process after DCT transformation, although the present invention divides different blocks, the sub-blocks in each block are multiples of 8 × 8, and the positions of the pixel points in each sub-block are not changed, so that the size of the image sub-blocks and the scrambling level between the sub-blocks are not the influence factors of the image quality.
Fig. 14 shows a schematic diagram of an image reconstructed when the scrambling level is 4 for images with different resolutions. Wherein the image resolutions of the first to third columns are 256 × 256, 512 × 512, and 1024 × 1024, respectively. It can be easily found that, as the resolution of the image is higher, any trace of image loss is not found from the viewpoint of human eyes. The reconstruction quality effect of the inventive algorithm is thus very considerable.
Claims (1)
1. A thumbnail image privacy protection method based on image compression and elastic resolution comprises a thumbnail encryption method and a thumbnail decryption method;
first part, thumbnail encryption method
In the thumbnail image encryption process, the image is finally divided into a public part and a private part, the public part is a low-resolution thumbnail, and the private part is a fully encrypted binary sequence, and the specific contents are as follows:
1, partitioning an image in a spatial domain: reading image information in a bitmap image file, and partitioning an original image according to N multiplied by N, wherein N is less than N, and the image size of the image is assumed to be N multiplied by N;
1.1, dividing each block with the size of n multiplied by n for the second time, wherein the size of each sub-block is b multiplied by b, and b is less than n;
1.2, randomly scrambling a plurality of sub-blocks in each n × n block, taking the properties of JPEG compression into consideration, and adopting n mod8 ≡ 0 and b mod8 ≡ 0 in order to better obtain the image recovery quality, wherein the number of the sub-blocks b × b participating in scrambling is determined by a sub-key k0Deciding to elastically control a resolution of the thumbnail image, and a random position of the sub-block participating in the scrambling is generated by a pseudo random number generator;
assuming that each N × N block contains m b × b sub-blocks, the scrambling level of the image is divided into 5 levels: when the level is 0, the image is not scrambled and is not compressed, and the original image is completely reserved; level is 1, and m/4 subblocks participate in scrambling; 2, m/2 subblocks participate in scrambling; sub-blocks with the level of 3, 3m/4 participate in scrambling; level is 4, and m subblocks participate in scrambling; the level is used as the seed of a pseudo-random number generator to determine the random scrambling position of the subblocks;
2, taking reference to the JPEG compression method, the image is DCT-transformed into the frequency domain through forward discrete cosine transform, wherein the DCT-transformation of the image follows the following rules:
2.1, subtracting 128 from each pixel data of the image to make the range of the pixel value fall into the range between-128 and 127, thus greatly reducing the probability that the decimal number is 3 bits after DCT conversion and being convenient for reducing the coded digit when VIL coding is used;
2.2, by combining the properties of JPEG compression, applying DCT (discrete cosine transformation) to each 8 x 8 image block to obtain 1 DC coefficient and 63 AC coefficients, and simultaneously, calling the DC coefficient as a low-frequency coefficient and the AC coefficient as a high-frequency coefficient;
3, quantizing the DCT transform result in the step 2, namely dividing each 8 multiplied by 8 block of the image by a default quantization table in JPEG compression, and rounding the result to a reserved integer; thus, most of the high frequency coefficients in the DCT coefficients become "0", and some of the coefficients that are not set to "0" will also suffer some loss in accuracy; the quantization aims at filtering high-frequency coefficients in the image, and the main information of the image is concentrated in the low-frequency part of the image, so that the compression effect can be achieved, and the main information of the image cannot be greatly influenced;
4, zigzag scanning is carried out on each 8 × 8 DCT coefficient quantized in the step 3, so that a 1 × 64 one-dimensional sequence is obtained for the 8 × 8 DCT coefficients;
4.1, separating a high-frequency coefficient AC from a low-frequency coefficient DC, storing the high-frequency coefficient as a private part, and replacing the position of the high-frequency coefficient with '0';
4.2, carrying out zero run coding and Huffman coding on the separated high-frequency coefficient, further compressing the sequence coding length of the data to obtain a binary sequence w0,w1,...,wi;
4.3, carrying out stream cipher encryption on the high-frequency coefficient in the step 4.2;
the specific method for encrypting the stream cipher comprises the following steps: using subkey k1Generating a binary keystream r by a stream cipher generator0,r1,...,riAnd for the binary value w in the 4.2 stepiThe sequence is encrypted as follows to obtain wi' sequence:
wi' will be saved as a private part;
5, carrying out the alizgzag scanning and inverse quantization on the coefficient with the high-frequency coefficient set to be 0, discarding the detailed part of the image as the result of inverse quantization, and only keeping the rough characteristic of the image;
6, carrying out Inverse Discrete Cosine Transform (IDCT) on the DCT coefficient processed in the step 5 to transform the DCT coefficient into a spatial domain;
step 7, subtracting 128 from all pixel values in step 2.1, adding 128, and restoring the pixel values to the range of 0-255, thus obtaining the thumbnail of the corresponding scrambling level;
8, carrying out block encryption on the thumbnail in the step 7 again, wherein the size of each block is 8 multiplied by 8;
8.1, when the pixel value in each block of the thumbnail is the average value of the block, the lower six bits of the pixel in each block need to be randomly scrambled, so that the pixel value of the block is not the exact average value but is close to the average value;
8.2, to ensure the compression effect of the image, the same sub-key k is used for 64 pixels in the same block2Carrying out pixel value lower six-position scrambling;
although the sub-blocks in each block are scrambled to a certain degree in the step 1, which brings a certain difficulty for an attacker to violently crack the image, in the steps 2 to 4.1, DCT transformation is carried out on each 8 × 8 block, all ACs are set to be 0, and due to the characteristic of DCT transformation, after the IDCT transformation is carried out on the image, the value of each pixel point in each 8 × 8 block is the average value of the block, so that the average value of each 8 × 8 block after the block is scrambled is accurately exposed, and therefore, a sub-key k is adopted in the step 8.22In order to keep the correlation of the pixels in the blocks and facilitate compression, the subkeys in each block are the same, thus hiding the average value of the blocks to a certain extent and ensuring that each block has certain similarity with the original image;
second part, abbreviated diagram encryption method
9 th, the encrypted thumbnail image is blocked as 8 × 8 and a subkey k is used2Carrying out lower six-bit reduction decryption operation on the pixel value in each block;
10 th, according to the subkey k1Decrypting the high-frequency coefficient AC separated in the step 4 according to the following formula;
11, performing DCT transformation and quantization on the thumbnail as in steps 2-3;
11.1, replacing the high-frequency coefficient in the DCT coefficient by the decrypted high-frequency coefficient in the step 10;
11.2, carrying out inverse quantization and IDCT transformation on the thumbnail to obtain the thumbnail with higher resolution than the thumbnail in the step 8.2;
12 th, use of subkey k0And restoring the scrambled blocks to the position of the original image, and restoring the original image with high definition.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810617319.7A CN108810555B (en) | 2018-06-15 | 2018-06-15 | Thumbnail image privacy protection method based on image compression and elastic resolution |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810617319.7A CN108810555B (en) | 2018-06-15 | 2018-06-15 | Thumbnail image privacy protection method based on image compression and elastic resolution |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108810555A CN108810555A (en) | 2018-11-13 |
CN108810555B true CN108810555B (en) | 2020-09-22 |
Family
ID=64086635
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810617319.7A Active CN108810555B (en) | 2018-06-15 | 2018-06-15 | Thumbnail image privacy protection method based on image compression and elastic resolution |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108810555B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110298363A (en) * | 2019-06-27 | 2019-10-01 | 西安电子科技大学 | A kind of secret protection LBP feature extracting method on encrypted image |
CN113254680B (en) * | 2020-02-10 | 2023-07-25 | 北京百度网讯科技有限公司 | Cover map processing method of multimedia information, client and electronic equipment |
CN111538997A (en) * | 2020-03-31 | 2020-08-14 | 宇龙计算机通信科技(深圳)有限公司 | Image processing method, image processing device, storage medium and terminal |
CN113507546B (en) * | 2021-06-01 | 2023-07-18 | 暨南大学 | DCT-64-based image encryption method |
CN114553499B (en) * | 2022-01-28 | 2024-02-13 | 中国银联股份有限公司 | Image encryption and image processing method, device, equipment and medium |
CN115002293B (en) * | 2022-08-01 | 2022-10-25 | 江西财经大学 | Privacy confidentiality method, system and storage medium based on thumbnail format reservation |
CN117077187B (en) * | 2023-10-18 | 2024-01-09 | 江西财经大学 | Multistage visual privacy protection method, system, equipment and storage medium |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101717441B1 (en) * | 2015-06-12 | 2017-03-17 | 숭실대학교산학협력단 | Apparatus and method for protecting privacy in character image |
CN104851072A (en) * | 2015-06-18 | 2015-08-19 | 海南大学 | Robust watermarking method for medical image in cloud environment based on DFT encryption |
CN107845055B (en) * | 2017-07-17 | 2020-10-16 | 安徽大学 | Image encryption method for resisting Facebook compression |
CN107578452B (en) * | 2017-07-31 | 2020-08-18 | 华南理工大学 | JPEG image encryption method with compatible format and invariable size |
-
2018
- 2018-06-15 CN CN201810617319.7A patent/CN108810555B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN108810555A (en) | 2018-11-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108810555B (en) | Thumbnail image privacy protection method based on image compression and elastic resolution | |
Wright et al. | Thumbnail-preserving encryption for JPEG | |
Amirtharajan et al. | An intelligent chaotic embedding approach to enhance stego-image quality | |
Zhang | Separable reversible data hiding in encrypted image | |
Cheng | Partial encryption for image and video communication | |
Li et al. | Joint image encryption and compression schemes based on 16× 16 DCT | |
WO2013089758A1 (en) | Preserving image privacy when manipulated by cloud services | |
Kumar et al. | Reversible data hiding: A contemporary survey of state-of-the-art, opportunities and challenges | |
Chuman et al. | Image manipulation on social media for encryption-then-compression systems | |
Houssein et al. | An image steganography algorithm using haar discrete wavelet transform with advanced encryption system | |
Das et al. | An image secret sharing technique with block based image coding | |
Chuman et al. | Image manipulation specifications on social networking services for encryption-then-compression systems | |
Chai et al. | TPE-ADE: Thumbnail-Preserving Encryption Based on Adaptive Deviation Embedding for JPEG Images | |
Sakr et al. | A steganographic method based on DCT and new quantization technique | |
Ullah et al. | Selective region based images encryption | |
Ahmed et al. | A perceptually scalable and jpeg compression tolerant image encryption scheme | |
Xiang et al. | Degradative encryption: An efficient way to protect SPIHT compressed images | |
Vanmathi et al. | A Survey of State of the Art techniques of Steganography | |
CN115131253B (en) | Secret image sharing method and system for resisting JPEG recompression | |
CN114782563B (en) | Secret image sharing method and system for JPEG image | |
CN115208549A (en) | JPEG image reversible information hiding method and system based on Paillier homomorphic encryption | |
Mahasree et al. | An improved reversible data hiding for encrypted images over cloud | |
Parameshwaran et al. | Encryption algorithms for color images: a brief review of recent trends | |
Vinayagar | Image steganography using HBC and RDH technique | |
CN115330890B (en) | Secret image sharing method and system based on global adjustment and stable block conditions |
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 | ||
OL01 | Intention to license declared | ||
OL01 | Intention to license declared |