CN100496118C - A Encryption and Decryption Method of Residual Coefficient Amplitude in H.264 Standard Video Information - Google Patents

A Encryption and Decryption Method of Residual Coefficient Amplitude in H.264 Standard Video Information Download PDF

Info

Publication number
CN100496118C
CN100496118C CN 200610166521 CN200610166521A CN100496118C CN 100496118 C CN100496118 C CN 100496118C CN 200610166521 CN200610166521 CN 200610166521 CN 200610166521 A CN200610166521 A CN 200610166521A CN 100496118 C CN100496118 C CN 100496118C
Authority
CN
China
Prior art keywords
video
encryption
encrypted
video information
residual coefficient
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
CN 200610166521
Other languages
Chinese (zh)
Other versions
CN101064822A (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.)
Wuhan University WHU
Original Assignee
Wuhan University WHU
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 Wuhan University WHU filed Critical Wuhan University WHU
Priority to CN 200610166521 priority Critical patent/CN100496118C/en
Publication of CN101064822A publication Critical patent/CN101064822A/en
Application granted granted Critical
Publication of CN100496118C publication Critical patent/CN100496118C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention relates to a kind of encryption and deciphering method of remained difference coefficient breadth in H. 264 standard video information, it characterized in that: based on self adapting updating rule of remained difference coefficient breadth coding middle variable suffiXLength, adopting difference value absolute value which calculates current remained difference coefficient breadth and suffixLength self adapting updating threshold value, then based on the difference value absolute value, deciding bit number of last bit of the remained difference coefficient breadth which is to be encrypted, video code flow encrypted fulfill the H. 264 standard format. The characteristics of the invention are following: independent on video coder and decoder, video code flow encrypted fulfill the H. 264 standard; complexity of calculation is low, can fulfill the real time requirement of video information process and transmission; not affect the compression ratio; not affect video communication and network fault tolerant of video transmission; secrecy class can be realized; independent on concrete cryptogram arithmetic, it can use different international normal cryptogram arithmetic, the secrecy can achieve level that current technique can not decrypt.

Description

一种H.264标准视频信息中残差系数幅值的加解密方法 A Encryption and Decryption Method of Residual Coefficient Amplitude in H.264 Standard Video Information

技术领域 technical field

本发明属于视频保密通讯领域,具体地讲是一种H.264标准视频信息中残差系数幅值的加解密方法。The invention belongs to the field of video security communication, and specifically relates to an encryption and decryption method for residual coefficient amplitude in H.264 standard video information.

背景技术 Background technique

随着各种视频应用的日益广泛,视频信息的安全问题也日益突出。信源加密即进行视频内容本身的加密是解决视频信息安全性的主要的而且更重要的手段。对视频内容本身的加密可以保证非法用户即使得到了视频信息,由于没有密钥无法正确解密观看原始的正确视频图像。With the wide application of various video, the security problem of video information is also becoming more and more prominent. Source encryption, that is, the encryption of the video content itself, is the main and more important means to solve the security of video information. The encryption of the video content itself can ensure that even if the illegal user obtains the video information, he cannot correctly decrypt and watch the original correct video image without the key.

由于视频信息具有海量数据,在具体应用中,例如在可视电话或视频会议应用中,每秒必须传输几十幅图像,如果采用针对一般信息(二进制或文本)的普适性加密算法对全部视频信息进行加密,其计算量巨大,将产生较大的附加延时,很难满足视频通信的实时性要求。Because video information has massive data, in specific applications, such as in videophone or video conferencing applications, dozens of images must be transmitted per second. If a universal encryption algorithm for general information (binary or text) is used to encrypt all Encrypting video information requires a huge amount of calculation, which will generate a large additional delay, and it is difficult to meet the real-time requirements of video communication.

除保密性和实时性外,保持格式的兼容性是视频加密算法的重要需求。格式兼容的含义是视频密文信息的句法语义仍然与标准兼容,其核心表现是视频密文信息仍然可以被标准解码器顺利解码。保持格式兼容的重要性主要在于以下几点:In addition to confidentiality and real-time performance, maintaining format compatibility is an important requirement for video encryption algorithms. The meaning of format compatibility is that the syntax and semantics of video ciphertext information is still compatible with the standard, and its core performance is that video ciphertext information can still be successfully decoded by standard decoders. The importance of maintaining format compatibility lies primarily in the following points:

1)保持视频格式与标准兼容可以保证原始视频明文中的网络同步和容错字段等信道信息不被改变,从而保证密文码流的网络适应性和容错性。1) Keeping the video format compatible with the standard can ensure that channel information such as network synchronization and error tolerance fields in the original video plaintext will not be changed, thereby ensuring the network adaptability and error tolerance of the ciphertext code stream.

