CN110913234A - JPEG image encryption method - Google Patents

JPEG image encryption method Download PDF

Info

Publication number
CN110913234A
CN110913234A CN201911231469.5A CN201911231469A CN110913234A CN 110913234 A CN110913234 A CN 110913234A CN 201911231469 A CN201911231469 A CN 201911231469A CN 110913234 A CN110913234 A CN 110913234A
Authority
CN
China
Prior art keywords
coefficient
scrambled
dimensional
sequence
jpeg image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911231469.5A
Other languages
Chinese (zh)
Other versions
CN110913234B (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.)
Fujian Normal University
Original Assignee
Fujian Normal 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 Fujian Normal University filed Critical Fujian Normal University
Priority to CN201911231469.5A priority Critical patent/CN110913234B/en
Publication of CN110913234A publication Critical patent/CN110913234A/en
Application granted granted Critical
Publication of CN110913234B publication Critical patent/CN110913234B/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
    • 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/182Methods 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 a pixel
    • 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

Abstract

The invention provides a JPEG image encryption method, which comprises the steps of obtaining a JPEG image to be encrypted and a corresponding DC coefficient and an AC coefficient; scrambling the DC coefficient and the AC coefficient respectively to obtain a scrambled DC coefficient and a scrambled AC coefficient; generating a DC difference sequence according to the scrambled DC coefficient, and performing self-adaptive clustering and marking operation according to the DC difference sequence to obtain the scrambled DC difference sequence; and coding the JPEG image to be encrypted according to the scrambled AC coefficient and the scrambled DC difference sequence to obtain the encrypted JPEG image, so that the scrambling effect of the DC coefficient is more obvious, the encryption effect is improved, multiple iterative operations are not needed, and the calculation is simple and easy.

Description

