CN101110944B - Method and apparatus for encrypting video data - Google Patents

Method and apparatus for encrypting video data Download PDF

Info

Publication number
CN101110944B
CN101110944B CN2007101457442A CN200710145744A CN101110944B CN 101110944 B CN101110944 B CN 101110944B CN 2007101457442 A CN2007101457442 A CN 2007101457442A CN 200710145744 A CN200710145744 A CN 200710145744A CN 101110944 B CN101110944 B CN 101110944B
Authority
CN
China
Prior art keywords
scramble
matrix
regional
rule
adopts
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.)
Expired - Fee Related
Application number
CN2007101457442A
Other languages
Chinese (zh)
Other versions
CN101110944A (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 KECHUANG HI-TECH NET-VIDEO Co Ltd
Original Assignee
HUBEI KECHUANG HI-TECH NET-VIDEO Co Ltd
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 KECHUANG HI-TECH NET-VIDEO Co Ltd filed Critical HUBEI KECHUANG HI-TECH NET-VIDEO Co Ltd
Priority to CN2007101457442A priority Critical patent/CN101110944B/en
Publication of CN101110944A publication Critical patent/CN101110944A/en
Application granted granted Critical
Publication of CN101110944B publication Critical patent/CN101110944B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The present invention provides an encryption method for a video data, which comprises the following procedures: the macro block information of the video data is abstracted; a primary scrambling matrix is created; the macro block information is scrambled according to the primary scrambling matrix; the scrambling result of the primary scrambling matrix is divided into a plurality of areas, and a relative area scrambling rule for each area is determined; a secondary scrambling matrix for the entire video data is gained according to the collocation result by the coding information and the relative area scrambling rule of the macro block in each area; the scrambling result of the primary scrambling matrix is scrambled again according to the secondary scrambling matrix; a stream data is built and an encryption result is gained. The present invention solves the problem of the existing macro block scrambling algorithm that a partial encryption effect is inadequate, provides a better visual encryption effect, and the known plain text attack is ineffective. In conclusion, the present invention does not increase the stream, the speed is quick, the computing source occupation is low, the security is high, and the present invention is more suitable for the most real time application scene of the video encryption.

Description

A kind of encryption method of video data and device
Technical field
The present invention relates to the process field of video data, particularly relate to a kind of method and apparatus of quick, safe video-encryption.
Background technology
Along with the remarkable development of video compression technology and network technology, as video request program, video conference, monitoring remote video, and network multimedia business such as multi-media SMS is universal day by day, the good and bad influence degree of video data treatment effect is more and more wider.Wherein, information security is an important component part of multimedia service, so video-encryption becomes critical research topic in the current multimedia service.
Video-encryption is different from traditional cryptographic key and encrypts thought.Mass data in the face of video, use traditional RSA (rivest, shamir, adelman, RSA is respectively Rivest, Shamir, the abbreviation of three inventors' of Adelman name word initial), DES (Data Encryption Standard, data encryption standard) and AES (the The Advanced Encryption Standard) scheme that scheduling algorithm is encrypted fully, obviously can't satisfy the real-time video demands of applications.
Along with the continuous development of multimedia service, the video traffic terminal is to low energy consumption, low storage, miniaturization development.Video flowing in most of multimedia services only requires to guarantee the of short duration time of its fail safe a qualification, rather than as long-term confidential data storage.Validity principle based on cryptographic algorithm: the cost that () cracks has surpassed the value of enciphered message itself; (2) time of cracking has surpassed the term of validity of enciphered message itself, and most multimedia service is to utilize a large amount of computational resources and time that it is encrypted.Therefore, rapidly and efficiently and the higher cryptographic algorithm of degree of safety be the preference algorithm of multimedia service.
Common selective video encryption method can be divided into four kinds: (one) is only to the cryptographic algorithm of I frame (basic frame); (2) encrypt motion vector algorithms; (3) coefficient hierarchical cryptographic algorithm in the DCT piece, DCT is discrete cosine transform: Discrete Cosine Transform, be called for short dct transform; (4) algorithm of encipher only header.Though this type of encryption method can obtain enciphering rate faster, its fail safe is lower.
Also proposed a kind of Entropy Encoding and Encryption thinking in the prior art, this cryptographic algorithm does not increase amount of calculation, does not change compression ratio substantially, but its key (code table after the encryption) is oversize, and fail safe is not high enough.
In addition, some encryption methods based on scramble thought also are introduced in the video-encryption scheme in succession, as the macro block scrambling algorithm.Common macro block scrambling algorithm and since its scramble matrix at sequence all be original locus sequence, so though speed is very fast, fail safe also can be accepted; But partial failure may appear in the subjective effect of its encryption, and promptly may to occur the degree of its scramble in the part not enough for information, and wherein, the subjective effect of encryption generally refers to the subjective identification degree to the information of image.
And common macro block scrambling algorithm is not high at the known plain text attack fail safe.The attack of known-plaintext, (known-plaintext attack): promptly cryptanalysis person not only can obtain the ciphertext of some message, and knows the plaintext of these message.Analyst's task is released with enciphered message exactly and is used for encrypted secret key or derives an algorithm, and this algorithm can be decrypted any new message with same secret key encryption.And for common macro block scrambling algorithm, after obtaining ciphertext and corresponding plaintext, its scramble matrix just can obtain.The scramble matrix that foundation obtains can further be resolved cryptographic algorithm, and can be directly used in the parsing to other ciphertexts.
In a word, need the urgent technical problem that solves of those skilled in the art to be exactly: it is higher and have a video-encryption technical scheme of good real-time how can to propose a kind of fail safe.
Summary of the invention
Technical problem to be solved by this invention provides a kind of video data method of encrypting and device, can obtain higher cipher round results, has good real time performance simultaneously.
In order to address the above problem, the invention discloses a kind of video data method of encrypting, comprising: the whole macro block informations that extract one-frame video data; Generate elementary scramble matrix; According to elementary scramble matrix macro block information is carried out scramble; The scramble result of elementary scramble matrix is divided into a plurality of zones, and determines corresponding regional scramble rule at each zone; Each described zone consists of a plurality of macro blocks; According to ranking results and the corresponding regional scramble rule of the macro block in each zone, obtain secondary scramble matrix at entire video data by the code length in its coded message; According to described secondary scramble matrix, the scramble result of elementary scramble matrix is carried out scramble once more; Make up bit stream data, obtain encrypted result.
If described elementary scramble matrix is the matrix of scramble at random based on pseudo random sequence; Then after the area dividing, the subregion adopts the magic square matrix as regional scramble rule, and another part zone adopts the result who keeps first macro block scramble as regional scramble rule; Perhaps, the subregion adopts the magic square matrix as regional scramble rule, and another part zone adopts the matrix of scramble at random based on pseudo random sequence as regional scramble rule; Perhaps, All Ranges all adopts the matrix of scramble at random based on pseudo random sequence as regional scramble rule.
If described elementary scramble matrix is: the permutation matrix of cruising based on the knight; Then after the area dividing, the subregion adopts the magic square matrix as regional scramble rule, and another part zone adopts the result who keeps first macro block scramble as regional scramble rule; Perhaps, the subregion adopts the magic square matrix as regional scramble rule, and another part zone adopts the matrix of scramble at random based on pseudo random sequence as regional scramble rule; Perhaps, All Ranges all adopts the matrix of scramble at random based on pseudo random sequence as regional scramble rule.
Preferably, adopt the Advanced Encryption Standard aes algorithm to generate stream cipher, as pseudo random sequence.
Preferably, described video data is the video data that meets Chinese digital audio/video encoding and decoding standard.
According to another embodiment of the present invention, the device that a kind of video data is encrypted is disclosed, comprising:
Extraction module is used to extract whole macro block informations of one-frame video data;
Elementary scramble matrix generation module is used to generate elementary scramble matrix;
First scramble module is used for according to elementary scramble matrix described macro block information being carried out scramble;
Area dividing and regulation determination module are used for the scramble result of elementary scramble matrix is divided into a plurality of zones, and determine corresponding regional scramble rule at each zone; Each described zone consists of a plurality of macro blocks;
Secondary scramble matrix generation module is used for obtaining the secondary scramble matrix at entire video data according to the ranking results and the corresponding regional scramble rule of the macro block in each zone by the code length of its coded message;
Secondary scramble module is used for according to described secondary scramble matrix, and the scramble result of elementary scramble matrix is carried out scramble once more;
Output module is used to make up bit stream data as a result, obtains encrypted result.
If described elementary scramble matrix is: based on the matrix of scramble at random of pseudo random sequence; Then after the area dividing, the subregion adopts the magic square matrix as regional scramble rule, and another part zone adopts the result who keeps first macro block scramble as regional scramble rule; Perhaps, the subregion adopts the magic square matrix as regional scramble rule, and another part zone adopts the matrix of scramble at random based on pseudo random sequence as regional scramble rule; Perhaps, All Ranges all adopts the matrix of scramble at random based on pseudo random sequence as regional scramble rule.
If described elementary scramble matrix is: the permutation matrix of cruising based on the knight; Then after the area dividing, the subregion adopts the magic square matrix as regional scramble rule, and another part zone adopts the result who keeps first macro block scramble as regional scramble rule; Perhaps, the subregion adopts the magic square matrix as regional scramble rule, and another part zone adopts the matrix of scramble at random based on pseudo random sequence as regional scramble rule; Perhaps, All Ranges all adopts the matrix of scramble at random based on pseudo random sequence as regional scramble rule.
Preferably, adopt the Advanced Encryption Standard aes algorithm to generate stream cipher, as pseudo random sequence.
Preferably, described video data is the video data that meets Chinese digital audio/video encoding and decoding standard.
Compared with prior art, the present invention has the following advantages:
Technical scheme proposed by the invention, owing in ciphering process, carry out superencipher according to the ordering of spatial information and macroblock encoding information respectively, reduce the still adjacent possibility of adjacent block, can guarantee to obtain to encrypt subjective effect preferably, improved the fail safe of cipher round results; And, under the attack of known-plaintext, because superencipher matrix of the present invention is relevant with its macroblock coding information, can't obtain the pseudo random sequence and the magic square matrix of its use according to the scramble matrix of its acquisition, also can't be directly used in the ciphertext of resolving other, therefore invalid for known plain text attack, fail safe is higher.
In addition, the present invention just changes the position of macroblock coding data in whole code stream, does not change the mode and the code coefficient thereof of macroblock coding, does not therefore increase code stream; Without decoding and cataloged procedure, only be the generation of the copy and the scramble matrix of code stream, so computational speed is fast, the computational resource that takies is lower.
Description of drawings
Fig. 1 is the flow chart of steps of a kind of video data method of encrypting of the present invention embodiment;
Fig. 2 adopts AES to generate the fundamental diagram of stream cipher;
Fig. 3 is a kind of schematic diagram of regional cutting;
Fig. 4 is the structured flowchart of the device embodiment of a kind of video data encryption of the present invention.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, the present invention is further detailed explanation below in conjunction with the drawings and specific embodiments.
The present invention can be used in numerous general or special purpose computingasystem environment or the configuration.For example: personal computer, server computer, handheld device or portable set, plate equipment, multicomputer system, the system based on microprocessor, set top box, programmable consumer-elcetronics devices, network PC, minicom, mainframe computer, comprise distributed computing environment (DCE) of above any system or equipment or the like.
The present invention can describe in the general context of the computer executable instructions of being carried out by computer, for example program module.Usually, program module comprises the routine carrying out particular task or realize particular abstract, program, object, assembly, data structure or the like.Also can in distributed computing environment (DCE), put into practice the present invention, in these distributed computing environment (DCE), by by communication network connected teleprocessing equipment execute the task.In distributed computing environment (DCE), program module can be arranged in the local and remote computer-readable storage medium that comprises memory device.
The application scenarios that the present invention preferably is suitable for is the ciphering process that is used for AVS (Audio Video Standard) video data; The AVS general solution is interpreted as: Chinese digital audio/video encoding and decoding standard.Therefore, generally all adopting AVS among the embodiment of back is that example describes.Certainly, the present invention can also be applied to other possible video formats, for example, and H.264 etc.H.264 be the new digital video coding standard of joint video team (JVT:jointvideoteam) exploitation of the moving picture expert group (MPEG) of the video coding expert group (VCEG) of ITU-T and ISO/IEC.
The AVS video standard is based on China's autonomous innovation technology and the constructed standard of international public technology, it is domestic most widely used video format in future, it is mainly towards high definition and High-Quality Digital Television broadcasting, Web TV, digital storage media and other related application, be characterized in the code efficiency height, the image definition height, algorithm complex is a little more than MPEG-2.The starting point of this standard is exactly to be to keep to improve the video compression ratio under the constant situation of visual quality as far as possible, satisfies the needs of application scenarioss such as Internet video and video storage with this.
With respect to early stage video coding, AVS has adopted more intra-frame encoding mode and interframe encoding mode, i.e. the neighborhood information that utilizes spatial domain and time domain of maximum possible in the cataloged procedure again; Thereby realize higher compression ratio, but meanwhile, it is more responsive to the variation meeting of code stream, therefore only relies on the macro block scramble, the AVS code stream just can access enough subjective cipher round results.The present invention is directed to existing macro block Chaotic Technology and improve, be incorporated in the video-encryption, realized fast a kind of and AVS video-encryption scheme efficiently with the notion of secondary scramble and based on the scramble of coded message ordering.
As the very crucial technology that AVS uses, the AVS video-encryption must be considered 5 following points: (one) in order to keep the characteristic of AVS high compression ratio, the AVS video-encryption should reduce the increase of code stream as far as possible; (2) consider self computation complexity of AVS and the needs of its real-time application scenarios, the AVS video-encryption should reduce the taking of computational resource as far as possible, reduces the time delay that is caused by encryption as far as possible; (3) in order to keep the high definition characteristic of AVS, the AVS video-encryption should avoid reducing picture quality as far as possible; (4) in order to be applicable to various application scenarioss, the AVS video-encryption should possess robustness to other video processnig algorithms; (5) in order to keep the versatility of code stream, the video-encryption algorithm should keep the AVS code flow structure as far as possible.And proposition of the present invention can be satisfied the demand to a certain extent preferably: applicability is strong, satisfy market application demand, subjective and objective cipher round results significantly and have a good real time performance.
With reference to Fig. 1, show a kind of video data method of encrypting of the present invention embodiment, comprising:
The macro block information of step 101, extraction video data;
With AVS is example, as long as carry out syntactic analysis according to the AVS code stream, need not pass through the entropy decode procedure of DCT coefficient, simple.Because the present invention based on principle be the macro block scramble, and the macro block scramble just changes the position of macroblock coding data in whole code stream, does not change the mode and the code coefficient thereof of macroblock coding, its ciphering process is the displacement of the code stream of unit with the macro block just.
The input of step 101 is AVS code streams, and its output is AVS macro block information table; Begin part to latter end from a frame of code stream, obtain the starting point and the length information of macro block one by one, utilize structure to preserve information, thereby form the macro block information table of a frame.For example, in the present embodiment, can comprise two variablees in the definition structure body: the macro block starting point is with respect to the skew bit startAdd of buffering area, the bit length blockLen of macro block data.Wherein, information table one speech only is for a kind of data structure form of storage macro block information being described, certainly, also can adopting other version.
Step 102, the elementary scramble matrix of generation;
Described elementary scramble matrix can for: based on the matrix of scramble at random of pseudo random sequence; Described elementary scramble matrix also can for: based on permutation matrix of the knight that cruises etc.
The generation of the above-mentioned matrix of scramble at random needs to exist a pseudo random sequence.For example, at the video data of each frame, a random number need introducing in this pseudo random sequence of scramble matrix calculates last scramble matrix at random.Simply introduce a kind of generative process of preferred pseudo random sequence below, and the generation of corresponding first scramble matrix.
AES is the abbreviation of English The Advanced Encryption Standard, generally is translated as Advanced Encryption Standard, the DEA that to be America NI ST formulate in calendar year 2001, and in recent years through checking and approving one of the safest cryptographic algorithm.If utilize its cipher feedback pattern (CFB) or output feedback mode (OFB), AES can be used as stream cipher and uses.Preferably, can adopt the OFB pattern of AES, it need not require to export the integral multiple that ciphertext is a block length, and can real-time operation.OFB pattern with 128 minimum packets length is an example, and as shown in Figure 2, its operation principle is as follows:
Suppose that requiring the cell size of output is the S position.The input of encryption function is 128 a shift register, and its value is initialization vector V.Encryption function at first uses key K that initialization vector V is carried out 128 AES and encrypts, and the high S position M1 with ciphertext output exports as stream cipher then, and M1 is inserted the rightmost S position of shift register in the S position that simultaneously 128 bit shift register moved to left.In ciphertext output next time,, repeat above-mentioned steps according to the cell size that requires to export.
Because the stream cipher of the OFB pattern of AES output has good stochastic behaviour, because its stream cipher can be used as pseudo random sequence.Stream cipher, i.e. one section data flow with stochastic behaviour, take out a number at every turn after, move behind the pointer of peek.For the generative process of first scramble matrix, stream cipher can be regarded a sufficiently long array as, be similar to 12,32,42,11,54,19 ..., take out after the number, move after the starting point of array.
Listed the generative process example that a macro block adds up to the elementary permutation matrix of M with the form of step below:
1), array IN[M of initialization], make its numerical value sequence arrangement, array OUT[M of initialization according to 1~M], make its pointer P point to first element, variable K of initialization, the not element number of copy in the expression current I N array, initial value is M;
2), a random number utilizing stream cipher to produce gets remainder operation to K, promptly produces the random number N of a 0~K;
3), from the IN array, take out N element, assignment is to pointer P element pointed;
4), all elements behind the N among the IN is moved forward a unit, K is from subtracting one, and P points to next element;
5) if pointer P in the scope of array OUT, then forwards the 2nd to) step;
6), algorithm finishes.At this moment, in the array OUT numerical value random alignment of 1~M, promptly constitute the random permutation matrix.
For the generation of stream cipher, also can pass through other modes, as chaos sequence, DES or the like.Certainly, chaos sequence, DES compare with AES, and it is more lower slightly that its fail safe is wanted.
Step 103, the elementary scramble matrix of foundation carry out scramble to described macro block information;
Step 104, the scramble result of elementary scramble matrix is divided into a plurality of zones, and determines corresponding regional scramble rule at each zone;
The strategy of area dividing, the present invention does not need to be limited, as long as be divided into a plurality of zones, for example, can preset a plurality of partition strategies, selects at random in these a plurality of partition strategies according to the stream cipher of AES then; Certainly, also can preset the algorithm of a random division, finish cutting at random in real time and get final product.
In a preferred embodiment of the invention, first scramble matrix adopts the matrix of scramble at random based on pseudo random sequence, and mainly adopt the magic square matrix at the regional scramble rule in each zone, can pass through area dividing, adopt follow-up macro block information to resequence and cover the pseudo random sequence distribution character spatially in early stage.Certainly, can generate magic square matrix according to the stream cipher of AES at a zone; Also can finish the generation of magic square matrix according to the random number that obtains according to other modes, promptly at elementary scramble arranged in matrix one pseudo random sequence, at another pseudo random sequence of secondary scramble arranged in matrix.
Wherein, being mode relatively more commonly used in the macro block scramble based on the matrix of scramble at random of pseudo random sequence, and introducing the magic square matrix, then is because the magic square matrix has good diffusivity and simple computational requirements; At each row and each row and diagonal of magic square matrix, the value of closing of all elements is identical, so its diffusivity is evenly distributed.
The magic square matrix has two features: the value of closing that each of the magic square matrix on (one) n rank is listed as each row and two cornerwise all elements equals a constant c; The replacement process of (two) magic square matrixes is about to that element 1 moves to 2 position in the matrix ..., element m is moved to the position of m+1 ..., last element moves to 1 position, if the magic square matrix is through repeating to replace n like this 2In the step, its displacement result necessarily equals it oneself so.As known from the above, the displacement of the maximum between the magic square matrix on n rank number of times is n 2Therefore/2, initial phase just produces in advance according to the permutation matrix of the same order of certain displacement step interval in the actual operation process.In follow-up computing, other matrix of same order then can be obtained through a spot of displacement number of times by these matrixes at an easy rate.For example, the displacement step-length that generates the magic square matrix is the stream cipher decision by AES, and the generation of its matrix is to obtain by the nearest matrix permutation that produces in advance of spacing distance with it.
Certainly, the present invention does not need the concrete mode of elementary scramble matrix is limited, and two matroids of listing above only are the present invention for convenience of description, and those skilled in the art can also introduce other feasible algorithms as required.
In fact, because the displacement second time of the present invention is a kind of protection to primary encryption, make primary cryptographic algorithm under the attack of known-plaintext, still keep its fail safe.If the fail safe of the algorithm of the first time and secondary encryption is simultaneously all too low, be difficult to guarantee twice replaced degree of safety so.Preferably, because for the second time the encryption space of displacement is less than the space of displacement for the first time, so the present invention can adopt the higher algorithm of a kind of fail safe at the scramble first time, for example, based on the permutation matrix of pseudo random sequence, same can also adopt the permutation matrix of cruising based on the knight; And it is a lot of for the second time to encrypt adoptable algorithm, and its fail safe that needs is so high not as the former, as based on the magic square matrix, based on chaos sequence, based on pseudo random sequence, cruise or the like based on the knight.
Since the number SIZE of magic square matrix containing element be certain Integer N square, therefore in order to utilize the spatial character of magic square matrix, the size of area dividing must be near square.Referring to Fig. 3, be example with CIF, horizontal direction macro block sum 22, vertical direction macro block sum 18 provides five kinds of partition modes as a reference; During area dividing, select to get final product in several spaces piece partition mode of formulating the user according to the stream cipher of AES.
As seen from Figure 3, in some cases, can be cut into a plurality of zones of satisfying magic square matrix needs just, the corresponding magic square matrix in each zone, but under the situation of Fig. 3, just may produce the zone that some do not satisfy magic square matrix needs, for example, the fringe region among Fig. 3 (differing far away) with required square.At these zones, can directly determine to adopt the result who keeps first macro block scramble as regional scramble rule, because first macro block scramble has been passed through in these zones, so can't cause the decline of cipher round results.
Step 105, according to the macro block in each zone by the ranking results and the corresponding regional scramble rule of its coded message, obtain secondary scramble matrix at entire video data;
Macroblock coding information sorting in the zone, preferred, can only sort to the size of the set of macroblocks in the square area according to its coded message, its sequence number is corresponding with follow-up magic square matrix element.Macroblock encoding information comprises the DC coefficient of code length, macro block mode, predictive mode, coded residual and AC coefficient or the like.Consider the simplification ciphering process, only adopt macroblock encoding length in the present embodiment as the coded message that is used to sort; Certainly, the complicated ordering strategy that also can adopt a plurality of coded message parameters to participate in.
As previously mentioned, preferred situation is that the twice replaced matrix that step 105 obtains has kept the part of elementary permutation matrix beyond the magic square matrix area.Sequence number and the position in the magic square matrix thereof after part in the magic square matrix area, the position of macro block sort according to its coded message need be replaced once more.
Step 106, according to described secondary scramble matrix, the scramble result of elementary scramble matrix is carried out scramble once more;
Because the set of the macro block in magic square matrix interval is depended on the spatial aggregation of the pseudo random sequence in early stage and is distributed, but by area dividing and rearrangement, make its ranking results the former spatial arrangements order be upset fully, promptly Qian Qi pseudo random sequence makes the magic square matrix to infer by the correlation of image, has then erased the arrangement of elements information of the pseudo random sequence in early stage fully based on the magic square matrix of macroblock coding information sorting.
Under the attack of ciphertext only, the spatial aggregation that the assailant can't get access to pseudo random sequence distributes, and therefore can only carry out exhaustive deciphering.The macro block sum of QCIF image is 99, and the macro block sum of CIF image is 396, and 99 factorial is with regard to about 10 156Inferior, so only ciphertext only attack is invalid to the cryptographic algorithm of this paper.Wherein, only ciphertext only attack (ciphertext-only attack) is meant: cryptanalysis person has some message ciphertexts, and these message all use same cryptographic algorithm to encrypt.Cryptanalysis person's task is to recover plaintext as much as possible, and the key that perhaps preferably can extrapolate encrypting messages comes, so that can adopt identical key to calculate other encrypted message.
Under the attack of known-plaintext, the spatial aggregation that the assailant only can get access to pseudo random sequence distributes.But the arrangement of elements order that the spatial aggregation by the pseudo random sequence obtained distributes and infers pseudo random sequence obviously be invalid, so known plain text attack is invalid to the cryptographic algorithm of this paper.
Step 107, structure bit stream data obtain encrypted result.
Step 106 rearranges based on the element of twice replaced matrix to the macro block information table, generate new macro block information table, step 107 moves according to the position of carrying out macro block data of new macro block information table then, rebuilds bit stream data, the AVS code stream after promptly obtaining encrypting.
The core idea of embodiment shown in Figure 1 is: generate elementary scramble matrix by pseudo random sequence earlier, result with elementary scramble matrix is divided into a plurality of zones then, macro block in the zone according to its coded message minor sort again, is carried out the space scramble according to the different magic square matrix of each each self-generating of the zone macro block group after according to the macroblock coding information sorting.Embodiment shown in Figure 1 introduces the arrangement of macroblock coding information, and the structure of the permutation matrix of make encrypting not only depends on random sequence, and with the coded message of code stream to be encrypted also produce related, thereby improved the fail safe of encrypting.In addition, because the coded message in the zone of the same textural characteristics of image is approaching, therefore, if the approaching macro block that spatially coded message sorted spreads, mean that then the macro block that will belong to same texture region in the image spreads, thereby improve the subjective effect of encrypting.
Embodiment shown in Figure 1 arrives this, has just finished the ciphering process at one-frame video data, if there is next frame, then continues to encrypt at the next frame video data, can finish the encryption of all video datas.
Preferably, can generate in real time a first scramble matrix according to random number at each frame video data, determine the area dividing mode in real time, generation in real time is at each regional magic square matrix or scramble matrix at random.Certainly, under another kind of performance, can adopt asynchronous mode, for example, generate the matrix of scramble at random and the magic square matrix of a sequence in advance, select application to get final product at each frame video data, do not need real-time computational process, can further improve live effect.
In fact, carry out in the exemplary steps of video-encryption in the present invention, do not need to limit the concrete mode of first scramble matrix, the concrete mode that does not yet need the localized area to divide does not need localized area scramble rule is how to determine and concrete regular fashion yet; Certainly, in order to reach higher degree of safety, need certain requirement be arranged to elementary encryption and the fail safe of the algorithm of encryption for the second time.
Among the embodiment in front, preferably, the scramble matrix that is based on pseudo random sequence that first scramble matrix adopts is at the area dividing result, the regional scramble rule that adopt in part zone is the magic square matrix, and the employing of another part zone is the mode that keeps the result of first macro block scramble.Certainly, if the magic square matrix all can be used just in the zone after dividing, then also can all adopt the magic square matrix as regional scramble rule at the All Ranges after dividing.For example, the length of side of going out for division is greater than 3 square area, adopts magic square matrix and macroblock coding information sorting result in the zone to carry out the scramble second time; For other zones, keep the result of its elementary permutation matrix.
In another preferred embodiment of the present invention, first scramble matrix can adopt scramble matrix or the higher algorithm of other fail safes based on pseudo random sequence, at the area dividing result, part zone adopts the magic square matrix as regional scramble rule, it is the superencipher rule, and another part is unsuitable for using the zone of magic square matrix, then adopts the matrix of scramble at random based on pseudo random sequence as regional scramble rule, because the scramble matrix does not have special requirement for the shape in zone at random.
In another preferred embodiment of the present invention, first scramble matrix can adopt the scramble matrix based on pseudo random sequence, and at the area dividing result, All Ranges all is used in the matrix of scramble at random of pseudo random sequence as regional scramble rule.
In sum, for superencipher algorithm and the distribution mode that adopt in each zone, its implementation is very many, and the present invention does not need to be limited, and only is that some are given an example above.
With reference to Fig. 4, show the device embodiment that a kind of video data is encrypted, comprising:
Extraction module 401 is used to extract the macro block information of video data; Preferably, described video data is Chinese digital audio/video encoding and decoding standard AVS;
Elementary scramble matrix generation module 402 is used to generate elementary scramble matrix;
First scramble module 403 is used for according to elementary scramble matrix described macro block information being carried out scramble;
Area dividing and regulation determination module 404 are used for the scramble result of elementary scramble matrix is divided into a plurality of zones, and determine corresponding regional scramble rule at each zone;
Secondary scramble matrix generation module 405 is used for obtaining the secondary scramble matrix at entire video data according to the ranking results and the corresponding regional scramble rule of the macro block in each zone by its coded message;
Secondary scramble module 406 is used for according to described secondary scramble matrix, and the scramble result of elementary scramble matrix is carried out scramble once more;
Output module 407 as a result, are used to make up bit stream data, obtain encrypted result.
In one embodiment of this invention, described elementary scramble matrix is: based on the matrix of scramble at random of pseudo random sequence; Then the regional scramble rule after the area dividing can be in following three kinds of modes any: the subregion adopts the magic square matrix as regional scramble rule, and another part zone adopts the result who keeps first macro block scramble as regional scramble rule; Perhaps, the subregion adopts the magic square matrix as regional scramble rule, and another part zone adopts the matrix of scramble at random based on pseudo random sequence as regional scramble rule; Perhaps, All Ranges all is used in the matrix of scramble at random of pseudo random sequence as regional scramble rule.
In one embodiment of this invention, described elementary scramble matrix is: the permutation matrix of cruising based on the knight; Then the regional scramble rule after the area dividing can be in following three kinds of modes any: the subregion adopts the magic square matrix as regional scramble rule, and another part zone adopts the result who keeps first macro block scramble as regional scramble rule; Perhaps, the subregion adopts the magic square matrix as regional scramble rule, and another part zone adopts the matrix of scramble at random based on pseudo random sequence as regional scramble rule; Perhaps, All Ranges all is used in the matrix of scramble at random of pseudo random sequence as regional scramble rule.
For aforesaid each method embodiment, for simple description, so it all is expressed as a series of combination of actions, but those skilled in the art should know, the present invention is not subjected to the restriction of described sequence of movement, because according to the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in the specification all belongs to preferred embodiment, and related action and module might not be that the present invention is necessary.
Each embodiment in this specification all adopts the mode of going forward one by one to describe, and what each embodiment stressed all is and the difference of other embodiment that identical similar part is mutually referring to getting final product between each embodiment.For device embodiment because it is similar substantially to method embodiment, and based on method step one to one the form of virtual module be described, so describe fairly simple, relevant part gets final product referring to the part explanation of method embodiment.
More than to the encryption method and the device of a kind of video data provided by the present invention, be described in detail, used specific case herein principle of the present invention and execution mode are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (10)