2)保持视频句法语义等格式信息与标准兼容也就保持了视频码流中各种起始码字格式信息等固定字段不变,这些字段由于是在协议或标准中公开而广为人知的,如果对这些字段进行加密,那么也就会造成已知明文攻击,不利于视频信息的安全。2) Keeping format information such as video syntax and semantics compatible with standards also keeps fixed fields such as various initial codeword format information in the video stream unchanged. These fields are widely known because they are disclosed in protocols or standards. If these fields are encrypted, known plaintext attacks will be caused, which is not conducive to the security of video information.

3)保持视频格式与标准兼容有利于对商业应用的视频信息内容的有效灵活的控制。在视频点播、付费电视等商业应用场合,为了吸引用户购买,往往是需要允许非授权用户能顺利解码播放视频密文码流观赏到一定视频内容的。3) Keeping the video format compatible with the standard is conducive to the effective and flexible control of the video information content for commercial applications. In commercial applications such as video-on-demand and pay TV, in order to attract users to purchase, it is often necessary to allow unauthorized users to successfully decode and play video ciphertext code streams to watch certain video content.

4)保持视频格式不变还有利于标准编码视频信息面向存储的正常应用,因为保持格式兼容能够保持除视频内容以外的所有信息或属性不变,使得视频信息仍然能够被检索,并有利于保持视频信息的快进、快退等交互功能。4) Keeping the video format unchanged is also conducive to the normal application of standard coded video information for storage, because keeping the format compatible can keep all information or attributes except the video content unchanged, so that the video information can still be retrieved and is conducive to maintaining Interactive functions such as fast forward and rewind of video information.

数字视频加密技术自九十年代中期产生以来,一直伴随着视频压缩编码标准的发展而不断发展。基于DCT变换和预测编码混合体系及哈夫曼变长编解码(H.261/H.263以及MPEG-1/MPEG-2/MPEG-4)的视频加密技术已产生很多研究成果。其中最主流的方法就是选择视频信息中包含视频图像内容的关键信息:残差系数、运动矢量和量化步长等进行选择性加密。随着硬件性能的飞速发展,H.264/AVC由于其良好的压缩效率、图像质量和网络容错性,必将取代以前的系列标准。然而,由于H.264/AVC采用了帧内预测、基于上下文的自适应变长编码(CAVLC)等很多完全不同于以往的编解码技术,以前视频加密研究成果大部分都不适用于H.264/AVC标准编码视频的加密。Since the digital video encryption technology appeared in the mid-1990s, it has been constantly developing along with the development of video compression coding standards. The video encryption technology based on DCT transformation and predictive coding hybrid system and Huffman variable length codec (H.261/H.263 and MPEG-1/MPEG-2/MPEG-4) has produced many research results. The most mainstream method is to select the key information of the video image content in the video information: residual coefficient, motion vector and quantization step size, etc. for selective encryption. With the rapid development of hardware performance, H.264/AVC will replace the previous series of standards due to its good compression efficiency, image quality and network fault tolerance. However, since H.264/AVC uses intra-frame prediction, context-based adaptive variable length coding (CAVLC) and many other codec technologies that are completely different from the past, most of the previous video encryption research results are not applicable to H.264 Encryption of /AVC standard encoded video.

对于H.264码流中新出现的帧内预测模式字和I_PCM模式宏块,以及改用了Exp-Golomb熵编码的运动矢量仍然可以借鉴现有的保持格式兼容的视频加密成果的一些基本思想,比如对其进行选择性加密。但是,H.264中的残差系数采用基于上下文的编码策略(CAVLC),其编码后的残差系数幅值码字上下文前后紧密关联,直接对其加密或选择固定部分比特加密必将影响上下文其他残差系数幅值的顺利解码,从而势必破坏其格式兼容性。而当前的保持格式兼容的视频加密研究成果通常是以Huffman熵编码为基础的,不适合于H.264/AVC,因此如何加密H.264码流中的残差系数幅值同时保持格式兼容是一个难点。For the new intra-frame prediction mode words and I_PCM mode macroblocks in the H.264 code stream, and the motion vectors that have been converted to Exp-Golomb entropy coding, some basic ideas of existing video encryption achievements that maintain format compatibility can still be used for reference. , such as selectively encrypting it. However, the residual coefficient in H.264 adopts the context-based coding strategy (CAVLC), and the encoded residual coefficient amplitude codeword context is closely related, directly encrypting it or selecting a fixed part of bit encryption will definitely affect the context The smooth decoding of other residual coefficient magnitudes will inevitably destroy its format compatibility. However, the current video encryption research results that maintain format compatibility are usually based on Huffman entropy coding, which is not suitable for H.264/AVC. Therefore, how to encrypt the residual coefficient amplitude in the H.264 bit stream while maintaining format compatibility is a problem. a difficulty.