JPEG image encryption method
Technical Field
The invention relates to the technical field of multimedia information security, in particular to a JPEG image encryption method.
Background
In 2018, He et al proposed JPEG image encryption with improved format and file size prediction (a JPEG bit stream encryption algorithm with format compatibility) in IEEE Transactions on Multimedia, first, dividing consecutive DC difference sequences with the same symbol into the same group by the symbol property of the patterned DC difference sequence, and implementing random change on each group, so as to achieve the purpose of disturbing the order of the DC difference sequences and simultaneously ensure that the DC coefficients do not overflow when decoding; secondly, a grouping and exchanging strategy is provided, and the secondary disturbance of the DC difference sequence is further realized through multiple iterations; thirdly, according to the length difference of the zero coefficient, dividing all non-zero AC coefficients into 63 classes, and carrying out internal scrambling on each class; finally, scrambling is performed in units of Minimum Coding Units (MCUs) to further scramble the distribution of the AC coefficients. The method scrambles DCCs and ACCs, thereby realizing JPEG bit stream encryption. The method has excellent format compatibility and well keeps the sizes of the JPEG bit stream before and after encryption.
However, the following disadvantages still exist:
1. the first round of encryption for the DC coefficients is of limited effect. The DC coefficient, belonging to a low-frequency coefficient, is a main component of an image, and the encryption quality of the DC coefficient directly affects the encryption effect of the JPEG bit stream. Then, in practice, the length of the consecutive co-signed DC difference sequence is quite limited, so that the scrambling effect of this step is limited.
2. In the scheme, the DC difference sequence clustering and exchange encryption strategy adopted in the second step needs to be iterated for multiple times to enable the decoded image to tend to be noisy (the original text is expressed as not less than 15 times), so that more computing resources and time are inevitably wasted. Meanwhile, the clustering and exchanging method cannot guarantee that the DC coefficient will not overflow during decoding, so that a constraint condition needs to be added in the iterative process, thereby ensuring the accuracy of decoding and further causing higher calculation difficulty and time consumption.
Disclosure of Invention
Technical problem to be solved
In order to solve the above problems of the prior art, the present invention provides a JPEG image encryption method with good encryption effect and simple and easy calculation, which can be improved.
(II) technical scheme
In order to achieve the purpose, the invention adopts the main technical scheme that:
a method of JPEG image encryption comprising the steps of:
s1, acquiring a JPEG image to be encrypted and a corresponding DC coefficient and an AC coefficient;
s2, scrambling the DC coefficient and the AC coefficient respectively to obtain a scrambled DC coefficient and a scrambled AC coefficient;
s3, generating a DC difference sequence according to the scrambled DC coefficient, and performing self-adaptive clustering and marking operation according to the DC difference sequence to obtain the scrambled DC difference sequence;
s4, encoding the JPEG image to be encrypted according to the scrambled AC coefficient and the scrambled DC difference sequence to obtain an encrypted JPEG image.
(III) advantageous effects
The invention has the beneficial effects that: acquiring a JPEG image to be encrypted and a corresponding DC coefficient and an AC coefficient; scrambling the DC coefficient and the AC coefficient respectively to obtain a scrambled DC coefficient and a scrambled AC coefficient; generating a DC difference sequence according to the scrambled DC coefficient, and performing self-adaptive clustering and marking operation according to the DC difference sequence to obtain the scrambled DC difference sequence; and coding the JPEG image to be encrypted according to the scrambled AC coefficient and the scrambled DC difference sequence to obtain the encrypted JPEG image, so that the scrambling effect of the DC coefficient is more obvious, the encryption effect is improved, multiple iterative operations are not needed, and the calculation is simple and easy.
Drawings
FIG. 1 is a flow chart of a method of JPEG image encryption in accordance with an embodiment of the present invention;
FIG. 2 is a diagram illustrating the effect of JPEG image encryption;
fig. 3 is a diagram illustrating the encryption effect of a conventional JPEG bitstream encryption algorithm with format compatibility.
Detailed Description
For the purpose of better explaining the present invention and to facilitate understanding, the present invention will be described in detail by way of specific embodiments with reference to the accompanying drawings.
Example one
Referring to fig. 1 to 3, a method for encrypting a JPEG image includes the steps of:
s1, acquiring a JPEG image to be encrypted and a corresponding DC coefficient and an AC coefficient;
step S1 specifically includes:
and acquiring a JPEG image to be encrypted, analyzing to obtain a one-dimensional DC coefficient sequence and an AC coefficient, and generating a corresponding two-dimensional DC coefficient matrix according to the one-dimensional DC coefficient sequence.
S2, scrambling the DC coefficient and the AC coefficient respectively to obtain a scrambled DC coefficient and a scrambled AC coefficient;
step S2 specifically includes:
s21, scrambling the two-dimensional DC coefficient matrix to obtain a scrambled two-dimensional DC coefficient matrix;
step S21 includes:
s211, generating a pseudo-random sequence, and performing transformation operation on the two-dimensional DC coefficient matrix according to the pseudo-random sequence to obtain a transformed two-dimensional DC coefficient matrix;
s212, generating a pseudo-random uniform distribution with a value range of [0,1], and performing inversion operation on the transformed two-dimensional DC coefficient matrix according to the pseudo-random uniform distribution to obtain a scrambled two-dimensional DC coefficient matrix.
And S22, scrambling the AC coefficient to obtain a scrambled AC coefficient.
Step S22 specifically includes:
and generating a pseudo-random chaotic sequence, and carrying out scrambling operation according to the AC coefficient of the pseudo-random chaotic sequence to obtain a scrambled AC coefficient.
S3, generating a DC difference sequence according to the scrambled DC coefficient, and performing self-adaptive clustering and marking operation according to the DC difference sequence to obtain the scrambled DC difference sequence;
step S3 includes:
s31, generating a corresponding one-dimensional DC sequence according to the scrambled two-dimensional DC coefficient matrix;
s32, performing difference value calculation on the one-dimensional DC sequence to obtain a one-dimensional DC difference value sequence;
and S33, performing self-adaptive clustering and marking operation according to the one-dimensional DC difference sequence to obtain a scrambled DC difference sequence.
S4, encoding the JPEG image to be encrypted according to the scrambled AC coefficient and the scrambled DC difference sequence to obtain an encrypted JPEG image.
Step S4 specifically includes:
and according to the JPEG standard, entropy coding is respectively carried out on the scrambled AC coefficient and the scrambled DC difference value sequence to obtain an encrypted JPEG image.
Example two
The difference between this embodiment and the first embodiment is that this embodiment will further explain how the JPEG image encryption method of the present invention is implemented in combination with a specific application scenario:
s1, acquiring a JPEG image to be encrypted and a corresponding DC coefficient and an AC coefficient;
step S1 specifically includes:
and acquiring a JPEG image to be encrypted, analyzing to obtain a one-dimensional DC coefficient sequence and an AC coefficient, and generating a corresponding two-dimensional DC coefficient matrix according to the one-dimensional DC coefficient sequence.
Specifically, the method comprises the following steps: taking the grayscale image as an example, and assuming that the grayscale image is JPEG compressed and encoded to obtain a JPEG bitstream JS:
(1) analyzing a one-dimensional DC coefficient sequence and an AC coefficient of each MCU from the JPEG bit stream JS;
(2) reconstructing a DC coefficient series according to a DC coding rule in a JPEG standard;
(3) converting the one-dimensional DC coefficient sequence from a 1 x (h x w) one-dimensional space to a h x w two-dimensional DC coefficient matrix;
s2, scrambling the DC coefficient and the AC coefficient respectively to obtain a scrambled DC coefficient and a scrambled AC coefficient;
step S2 specifically includes:
s21, scrambling the two-dimensional DC coefficient matrix to obtain a scrambled two-dimensional DC coefficient matrix;
step S21 includes:
s211, generating a pseudo-random sequence, and performing transformation operation on the two-dimensional DC coefficient matrix according to the pseudo-random sequence to obtain a transformed two-dimensional DC coefficient matrix;
(4) generating a pseudo-random sequence; from this pseudo-random sequence, a row transform (one-to-one row exchange) is performed on the two-dimensional DC coefficient matrix.
S212, generating a pseudo-random uniform distribution with a value range of [0,1], and performing inversion operation on the transformed two-dimensional DC coefficient matrix according to the pseudo-random uniform distribution to obtain a scrambled two-dimensional DC coefficient matrix.
(5) Generating a pseudo-random uniform distribution with a value of [0,1 ]; for a certain row, if the random value is 0, not performing row inversion; if the random value is 1, then a row inversion is performed on the row, i.e., the first DC coefficient is swapped with the last one, the second is swapped with the second last, and so on).
(6) Obtaining a two-dimensional DC coefficient matrix after scrambling;
and S22, scrambling the AC coefficient to obtain a scrambled AC coefficient.
Step S22 specifically includes:
and generating a pseudo-random chaotic sequence, and carrying out scrambling operation according to the AC coefficient of the pseudo-random chaotic sequence to obtain a scrambled AC coefficient.
S3, generating a DC difference sequence according to the scrambled DC coefficient, and performing self-adaptive clustering and marking operation according to the DC difference sequence to obtain the scrambled DC difference sequence;
step S3 includes:
s31, generating a corresponding one-dimensional DC sequence according to the scrambled two-dimensional DC coefficient matrix;
s32, performing difference value calculation on the one-dimensional DC sequence to obtain a one-dimensional DC difference value sequence;
(7) converting the two-dimensional DC coefficient matrix after scrambling obtained in the step from h multiplied by w two-dimensional space into a 1 multiplied (h multiplied by w) one-dimensional DC coefficient sequence; and calculating difference to obtain one-dimensional DC difference sequence
And S33, performing self-adaptive clustering and marking operation according to the one-dimensional DC difference sequence to obtain a scrambled DC difference sequence.
(8) And performing grouping and marking operation on the DC difference value sequence. And dividing the one-dimensional DC difference value sequence into T coefficient groups and T mark groups according to the principle that the DC coefficient does not overflow, so that the scrambling operation in each coefficient group can not cause the DC coefficient overflow in the decoding stage. Any two adjacent coefficient groups are separated by 1 mark group. The process is adaptive and does not need to be recorded.
Examples of clustering and labeling are as follows:
Figure BDA0002303500820000061
Figure BDA0002303500820000062
Figure BDA0002303500820000063
wherein G ═ GtDenotes a coefficient group, M ═ MtDenotes the marker population and d denotes the DC difference sequence.
The basic principle of grouping: for a given temporary group St-1,Mt-1,Gt]Sum of all positive numbers (including 0) within the group Sum+And Sum of all negatives within the group Sum-Satisfies the following conditions:
(Qmin≤Sum-,Sum+≤Qmax)&&((Sum++Mt>Qmax)||(Sum-+Mt<Qmin))
wherein S ist-1Means Mt-1Sum of all previous DC difference sequences, and S0=0,
Figure BDA0002303500820000064
Figure BDA0002303500820000065
QminAnd QmaxRespectively, the upper and lower bounds of the DC coefficient, the values of which are related to QF.
(9) After the grouping, a pseudo-random sequence having a length corresponding to the length of each coefficient group is generated for scrambling the coefficient group.
(10) The tag group contains 1 element or is empty, and is not scrambled and kept unchanged.
(11) And obtaining the scrambled DC difference value sequence.
S4, encoding the JPEG image to be encrypted according to the scrambled AC coefficient and the scrambled DC difference sequence to obtain an encrypted JPEG image.
Step S4 specifically includes:
and according to the JPEG standard, entropy coding is respectively carried out on the scrambled AC coefficient and the scrambled DC difference value sequence to obtain an encrypted JPEG image.
(12) Entropy encoding the DC difference sequence according to JPEG standard;
(13) according to the JPEG standard, entropy coding is performed on the AC coefficients.
(14) After the encryption of the DC coefficient and the AC coefficient of the current MCU is finished, the DC coefficient and the AC coefficient of each MCU are entropy-coded again in the same way, and therefore the final bit stream JS of the JPEG image is generated*
For the disadvantage 1, according to experimental statistics, the scrambling strategy of continuous DC difference values with the same sign has the disadvantage of short length, and adjacent image blocks have certain similarity, so that the scrambling effect is limited in a local area with short length, and the decoded image content is still visible to naked eyes. For this reason, the present invention ensures the effect of scrambling within a cluster by making the length of each cluster significantly longer, thus making the scrambling range per DC wider. Meanwhile, in order to further ensure the encryption effect of the DC, the invention designs a line-based transformation and inversion strategy by combining the compression and coding characteristics of JPEG on the DC coefficient, and scrambles the DC coefficient globally, so that the method has more obvious scrambling on the DC coefficient and better effect.
Aiming at the defect 2, the method of the invention does not need complex operation and can realize the effect of scrambling the JPEG image into noise. Meanwhile, repeated iterative operation is not needed, and the calculation is simple and easy.
Comparison table of average cipher text length after encryption of the method of the invention and the existing method
Figure BDA0002303500820000071
Figure BDA0002303500820000081
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all equivalent changes made by using the contents of the present specification and the drawings, or applied directly or indirectly to the related technical fields, are included in the scope of the present invention.