1. a video data method of encrypting is characterized in that, comprising:
Extract whole macro block informations of one-frame video data;
Generate elementary scramble matrix;
According to elementary scramble matrix macro block information is carried out scramble;
The scramble result of elementary scramble matrix is divided into a plurality of zones, and determines corresponding regional scramble rule at each zone; Each described zone consists of a plurality of macro blocks;
According to ranking results and the corresponding regional scramble rule of the macro block in each zone, obtain secondary scramble matrix at entire video data by the code length in its coded message;
According to described secondary scramble matrix, the scramble result of elementary scramble matrix is carried out scramble once more;
Make up bit stream data, obtain encrypted result.
2. the method for claim 1 is characterized in that, described elementary scramble matrix is: based on the matrix of scramble at random of pseudo random sequence; Then after the area dividing,
The subregion adopts the magic square matrix as regional scramble rule, and another part zone adopts the result who keeps first macro block scramble as regional scramble rule;
Perhaps, the subregion adopts the magic square matrix as regional scramble rule, and another part zone adopts the matrix of scramble at random based on pseudo random sequence as regional scramble rule;
Perhaps, All Ranges all adopts the matrix of scramble at random based on pseudo random sequence as regional scramble rule.
3. the method for claim 1 is characterized in that, described elementary scramble matrix is: the permutation matrix of cruising based on the knight; Then after the area dividing,
The subregion adopts the magic square matrix as regional scramble rule, and another part zone adopts the result who keeps first macro block scramble as regional scramble rule;
Perhaps, the subregion adopts the magic square matrix as regional scramble rule, and another part zone adopts the matrix of scramble at random based on pseudo random sequence as regional scramble rule;
Perhaps, All Ranges all adopts the matrix of scramble at random based on pseudo random sequence as regional scramble rule.
4. as claim 2 or 3 described methods, it is characterized in that, adopt the Advanced Encryption Standard aes algorithm to generate stream cipher, as pseudo random sequence.
5. the method for claim 1 is characterized in that, described video data is the video data that meets Chinese digital audio/video encoding and decoding standard.
6. the device that video data is encrypted is characterized in that, comprising:
Extraction module is used to extract whole macro block informations of one-frame video data;
Elementary scramble matrix generation module is used to generate elementary scramble matrix;
First scramble module is used for according to elementary scramble matrix described macro block information being carried out scramble;
Area dividing and regulation determination module are used for the scramble result of elementary scramble matrix is divided into a plurality of zones, and determine corresponding regional scramble rule at each zone; Each described zone consists of a plurality of macro blocks;
Secondary scramble matrix generation module is used for obtaining the secondary scramble matrix at entire video data according to the ranking results and the corresponding regional scramble rule of the macro block in each zone by the code length of its coded message;
Secondary scramble module is used for according to described secondary scramble matrix, and the scramble result of elementary scramble matrix is carried out scramble once more;
Output module is used to make up bit stream data as a result, obtains encrypted result.
7. device as claimed in claim 6 is characterized in that, described elementary scramble matrix is: based on the matrix of scramble at random of pseudo random sequence; Then after the area dividing,
The subregion adopts the magic square matrix as regional scramble rule, and another part zone adopts the result who keeps first macro block scramble as regional scramble rule;
Perhaps, the subregion adopts the magic square matrix as regional scramble rule, and another part zone adopts the matrix of scramble at random based on pseudo random sequence as regional scramble rule;
Perhaps, All Ranges all adopts the matrix of scramble at random based on pseudo random sequence as regional scramble rule.
8. device as claimed in claim 6 is characterized in that, described elementary scramble matrix is: the permutation matrix of cruising based on the knight; Then after the area dividing,
The subregion adopts the magic square matrix as regional scramble rule, and another part zone adopts the result who keeps first macro block scramble as regional scramble rule;
Perhaps, the subregion adopts the magic square matrix as regional scramble rule, and another part zone adopts the matrix of scramble at random based on pseudo random sequence as regional scramble rule;
Perhaps, All Ranges all adopts the matrix of scramble at random based on pseudo random sequence as regional scramble rule.
9. as claim 7 or 8 described devices, it is characterized in that, adopt the Advanced Encryption Standard aes algorithm to generate stream cipher, as pseudo random sequence.
10. device as claimed in claim 6 is characterized in that, described video data is the video data that meets Chinese digital audio/video encoding and decoding standard.
CN2007101457442A 2007-08-31 2007-08-31 Method and apparatus for encrypting video data Expired - Fee Related CN101110944B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2007101457442A CN101110944B (en) 2007-08-31 2007-08-31 Method and apparatus for encrypting video data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2007101457442A CN101110944B (en) 2007-08-31 2007-08-31 Method and apparatus for encrypting video data