对于H.264标准,亮度和色度块残差数据使用CAVLC编解码时,残差系数由拖尾系数码字、非零系数幅值前缀level_prefix和后缀level_suffix码字组成。拖尾系数指示残差块的最后几个拖尾±1系数的符号,拖尾系数的个数由每个残差块的起始码字coeff_token指示,因此对拖尾系数可以根据其个数直接对其加密。即当解码分析coeff_token拖尾系数个数为k时,则可对紧随其后的k比特进行直接加密。非零系数的幅值level编解码比较复杂。level_prefix码字根据协议中规定的变长码表编解码,对其码字直接加密势必将破坏码流兼容性。suffixLength和levelCode是编码时需要使用的变量。后缀level_suffix是长度为levelSuffixSize比特的无符号整数,通常情况下,levelSuffixSize的值等于变量suffixLength的值,但有两种情况例外:1、当前缀等于14且suffixLength等于0时,levelSuffixSize等于4;2、当前缀等于15时,levelSuffixSize等于12。For the H.264 standard, when the luma and chrominance block residual data is coded using CAVLC, the residual coefficients are composed of trailing coefficient codewords, non-zero coefficient amplitude prefix level_prefix and suffix level_suffix codewords. The trailing coefficients indicate the signs of the last few trailing ±1 coefficients of the residual block, and the number of trailing coefficients is indicated by the initial code word coeff_token of each residual block, so the trailing coefficients can be directly calculated according to their number Encrypt it. That is, when the number of tailing coefficients of coeff_token is k in decoding analysis, the following k bits can be directly encrypted. The amplitude level encoding and decoding of non-zero coefficients is more complicated. The level_prefix code word is coded and decoded according to the variable-length code table specified in the protocol, and direct encryption of the code word will inevitably destroy the code stream compatibility. suffixLength and levelCode are variables that need to be used when encoding. The suffix level_suffix is an unsigned integer whose length is levelSuffixSize bits. Normally, the value of levelSuffixSize is equal to the value of variable suffixLength, but there are two exceptions: 1. When the prefix is equal to 14 and suffixLength is equal to 0, levelSuffixSize is equal to 4; 2. When prefix is equal to 15, levelSuffixSize is equal to 12.

变量suffixLength是基于上下文自适应更新的,suffixLength的更新与当前的suffixLength的值以及已经解码好的非零系数的值(level)有关。suffixLength在初始化后,自适应更新规则为:如果当前已解码的非零系数值大于(3<<(suffixLength-1)),并且当前suffixLength小于6时,suffixLength加1。(“<<”、“>>”分表示为二进制左移、右移运算符号)The variable suffixLength is adaptively updated based on context, and the update of suffixLength is related to the value of the current suffixLength and the value (level) of the decoded non-zero coefficient. After suffixLength is initialized, the adaptive update rule is: if the current decoded non-zero coefficient value is greater than (3<<(suffixLength-1)), and the current suffixLength is less than 6, suffixLength is added by 1. ("<<", ">>" points are expressed as binary left shift and right shift operation symbols)

变量levelCode等于(level_prefix<<suffixLength)+level_suffix。则level值由如下规则得出:如果levelCode为偶数,level的值为(levelCode+2)>>1;否则,level的值为(-level-1)>>1。因此对levelCode微小的改变都会引起level值符号的改变。那么对level_suffix作微小的改变就可能引起level值较大的变化,从而可以考虑加密level_suffix从而达到加密残差系数的目的。The variable levelCode is equal to (level_prefix<<suffixLength)+level_suffix. Then the level value is obtained according to the following rules: if the levelCode is an even number, the value of level is (levelCode+2)>>1; otherwise, the value of level is (-level-1)>>1. Therefore, a small change to the levelCode will cause a change in the sign of the level value. Then a small change to the level_suffix may cause a large change in the level value, so that the encryption of the level_suffix can be considered to achieve the purpose of encrypting the residual coefficient.

但是,不能直接对整个level_suffix进行加密,因为level_suffix的改变会引起suffixLength的自适应更新的改变,造成在解码下一个残差系数幅值码字时对该码字level_suffix长度判断的错误,也就是破坏了码流语义格式,势必造成解码失败。所以,对level_suffix的加密需要考虑不能影响suffixLength的自适应更新过程。However, the entire level_suffix cannot be directly encrypted, because the change of level_suffix will cause the change of the adaptive update of suffixLength, resulting in an error in judging the length of the codeword level_suffix when decoding the next residual coefficient amplitude codeword, that is, destroying If the semantic format of the code stream is changed, it will inevitably cause decoding failure. Therefore, the encryption of level_suffix needs to consider the adaptive update process that cannot affect suffixLength.

发明内容 Contents of the invention

本发明的目的就是针对直接加密整个H.264码流中残差系数幅值或加密其固定部分比特势必会破坏格式兼容的问题,通过仔细分析H.264码流中基于CAVLC熵编码的残差系数的编解码过程和上下文关联特点,而提出一种相应的H.264标准视频信息中残差系数幅值的一种加解密方法,并使得加密同时保持格式兼容,以克服上述的不足。The purpose of the present invention is to directly encrypt the residual coefficient amplitude in the entire H.264 code stream or encrypt its fixed part of the bit will inevitably destroy the problem of format compatibility, by carefully analyzing the residual in the H.264 code stream based on CAVLC entropy Based on the encoding and decoding process and context-related characteristics of coefficients, an encryption and decryption method for the magnitude of residual coefficients in the corresponding H.264 standard video information is proposed, and the encryption is maintained while maintaining format compatibility, so as to overcome the above shortcomings.