Claims (7)

1. A JPEG image encryption method is characterized by comprising the following steps:
s1, acquiring a JPEG image to be encrypted and a corresponding DC coefficient and an AC coefficient;
s2, scrambling the DC coefficient and the AC coefficient respectively to obtain a scrambled DC coefficient and a scrambled AC coefficient;
s3, generating a DC difference sequence according to the scrambled DC coefficient, and performing self-adaptive clustering and marking operation according to the DC difference sequence to obtain the scrambled DC difference sequence;
s4, encoding the JPEG image to be encrypted according to the scrambled AC coefficient and the scrambled DC difference sequence to obtain an encrypted JPEG image.
2. The method for encrypting the JPEG image according to claim 1, wherein the step S1 is specifically:
and acquiring a JPEG image to be encrypted, analyzing to obtain a one-dimensional DC coefficient sequence and an AC coefficient, and generating a corresponding two-dimensional DC coefficient matrix according to the one-dimensional DC coefficient sequence.
3. The method for encrypting the JPEG image according to claim 2, wherein the step S2 is specifically:
s21, scrambling the two-dimensional DC coefficient matrix to obtain a scrambled two-dimensional DC coefficient matrix;
and S22, scrambling the AC coefficient to obtain a scrambled AC coefficient.
4. The method for encrypting the JPEG image according to claim 3, characterized in that the step S21 includes:
s211, generating a pseudo-random sequence, and performing transformation operation on the two-dimensional DC coefficient matrix according to the pseudo-random sequence to obtain a transformed two-dimensional DC coefficient matrix;
s212, generating a pseudo-random uniform distribution with a value range of [0,1], and performing inversion operation on the transformed two-dimensional DC coefficient matrix according to the pseudo-random uniform distribution to obtain a scrambled two-dimensional DC coefficient matrix.
5. The method for encrypting the JPEG image according to claim 3, wherein the step S22 is specifically:
and generating a pseudo-random chaotic sequence, and carrying out scrambling operation according to the AC coefficient of the pseudo-random chaotic sequence to obtain a scrambled AC coefficient.
6. The method for encrypting the JPEG image according to claim 3, characterized in that the step S3 includes:
s31, generating a corresponding one-dimensional DC coefficient sequence according to the scrambled two-dimensional DC coefficient matrix;
s32, performing difference calculation on the one-dimensional DC coefficient sequence to obtain a one-dimensional DC difference sequence;
and S33, performing self-adaptive clustering and marking operation according to the one-dimensional DC difference sequence to obtain a scrambled DC difference sequence.
7. The method for encrypting the JPEG image according to claim 6, wherein the step S4 is specifically:
and according to the JPEG standard, entropy coding is respectively carried out on the scrambled AC coefficient and the scrambled DC difference value sequence to obtain an encrypted JPEG image.
CN201911231469.5A 2019-12-05 2019-12-05 JPEG image encryption method Active CN110913234B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911231469.5A CN110913234B (en) 2019-12-05 2019-12-05 JPEG image encryption method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911231469.5A CN110913234B (en) 2019-12-05 2019-12-05 JPEG image encryption method