Publications (2)

Publication Number Publication Date
CN101110944A CN101110944A (en) 2008-01-23
CN101110944B true CN101110944B (en) 2010-06-09

Family

ID=39042806

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2007101457442A Expired - Fee Related CN101110944B (en) 2007-08-31 2007-08-31 Method and apparatus for encrypting video data

Country Status (1)

Country Link
CN (1) CN101110944B (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101800878B (en) * 2010-01-04 2011-11-23 重庆大学 System and method for encrypting and decrypting MPEG (Moving Picture Experts Group) video based on position files
CN102123026A (en) * 2011-04-12 2011-07-13 南开大学 Chaos and hyperchaos based two-level video streaming media encryption method
US9258112B2 (en) * 2013-03-15 2016-02-09 Accenture Global Services Limited Configurable key-based data shuffling and encryption
CN103442233B (en) * 2013-08-28 2014-09-03 李秋华 Low-bit-rate H.264 video encryption compression transmission method based on ranking permutation
CN104954118B (en) * 2015-05-16 2017-09-15 北京科技大学 A kind of mimicry encryption method and system encoded based on vector network with DES
CN105281894B (en) * 2015-11-25 2018-10-23 深圳供电局有限公司 A kind of plaintext encryption method and system based on seven rank magic cubes
CN108134663A (en) * 2016-12-01 2018-06-08 钦州市晶通科技有限公司 A kind of video conference time slot scrambling based on chaos encryption algorithm
CN108235022A (en) * 2018-01-29 2018-06-29 苏州南尔材料科技有限公司 A kind of computer video data processing method
CN110601817B (en) * 2019-09-19 2022-10-21 中国银行股份有限公司 Data processing method and device
CN110677694B (en) * 2019-10-15 2021-10-26 华南理工大学 Video encryption method for resisting contour attack
CN110809192B (en) * 2019-10-15 2021-07-20 华南理工大学 Video encryption method capable of carrying secret information
CN112367157B (en) * 2020-10-31 2023-05-12 深圳供电局有限公司 Internet of things environment encryption method and device
CN112818367B (en) * 2021-02-03 2024-03-26 中国邮政储蓄银行股份有限公司 File encryption method, device, storage medium and processor
CN114390429B (en) * 2021-11-09 2022-12-30 泰瑞数创科技(北京)股份有限公司 Positioning map data encryption sending method and system based on multi-parameter dynamic adjustment encryption matrix of user request
CN113783900B (en) * 2021-11-15 2022-01-11 四川格锐乾图科技有限公司 Encryption and multi-stage calibration method for stream media of unmanned aerial vehicle
CN114598538A (en) * 2022-03-16 2022-06-07 数字山西设计股份有限公司 Data transmission system for digital video optical transmitter and receiver
CN114866811B (en) * 2022-03-31 2023-04-28 广州科拓科技有限公司 Video encryption method and device and video decryption method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5555305A (en) * 1991-09-30 1996-09-10 British Broadcasting Corporation Method and apparatus for secure transmission of video signals
CN1617584A (en) * 2004-12-06 2005-05-18 武汉大学 Dynamic random mess correction and enciphering-deenciphering method for video frequency information

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5555305A (en) * 1991-09-30 1996-09-10 British Broadcasting Corporation Method and apparatus for secure transmission of video signals
CN1617584A (en) * 2004-12-06 2005-05-18 武汉大学 Dynamic random mess correction and enciphering-deenciphering method for video frequency information

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
杨杰,虞涛.混沌加密理论在视频图像加密中的应用.武汉理工大学学报·信息与管理工程版27 4.2005,27(4),6-9.
杨杰,虞涛.混沌加密理论在视频图像加密中的应用.武汉理工大学学报·信息与管理工程版27 4.2005,27(4),6-9. *

Also Published As

Publication number Publication date
CN101110944A (en) 2008-01-23

Similar Documents

Publication Publication Date Title
CN101110944B (en) Method and apparatus for encrypting video data
Lian Multimedia content encryption: techniques and applications
Li et al. On the design of perceptual MPEG-video encryption algorithms
Deshmukh et al. Modified AES based algorithm for MPEG video encryption
Su et al. Multimedia security: a survey of chaos-based encryption technology
Wang et al. Hash key-based video encryption scheme for H. 264/AVC
CN103856786A (en) Streaming media video encryption method and device based on H.264
CN102843558A (en) H.264/AVC (Advanced Video Coding) compressed domain video encryption/decryption device and encryption/decryption method thereof
CN104093029A (en) Video encryption algorithm based on new spatiotemporal chaos system
Lui et al. Chaos-based selective encryption for H. 264/AVC
CN103607272A (en) Video encryption method
Raju et al. Fast and secure real-time video encryption
Chadha et al. Dual-layer video encryption using RSA algorithm
CN101409830B (en) Method and apparatus for judging DCT coefficient block similarity, and encrypting and deciphering image
Song et al. Efficient protection using chaos for context-adaptive binary arithmetic coding in H. 264/advanced video coding
Batham et al. ICSECV: An efficient approach of video encryption
Hong et al. The study of selective encryption of motion vector based on the S-Box for the security improvement in the process of video
CN110071795A (en) Selective cryptographic method based on H.264/AVC video encoding behavior
Su et al. Chaos-based video encryption algorithms
Jiang et al. An intra prediction mode-based video encryption algorithm in H. 264
Asghar et al. MIKEY for keys management of H. 264 scalable video coded layers
CN201663660U (en) Data encryption and data decryption system of digital video
CN104301727A (en) H.264 video perception encryption algorithm with controllable quality on basis of CABAC
Ma et al. Bitstream-oriented protection for the h. 264/scalable video coding (svc)
Jun et al. A two-way selective encryption algorithm for MPEG video

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20100609

Termination date: 20130831