本发明为了使加密残差系数幅值不破坏语义格式,动态分析H.264每一编码片的码流,根据残差系数幅值编码时suffixLength的自适应更新规则,采用自适应加密方法,其具体自适应规则如下:In order to ensure that the encrypted residual coefficient amplitude does not destroy the semantic format, the present invention dynamically analyzes the code stream of each coded slice of H.264, and adopts an adaptive encryption method according to the adaptive update rule of suffixLength when encoding the residual coefficient amplitude. The specific adaptive rules are as follows:

(1)当前缀等于14且suffixLength等于0时,对4bit的level_suffix直接加密。(1) When the prefix is equal to 14 and the suffixLength is equal to 0, the 4-bit level_suffix is directly encrypted.

(2)当前缀等于15时,对12bit的level_suffix直接加密。(2) When the prefix is equal to 15, directly encrypt the 12-bit level_suffix.

(3)当suffixLength大于或等于6时,suffixLength不再更新,对level_suffix直接加密。(3) When suffixLength is greater than or equal to 6, suffixLength is no longer updated, and level_suffix is directly encrypted.

(4)当上述三种特殊条件都不满足时,(假设suffixLength自适应更新阈值3<<(suffixLength

Figure C200610166521D0006135152QIETU
用hread来表示,当前level值和thread差值的绝对值Abs(level-thread)用abs_diff表示),当abs_diff大于(1<<k)时,可以加密suffixLength的后k个bit.这样可以保证加密不会造成影响level和阈值的关系,从而影响suffixLength自适应更新的判断,从而保证语义格式兼容。(4) When none of the above three special conditions are met, (assuming suffixLength adaptive update threshold 3<<(suffixLength
Figure C200610166521D0006135152QIETU
Expressed by hread, the absolute value of the difference between the current level value and thread Abs (level-thread) is represented by abs_diff), when abs_diff is greater than (1<<k), the last k bits of suffixLength can be encrypted. This can ensure encryption It will not affect the relationship between level and threshold, thereby affecting the judgment of suffixLength adaptive update, so as to ensure that the semantic format is compatible.

为了实现上述目的,本发明的方法是:先需要计算当前level值和thread的差值绝对值,然后根据该差值绝对值的大小,来决定加密几个比特。综合上述四种情况,本发明提出的残差系数幅值加密方法是一个需要进行动态分析而决定如何加密的自适应的过程。In order to achieve the above object, the method of the present invention is: first need to calculate the absolute value of the difference between the current level value and the thread, and then determine how many bits to encrypt according to the size of the absolute value of the difference. Based on the above four situations, the method for encrypting the magnitude of residual coefficients proposed by the present invention is an adaptive process that requires dynamic analysis to determine how to encrypt.

此外,本发明提出将加密残差系数幅值和加密运动矢量、帧内预测模式字、量化系数、残差系数拖尾系数部分和I_PCM宏块像素信息结合起来组成一个完整的方案来实现视频信息的保密性。In addition, the present invention proposes to combine the encrypted residual coefficient magnitude, encrypted motion vector, intra-frame prediction mode word, quantization coefficient, residual coefficient trailing coefficient part and I_PCM macroblock pixel information to form a complete scheme to realize video information confidentiality.

对4×4亮度块的3bit预测模式字、残差块系数的拖尾部分和I_PCM宏块的像素值使用密码学算法直接加密。Use cryptographic algorithms to directly encrypt the 3-bit prediction mode word of the 4×4 luma block, the trailing part of the coefficient of the residual block and the pixel value of the I_PCM macroblock.

对16x16亮度块和色度块帧内预测模式字加密其最后一个比特。The last bit of the 16x16 luma block and chroma block intra prediction mode word is encrypted.

对量化步长、运动矢量差分值加密其Exp-Golomb码字的后缀部分。而对残差系数幅值,则根据上文提出的自适应方法动态决定其可以加密的level_suffix部分的比特长度。The suffix part of the Exp-Golomb code word is encrypted for the quantization step size and the difference value of the motion vector. As for the magnitude of the residual coefficient, the bit length of the level_suffix part that can be encrypted is dynamically determined according to the adaptive method proposed above.

这种选择部分比特加密方法是为了保持视频码流在加密后仍然符合H.264标准格式。上述具体加密方法是通过深入分析H.264标准规定的句法语义和解码过程后确定的。因此根据H.264标准按照上述方法加密能够保证格式不变。The purpose of this partial bit encryption method is to keep the video code stream conforming to the H.264 standard format after encryption. The specific encryption method above is determined after in-depth analysis of the syntax, semantics and decoding process specified in the H.264 standard. Therefore, encryption according to the above method according to the H.264 standard can ensure that the format remains unchanged.

具体实现时,分析H.264视频码流,根据上述规则提取待加密的数据比特,可灵活选用各种高强度的密码学算法(如分组密码算法AES/IDEA或序列密码算法A5/RC4等)加密,然后将加密后的关键数据的密文还原至提取位置和那些未被加密的明文混合作为加密后的视频码流输出,解密则是相反的过程。When implementing it, analyze the H.264 video code stream, extract the data bits to be encrypted according to the above rules, and flexibly select various high-strength cryptographic algorithms (such as block cipher algorithm AES/IDEA or sequence cipher algorithm A5/RC4, etc.) Encrypt, and then restore the ciphertext of the encrypted key data to the extraction location and mix the unencrypted plaintext as the encrypted video stream output, and decryption is the opposite process.

由于本发明基于残差系数幅值编码时suffixLength的自适应更新规则,采用了相应的自适应加密方法,使得本发明具有以下优点:1、符合H.264标准的视频信息加密后得到仍然符合标准格式的视频码流,保证视频正常应用;2、加解密的数据量小,计算复杂度低,能保证视频信息的实时传输;3、残差系数包含了大量视频图像内容信息,对其加密(与加密其他信息相结合)能够显著提高视频信息保密性;4、能够为给用户提供对不同密码算法的多样选择,密码算法方便更新升级。Because the present invention is based on the self-adaptive update rule of suffixLength when residual coefficient magnitude is encoded, has adopted corresponding self-adaptive encryption method, makes the present invention have the following advantages: 1, the video information that conforms to the H.264 standard is obtained after being encrypted and still conforms to the standard 2. The amount of encrypted and decrypted data is small, and the calculation complexity is low, which can ensure the real-time transmission of video information; 3. The residual coefficient contains a large amount of video image content information, which is encrypted ( (combined with encrypting other information) can significantly improve the confidentiality of video information; 4. It can provide users with a variety of choices for different cryptographic algorithms, and the cryptographic algorithms are easy to update and upgrade.

附图说明 Description of drawings

图1为本发明的加密残差系数幅值方法原理图。Fig. 1 is a schematic diagram of the encryption residual coefficient amplitude method of the present invention.

图2为本发明的原理框图。Fig. 2 is a functional block diagram of the present invention.

图3为本发明在正常状态的应用总体流程图。Fig. 3 is an overall flow chart of the application of the present invention in a normal state.

图4为本发明在非正常状态的应用总体流程图。Fig. 4 is an overall flowchart of the application of the present invention in an abnormal state.

图5为本发明加密实现方法流程图。Fig. 5 is a flow chart of the encryption implementation method of the present invention.

图6为本发明解密实现方法流程图。Fig. 6 is a flow chart of the decryption implementation method of the present invention.

具体实施方式 Detailed ways

下面结合附图和实施例对本发明作进一步的为描述,但以下实施例不应理解为对本发明的限制。The present invention will be further described below in conjunction with the accompanying drawings and examples, but the following examples should not be construed as limiting the present invention.

本方法的应用流程如图3。The application process of this method is shown in Figure 3.

图1中的视频加密模块即是本方法的实现部分。经过压缩后的原始视频码流经过视频加密模块得到仍然符合标准的视频码流,经过加密后的码流经过解密模块恢复成原始的视频码流,然后经过解码器就可以得到正确的视频图像。但是,如果经过加密后的码流没有通过解密模块或者没有获得正确的解密密钥,经过解码器则得到被破坏的视频图像(图4)。The video encryption module in Fig. 1 is the realization part of this method. The compressed original video code stream passes through the video encryption module to obtain a standard video code stream, and the encrypted code stream is restored to the original video code stream through the decryption module, and then the correct video image can be obtained through the decoder. However, if the code stream after encryption does not pass through the decryption module or does not obtain the correct decryption key, a damaged video image will be obtained after passing through the decoder (Figure 4).

本发明加密流程如图5。本方法的视频加密模块主要由三部分组成:码流分析模块密码算法加密模块和码流混合模块。码流分析模块的主要功能是读取分析压缩后的原始视频码流,将其中的所定义的关键数据提取出来组合在一起,同时记录每个关键数据在码流中的位置和长度信息(以bit为单位)。密码算法加密模块的主要功能是使用现有的公认高强度的密码算法对提取的关键数据进行加密。码流混合模块的主要功能是将加密得到的密文根据每个关键数据的位置和长度信息的记录重新返回到原始码流中去替代加密前码流中提取的关键数据,即与其他非关键数据混合得到加密后的密文码流。The encryption process of the present invention is shown in Fig. 5 . The video encryption module of the method is mainly composed of three parts: a code stream analysis module, a cryptographic algorithm encryption module and a code stream mixing module. The main function of the code stream analysis module is to read and analyze the compressed original video code stream, extract the defined key data and combine them together, and record the position and length information of each key data in the code stream (indicated by bit is the unit). Cryptographic Algorithm The main function of the encryption module is to encrypt the extracted key data using the existing recognized high-strength cryptographic algorithm. The main function of the code stream mixing module is to return the encrypted ciphertext to the original code stream according to the position and length information records of each key data to replace the key data extracted from the code stream before encryption, that is, with other non-key data The data is mixed to obtain the encrypted ciphertext code stream.

本发明解密流程如图6。本方法的视频解密模块内部结构主要由三部分组成:码流分析模块,密码算法解密模块和码流混合模块。码流分析模块的主要功能是读取分析经过加密后的视频码流,将其中的经加密后的关键数据的密文提取出来组合在一起,同时记录每个关键数据的密文在码流中的位置和长度信息(以bit为单位)。密码算法解密模块的主要功能是使用和加密时一致的密码算法将提取的关键数据的密文进行解密。码流混合模块的主要功能是将解密后复原的关键数据明文根据每个关键数据密文的位置和长度信息的记录重新返回到码流中去替代解密前提取的密文数据,即与其他非密文数据混合得到解密后的明文码流。The decryption process of the present invention is shown in Fig. 6 . The internal structure of the video decryption module of the method is mainly composed of three parts: a code stream analysis module, a cryptographic algorithm decryption module and a code stream mixing module. The main function of the code stream analysis module is to read and analyze the encrypted video code stream, extract the ciphertext of the encrypted key data and combine them together, and record the ciphertext of each key data in the code stream The position and length information (in bits). The main function of the cryptographic algorithm decryption module is to decrypt the ciphertext of the extracted key data using the same cryptographic algorithm as that used for encryption. The main function of the code stream mixing module is to return the key data plaintext restored after decryption to the code stream according to the position and length information records of each key data ciphertext to replace the ciphertext data extracted before decryption, that is, to replace the ciphertext data extracted before decryption. The ciphertext data is mixed to obtain the decrypted plaintext code stream.

本发明密码算法可选用分组密码算法(3DES、AES、IDEA等)或者序列密码算法(A5、RC4、SEAL等),但不局限于上述算法,也可以根据用户的需要,选择用户指定的某种特殊算法。可以将密码算法设计成独立的软件或硬件接口,可在加密和解密模块中灵活选择和调换。The cipher algorithm of the present invention can choose block cipher algorithm (3DES, AES, IDEA etc.) or serial cipher algorithm (A5, RC4, SEAL etc.), but not limited to above-mentioned algorithm, also can select some kind of user-designated according to the needs of user. special algorithm. The cryptographic algorithm can be designed as an independent software or hardware interface, which can be flexibly selected and exchanged in the encryption and decryption modules.

本发明通过对H.264中关键信息的不同组合的加密得到不同保密性级别的加密方法以适应不同级别的应用需求。这些关键信息包括:残差系数幅值、运动矢量、帧内预测模式字、量化系数、残差系数拖尾系数部分和I_PCM宏块像素信息。The present invention obtains encryption methods of different confidentiality levels by encrypting different combinations of key information in H.264, so as to adapt to application requirements of different levels. These key information include: residual coefficient magnitude, motion vector, intra-frame prediction mode word, quantization coefficient, residual coefficient trailing coefficient part and I_PCM macroblock pixel information.

视频信息正常应用需要着重考虑以下五个方面。本发明提出的视频加解密方法由于致力于尽量满足实际需求不影响应用,所以在这五个方面的影响非常小甚至基本没有影响。The normal application of video information needs to focus on the following five aspects. The video encryption and decryption method proposed by the present invention is devoted to satisfying the actual needs as far as possible without affecting the application, so the impact on these five aspects is very small or even basically has no impact.

对视频交互性和可直接操作性的影响:本发明提出的加密方法由于不改变视频信息中的有关对象的标志信息和有关快进快退的标志信息等数据所以基本上不影响H.264交互性和可直接操作性(如视频转码);Impact on video interactivity and direct operability: the encryption method proposed by the present invention basically does not affect H.264 interaction because it does not change data such as flag information about objects and flag information about fast forward and rewind in the video information. and direct operability (e.g. video transcoding);

对视频编解码及视频质量的影响:本发明提出的加解密方法,其加解密过程独立于编解码过程,并且由于加解密只对最基本的视频信息进行操作,不会限制编解码的各种特性,因此也不会造成视频质量的损失;Impact on video encoding and decoding and video quality: The encryption and decryption method proposed by the present invention has an encryption and decryption process independent of the encoding and decoding process, and since encryption and decryption only operate on the most basic video information, it will not limit various encoding and decoding methods. characteristics, so there will be no loss of video quality;

对码流大小即带宽要求的影响:本发明提出的加密方法由于不使用增加明文大小的密码算法,不影响视频压缩比,因此经过加密基本不增加码流大小;The impact on the size of the code stream, that is, the bandwidth requirement: the encryption method proposed by the present invention does not affect the video compression ratio because it does not use a cryptographic algorithm that increases the size of the plaintext, so the size of the code stream does not increase substantially after encryption;

对视频传输延时的影响:本发明提出的加解密方法由于只对少量数据加密,加解密计算复杂度低,因此本加密方法对视频传输的附加延时很小,基本不影响实时性;Impact on video transmission delay: the encryption and decryption method proposed in the present invention only encrypts a small amount of data, and the encryption and decryption calculation complexity is low, so the additional delay of the encryption method for video transmission is very small, and basically does not affect real-time performance;

对网络容错性的影响:本发明提出的加解密方法由于以H.264编码片为单位,当网络出现丢包时,丢失一个或几个编码片不会影响后续编码片的正确解密,所以本加密方法对网络容错性影响很小。Impact on network fault tolerance: the encryption and decryption method proposed by the present invention takes H.264 coded slices as a unit, when packet loss occurs in the network, the loss of one or several coded slices will not affect the correct decryption of subsequent coded slices, so this The encryption method has little effect on the fault tolerance of the network.

本说明书中未作详细描述的内容属于本领域专业技术人员公知的现有技术。The content not described in detail in this specification belongs to the prior art known to those skilled in the art.

Claims (6)

1、一种H.264标准视频信息中残差系数幅值的加解密方法,其特征在于:根据残差系数幅值编码时中间变量suffixLength的自适应更新规则,采用先计算当前残差系数幅值和suffixLength自适应更新阈值的差值绝对值,然后根据该差值绝对值的大小,来决定待加密的该残差系数幅值的最后几个比特的比特数目,加密后残差系数幅值的变化不影响上下文的关联关系,使得加密后视频码流仍然符合H.264标准格式。1. An encryption and decryption method of residual coefficient magnitude in H.264 standard video information, characterized in that: according to the adaptive update rule of intermediate variable suffixLength when encoding residual coefficient magnitude, adopting to calculate current residual coefficient magnitude first value and suffixLength adaptive update threshold difference absolute value, and then according to the size of the absolute value of the difference, to determine the number of bits of the last few bits of the residual coefficient magnitude to be encrypted, the residual coefficient magnitude after encryption The change of does not affect the association relationship of the context, so that the encrypted video code stream still complies with the H.264 standard format. 2、如权利要求1所述的H.264标准视频信息中残差系数幅值的加解密方法,其特征在于:加密时,将加密残差系数幅值,与加密其他含有视频内容的信息结合起来组成一个完整的加密方案来保证H.264标准视频信息的保密性。2. The method for encrypting and decrypting the magnitude of the residual coefficient in the H.264 standard video information as claimed in claim 1, characterized in that: when encrypting, the magnitude of the encrypted residual coefficient is combined with encrypting other information containing video content Together they form a complete encryption scheme to ensure the confidentiality of H.264 standard video information. 3、如权利要求2所述的H.264标准视频信息中残差系数幅值的加解密方法,其特征在于:含有视频内容的信息包括运动矢量、帧内预测模式字、量化步长、残差系数拖尾系数部分和I_PCM宏块像素信息。3. The method for encrypting and decrypting residual coefficient magnitudes in H.264 standard video information as claimed in claim 2, wherein the information containing video content includes motion vectors, intra-frame prediction mode words, quantization step size, residual Difference coefficient trailing coefficient part and I_PCM macroblock pixel information. 4、如权利要求2所述的H.264标准视频信息中残差系数幅值的加解密方法,其特征在于:对4×4亮度块的3bit预测模式字、残差块系数的拖尾部分和I_PCM宏块的像素值使用密码学算法直接加密。4. The method for encrypting and decrypting the magnitude of the residual coefficient in the H.264 standard video information according to claim 2, characterized in that: for the 3-bit prediction mode word of the 4×4 luminance block, the trailing part of the coefficient of the residual block and the pixel values of the I_PCM macroblock are directly encrypted using a cryptographic algorithm. 5、如权利要求2所述的H.264标准视频信息中残差系数幅值的加解密方法,其特征在于:对16x16亮度块和色度块帧内预测模式字加密其最后一个比特。5. The method for encrypting and decrypting residual coefficient magnitudes in H.264 standard video information according to claim 2, characterized in that the last bit of the intra-frame prediction mode words for 16x16 luma blocks and chrominance blocks is encrypted. 6、如权利要求2所述的H.264标准视频信息中残差系数幅值的加解密方法,其特征在于:对量化步长、运动矢量差分值加密其Exp-Golomb码字的后缀部分。6. The method for encrypting and decrypting the magnitude of residual coefficients in H.264 standard video information according to claim 2, characterized in that the suffix part of the Exp-Golomb codeword is encrypted for the quantization step size and the difference value of the motion vector.
CN 200610166521 2006-12-28 2006-12-28 A Encryption and Decryption Method of Residual Coefficient Amplitude in H.264 Standard Video Information Expired - Fee Related CN100496118C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200610166521 CN100496118C (en) 2006-12-28 2006-12-28 A Encryption and Decryption Method of Residual Coefficient Amplitude in H.264 Standard Video Information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200610166521 CN100496118C (en) 2006-12-28 2006-12-28 A Encryption and Decryption Method of Residual Coefficient Amplitude in H.264 Standard Video Information

Publications (2)

Publication Number Publication Date
CN101064822A CN101064822A (en) 2007-10-31
CN100496118C true CN100496118C (en) 2009-06-03

Family

ID=38965487

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200610166521 Expired - Fee Related CN100496118C (en) 2006-12-28 2006-12-28 A Encryption and Decryption Method of Residual Coefficient Amplitude in H.264 Standard Video Information

Country Status (1)

Country Link
CN (1) CN100496118C (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10057641B2 (en) * 2009-03-25 2018-08-21 Sony Corporation Method to upgrade content encryption
CN102025996B (en) * 2010-12-20 2012-09-26 浙江大学 Multiple-prediction mode multiplexed H.264 interframe processing unit
CN103747261B (en) * 2013-12-31 2017-06-27 北京工业大学 H.264 compressed domain layered perceptual encryption method based on motion reference structure
CN108206950B (en) * 2016-12-19 2021-11-12 北京君正集成电路股份有限公司 Code stream length calculation method and device
CN108632614B (en) * 2017-03-21 2021-11-05 中山大学 A Motion Detection Method Based on Format Compatible Encrypted Video
CN114390282B (en) * 2018-11-12 2023-09-08 Lg电子株式会社 Image decoding method, image encoding method, and data transmitting method
CN116527903B (en) * 2023-06-30 2023-09-12 鹏城实验室 Image shallow compression method and decoding method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1536532A (en) * 2003-04-10 2004-10-13 中国科学院计算技术研究所 An Effective Image Compression and Encryption Fusion Method
CN1604640A (en) * 2004-10-28 2005-04-06 武汉大学 A method for encryption and decryption of video information
CN1882082A (en) * 2006-05-11 2006-12-20 北京经天科技有限公司 Selective encryption algorithm aiming at network video

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1536532A (en) * 2003-04-10 2004-10-13 中国科学院计算技术研究所 An Effective Image Compression and Encryption Fusion Method
CN1604640A (en) * 2004-10-28 2005-04-06 武汉大学 A method for encryption and decryption of video information
CN1882082A (en) * 2006-05-11 2006-12-20 北京经天科技有限公司 Selective encryption algorithm aiming at network video

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
一种适合于H.264实时视频传输的新型加密方案. 包先雨,蒋建国,李援.电子学报,第34卷第11期. 2006
一种适合于H.264实时视频传输的新型加密方案. 包先雨,蒋建国,李援.电子学报,第34卷第11期. 2006 *

Also Published As

Publication number Publication date
CN101064822A (en) 2007-10-31

Similar Documents

Publication Publication Date Title
Liu et al. A survey of video encryption algorithms
CN100563332C (en) Encryption/decryption method and system for scalable video bitstream
Shah et al. Video encryption: A survey
US7549058B1 (en) Method and apparatus for encrypting and decrypting digital data
US9473829B2 (en) Methods and devices for selective format-preserving data encryption
JP2008524950A (en) Video that protects synchronization and syntax compatibility. H.264 encryption
US20020018565A1 (en) Configurable encryption for access control of digital content
CN100496118C (en) A Encryption and Decryption Method of Residual Coefficient Amplitude in H.264 Standard Video Information
US20080291999A1 (en) Method and apparatus for video frame marking
Guan et al. An efficient commutative encryption and data hiding scheme for HEVC video
Xu et al. An improved scheme for data hiding in encrypted H. 264/AVC videos
Xu et al. Tunable data hiding in partially encrypted H. 264/AVC videos
Bergeron et al. Complaint Selective encryption for H. 264/AVC video streams
Zou et al. H. 264 video encryption scheme adaptive to DRM
Thomas et al. A novel secure H. 264 transcoder using selective encryption
Tang et al. A format compliant framework for HEVC selective encryption after encoding
Park et al. Efficient selective encryption scheme for the H. 264/scalable video coding (SVC)
CN104301727B (en) Quality controllable H.264 video-aware AES based on CABAC
CN111372083B (en) SHVC video encryption method based on interlayer processing
WANG et al. Perceptual video encryption scheme for mobile application based on H. 264
Mao et al. Fast compression domain video encryption scheme for H. 264/AVC streaming
Jovanović et al. An efficient mechanism of cryptographic synchronization within selectively encrypted H. 265/HEVC video stream
Mohammed et al. A review of selective H. 264 video encryption techniques
CN117119226A (en) Efficient H264 video stream real-time encryption method
Joshi et al. Enhancing selective ISMACryp video encryption for real time applications in handheld devices

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: 20090603

Termination date: 20111228