Publications (2)

Publication Number Publication Date
CN110913234A true CN110913234A (en) 2020-03-24
CN110913234B CN110913234B (en) 2021-11-30

Family

ID=69822464

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911231469.5A Active CN110913234B (en) 2019-12-05 2019-12-05 JPEG image encryption method

Country Status (1)

Country Link
CN (1) CN110913234B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6505299B1 (en) * 1999-03-01 2003-01-07 Sharp Laboratories Of America, Inc. Digital image scrambling for image coding systems
WO2004040903A1 (en) * 2002-11-01 2004-05-13 Koninklijke Philips Electronics N.V. Image decryption device and method
CN105975866A (en) * 2016-04-26 2016-09-28 长安大学 Intra-class coefficient scrambling-based JPEG image encryption method
CN107578452A (en) * 2017-07-31 2018-01-12 华南理工大学 A kind of jpeg image encryption method with compatible format and constant size
CN109150492A (en) * 2018-08-17 2019-01-04 中国矿业大学 More image encryption methods based on three-dimensional scramble model and chaos
CN109889687A (en) * 2019-01-30 2019-06-14 西南交通大学 The jpeg image bit stream encryption method changed based on exchange statistical nature

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6505299B1 (en) * 1999-03-01 2003-01-07 Sharp Laboratories Of America, Inc. Digital image scrambling for image coding systems
WO2004040903A1 (en) * 2002-11-01 2004-05-13 Koninklijke Philips Electronics N.V. Image decryption device and method
CN105975866A (en) * 2016-04-26 2016-09-28 长安大学 Intra-class coefficient scrambling-based JPEG image encryption method
CN107578452A (en) * 2017-07-31 2018-01-12 华南理工大学 A kind of jpeg image encryption method with compatible format and constant size
CN109150492A (en) * 2018-08-17 2019-01-04 中国矿业大学 More image encryption methods based on three-dimensional scramble model and chaos
CN109889687A (en) * 2019-01-30 2019-06-14 西南交通大学 The jpeg image bit stream encryption method changed based on exchange statistical nature

Also Published As

Publication number Publication date
CN110913234B (en) 2021-11-30

Similar Documents

Publication Publication Date Title
He et al. JPEG image encryption with improved format compatibility and file size preservation
CN105741224B (en) The reversible water mark algorithm divided based on PVO and adaptive block
CN107578452B (en) JPEG image encryption method with compatible format and invariable size
Zhang et al. Chaos-based partial encryption of SPIHT coded color images
Patel et al. Lazy wavelet transform based steganography in video
Liu et al. A new robust data hiding method for H. 264/AVC without intra-frame distortion drift
CN108009975A (en) Jpeg image reversible information hidden method based on two-dimensional histogram modification
Kumar et al. Reversible data hiding: A contemporary survey of state-of-the-art, opportunities and challenges
CN109684857A (en) A kind of information concealing method, terminal device and storage medium
Kumar et al. An improved data-hiding approach using skin-tone detection for video steganography
Yang et al. Huffman-code strategies to improve MFCVQ-based reversible data hiding for VQ indexes
Chen et al. Reversible watermarking for medical images using histogram shifting with location map reduction
Meng et al. A robust coverless video steganography based on maximum DC coefficients against video attacks
Dalal et al. A secure and robust video steganography scheme for covert communication in H. 264/AVC
Kim et al. Instability of successive deep image compression
CN110913234B (en) JPEG image encryption method
CN110381337B (en) Video encryption method based on chaos cipher theory and incompatible video coding
Aroukatos et al. Techniques in image steganography using famous number sequences
Ahuja et al. Robust Video Watermarking Scheme Based on Intra-Coding Process in MPEG-2 Style.
Van Rensburg et al. The first draco 3D Object crypto-compression scheme
Sathisha et al. Embedding information in DCT coefficients based on average covariance
Beroual et al. A review of steganographic methods and techniques
CN112929669B (en) Image encoding and decoding method and device
Al-Hashemi et al. A Grayscale Semi-Lossless Image Compression Technique Using RLE.
Bahrami et al. Encryption of video main frames in the field of DCT transform using A5/1 and W7 stream encryption algorithms

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