Real-time video encryption method and device for resisting deep learning face attacks

Through the XOR encryption of the H.264 code stream and the macroblock code stream sequence scrambling technology, the problems of deep learning face attacks and lack of real-time performance in the existing technology are solved, and efficient and safe video encryption is achieved, which is suitable for real-time video Communications and cloud monitoring.

CN115278243BActive Publication Date: 2024-10-29SHENZHEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210684520.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-17
Publication Date
2024-10-29
Estimated Expiration
2042-06-17

AI Technical Summary

Technical Problem

Existing video encryption technology has shortcomings in security and real-time performance in the face of deep learning face attacks. In particular, encrypted face reconstruction attacks based on GAN models are difficult to resist. At the same time, the encrypted data is unavailable and cannot meet the needs of real-time video. Communication software needs.

Method used

It adopts a lightweight encryption method for H.264 code stream, combines the AES algorithm to perform XOR encryption on the specified syntax elements in the video code stream, and uses a format-compatible macroblock code stream sequence scrambling technology based on Knut scrambling. The I-frame macroblock bit segments are position-arranged and encrypted to ensure the expansion and real-time performance of the encryption space.

Benefits of technology

It achieves effective resistance to deep learning face attacks, significantly improves encryption security, while maintaining the availability of encrypted data. It can achieve real-time encryption on high-definition videos, and is suitable for scenarios such as secure real-time video communication and cloud monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115278243B_ABST
    Figure CN115278243B_ABST
Patent Text Reader

Abstract

The present invention discloses a real-time video encryption method and device for resisting deep learning face attacks, including: obtaining a video code stream, parsing macroblock syntax elements and their corresponding code words in the video code stream; using the AES algorithm to perform XOR encryption on the code word bits of the specified syntax elements in the parsed entire video code stream; using a format-compatible macroblock code stream order scrambling technology based on Knuth scrambling, positionally arranging and encrypting the I-frame macroblock bit segments in the XOR-encrypted video code stream; and repackaging the positionally arranged and encrypted bit stream. The present invention combines the code word encryption of more syntax elements, not only considering the value encryption of the code stream bits, but also considering their position encryption, so that the encryption space is significantly increased and the security is further improved; the code stream-oriented encryption method ensures the real-time encryption speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of multimedia information security technology, and in particular to a real-time video encryption method, device, intelligent terminal and storage medium for resisting deep learning face attacks. Background Art

[0002] With the development of smart terminals and the popularity of network technology, the use of video communication software such as video conferencing and video classrooms has become increasingly popular. However, these video communication software are prone to privacy leakage during video transmission, and are then used for illegal crimes, such as using faces and voices in videos, using face generation technology and speech synthesis technology to forge realistic videos to defraud money.

[0003] Therefore, a fast and real-time video encryption method is needed to protect the privacy of content during video communication. The recent emergence of a new generation of attacks based on deep learning has also challenged the security of video encryption methods, such as the encrypted face reconstruction attack based on the GAN model, which can recover facial details from encrypted images. Therefore, it is urgent to propose a secure and reliable video encryption method that can resist deep learning attacks. At the same time, considering the country's monitoring of sensitive content in video transmission, it is also necessary to ensure that the encrypted video data is available and can support privacy-protected sensitive content detection to ensure the security supervision of information. In summary, the video encryption scheme of the new era needs to meet three characteristics: real-time, security, and availability.

[0004] At present, video encryption technology is mainly divided into two types: the first is a simple full encryption method, which treats the video bitstream as an unformatted data stream and uses standard encryption algorithms such as AES to encrypt the entire data stream. However, this method is time-consuming and the encrypted data is unavailable, so it is not applicable; the second is format-compatible selective encryption, which not only reduces the computational complexity, but also ensures format compatibility so that the encrypted data can extract encryption domain features. Selective encryption methods are usually embedded in the video compression and encoding process, and the privacy protection of video content is achieved by encrypting syntax elements such as IPM (intra-frame prediction mode), MVD (motion vector difference), and DCT (discrete cosine transform) coefficients. However, in actual scenarios, it is impossible to embed the encryption algorithm into the DSP chip that has been burned into the camera. It is closer to reality to directly encrypt the compressed bitstream. If this embedded selective encryption algorithm is to be applied, it will involve the increase in time-consuming compressed video decoding and re-encoding encryption, which is unbearable for video communication software with high real-time requirements. Therefore, the selective encryption method for compressed bitstream is suitable for privacy protection of video communication software. Among the existing encryption algorithms, only some encryption methods based on CAVLC (context-adaptive variable length coding) can be expanded into code stream encryption methods, while other encryption methods cannot avoid the re-encoding process, including encryption methods based on CABAC (context- adaptive binary arithmetic coding), encryption based on the scanning order of DCT coefficients, encryption based on DCT transform type, encryption based on macroblock frame position disturbance, etc.

[0005] Therefore, the existing technology still needs to be improved and enhanced in terms of security and real-time performance. Summary of the invention

[0006] The technical problem to be solved by the present invention is that, in view of the above-mentioned defects of the prior art, a real-time video encryption method, device, intelligent terminal and storage medium for counteracting deep learning face attacks are provided. The present invention can support lightweight encryption of video big data and video privacy protection applications based on cloud computing; the present invention combines codeword encryption of more grammatical elements, not only considering the value encryption of code stream bits, but also considering their position encryption, which significantly increases the encryption space and further improves security; the code stream-oriented encryption method ensures the real-time encryption speed.

[0007] In order to solve the above technical problems, the first aspect of the present invention provides a real-time video encryption method for resisting deep learning face attacks, and the method comprises:

[0008] A real-time video encryption method for resisting deep learning face attacks, wherein the method comprises:

[0009] Obtain video bitstream and parse macroblock syntax elements and their corresponding codewords in the video bitstream;

[0010] Use the AES algorithm to perform XOR encryption on the codeword bits of the specified syntax elements in the entire parsed video bit stream;

[0011] Using the format-compatible macroblock stream order scrambling technology based on Knuth scrambling, the I-frame macroblock bit segments in the XOR-encrypted video stream are positionally arranged and encrypted;

[0012] Re-encapsulate the positionally encrypted bit stream.

[0013] In the real-time video encryption method against deep learning face attacks, the step of obtaining a video bitstream and parsing macroblock syntax elements and their corresponding codewords in the video bitstream also includes:

[0014] Obtain an H.264 video code stream, and decapsulate the obtained H.264 video code stream from an extended byte sequence payload EBSP into a data bit string SODB;

[0015] Parse the bit positions of macroblock-level syntax elements and their corresponding codewords in the data bit string SODB.

[0016] The real-time video encryption method against deep learning face attacks, wherein the specified syntax element in the step of using the AES algorithm to XOR encrypt the codeword bits of the specified syntax element in the entire parsed video bit stream includes the following variable parameters:

[0017] Intra_4x4_IPM: intra prediction mode for 4x4 blocks;

[0018] Intra_16x16_IPM: intra prediction mode for 16x16 blocks;

[0019] Chroma_IPM: intra prediction mode for chroma blocks;

[0020] MVD: motion vector difference;

[0021] ref_idx: reference frame number;

[0022] delta_QP: quantization parameter difference;

[0023] sign_of_T1s: the sign of the tailing coefficient;

[0024] level: residual coefficient amplitude;

[0025] run_before: The number of zeros before the non-zero coefficients.

[0026] The real-time video encryption method against deep learning face attacks, wherein the step of using the AES algorithm to XOR encrypt the codeword bits of the specified syntax elements in the entire parsed video bit stream comprises:

[0027] Use the AES algorithm to generate a random binary sequence based on the key;

[0028] The last bit of the intra prediction mode codeword of the 16x16 block and the three bits of the intra prediction mode codeword of the 4x4 block are encrypted with a random sequence XOR; and when encrypting the intra prediction mode codeword of the 16x16 block of the P frame, encryption is performed only when the value of the macroblock type mb_type satisfies the following formula (1):

[0029] (mb_type-7)mod 4<2 formula (1)

[0030] Among them, mod is the remainder after dividing two values;

[0031] The last bit of the intra prediction mode codeword of the chroma block is encrypted with a random sequence XOR, and can only be encrypted when Chroma_IPM is equal to 1 or 2.

[0032] All suffix bits of the motion vector difference MVD codeword and the last bit of the reference frame number ref_idx codeword are encrypted using a random sequence XOR; assuming that λ is the maximum number of reference frames, the encryption of the reference frame number ref_idx must satisfy the following formula (2):

[0033]

[0034] in, Refers to the rounding down operation;

[0035] Use a random sequence to XOR-encrypt all suffix bits of the quantization parameter difference delta_QP codeword, all bits of the sign of the trailing coefficient sign_of_T1s codeword, all suffix bits of the residual coefficient amplitude level codeword, and the last bit of the run_before codeword, the number of zero values ​​between the last non-zero coefficient.

[0036] The real-time video encryption method against deep learning face attacks, wherein the step of using a format-compatible macroblock stream order scrambling technology based on Knuth scrambling to positionally encrypt the I-frame macroblock bit segments in the XOR-encrypted video stream comprises:

[0037] Parse VLC table types for all 4x4_DCT blocks;

[0038] Based on the random numbers generated by AES, the Knuth scrambling algorithm is used to generate a random macroblock address sequence;

[0039] Take a macroblock MB in random macroblock address order i ; In macroblock MB i Find any macroblock MB around j , if the macroblock MB i and MB j After the I frame position is swapped, the VLC table called by each 4x4_DCT block in the I frame remains unchanged, so the macroblock MB i and MB j The bit segment positions of the macroblock MB are exchanged, and the exchanged displacement vector ΔS is embedded into the SEI message; if the macroblock MB i and MB j After the I frame position is swapped, the VLC table called by each 4x4_DCT block in the I frame changes, and then continue to look for another macroblock MB j with MB i Swap until a macroblock or MB that meets the swap conditions is found i Until all the surrounding macroblocks have been traversed;

[0040] Take another macroblock A in random macroblock address order and repeat the above steps until all macroblocks in the I frame are processed;

[0041] The SEI message is encrypted using the AES algorithm.

[0042] In the real-time video encryption method for resisting deep learning face attacks, the step of repackaging the bit stream after position arrangement encryption specifically includes:

[0043] The encrypted data bit string SODB is encapsulated into an H.264 code stream in the form of an extended byte sequence payload EBSP.

[0044] A real-time video encryption device for resisting deep learning face attacks, wherein the device comprises:

[0045] The acquisition parsing module is used to acquire the video bitstream and parse the macroblock syntax elements and their corresponding codewords in the video bitstream;

[0046] An XOR encryption module is used to XOR encrypt the codeword bits of the specified syntax elements in the entire parsed video bit stream using the AES algorithm;

[0047] A position arrangement encryption module is used to use a format-compatible macroblock stream order scrambling technology based on Knuth scrambling to positionally encrypt the I-frame macroblock bit segments in the XOR-encrypted video stream;

[0048] The repackaging module is used to repack the bit stream after position arrangement encryption.

[0049] An intelligent terminal includes a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, including the method for executing any one of the methods described above.

[0050] A non-transitory computer-readable storage medium, wherein when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any of the methods described above.

[0051] Beneficial effects: Compared with the prior art, the present invention provides a real-time video encryption method to resist deep learning face attacks. The present invention is a lightweight encryption method for H.264 bitstream big data, with low computational complexity and high encryption efficiency, and can achieve real-time encryption even on high-definition video; in addition, the security performance of the present invention is far superior to other bitstream encryption methods, and can effectively resist new attacks based on deep learning; at the same time, the encryption compression domain features are also retained to support video processing and analysis based on cloud-based privacy protection applications. The present invention has great application value in scenarios such as secure real-time video communication, privacy-protected cloud monitoring, and secure video big data cloud computing.

[0052] The present invention encrypts the video data so that it can decode the wrong pixel content, and uses inter-frame prediction and frame difference prediction to propagate this error to other areas and other frames, thereby achieving the purpose of protecting the entire video content. The present invention combines codeword encryption of more grammatical elements, not only considering the value encryption of the code stream bits, but also considering their position encryption, so that the encryption space is significantly increased and the security is further improved. At the same time, the encryption method in the present invention is code stream-oriented, with low complexity and high efficiency, which also ensures the real-time nature of the encryption speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 A flowchart of a specific implementation method of a real-time video encryption method for counteracting deep learning face attacks provided in an embodiment of the present invention.

[0054] Figure 2 A schematic diagram of the video sequence composition structure of a specific implementation method of the real-time video encryption method for counteracting deep learning face attacks provided in an embodiment of the present invention.

[0055] Figure 3 A schematic diagram of an extended byte sequence payload, an original byte sequence payload, and a data bit string structure of a specific implementation method of a real-time video encryption method for counteracting deep learning face attacks provided in an embodiment of the present invention.

[0056] Figure 4 This is a schematic diagram of the processing process of a specific application embodiment of the real-time video encryption method for counteracting deep learning face attacks of the present invention.

[0057] Figure 5 This is a schematic diagram of a 4x4 DCT block that will produce a VLC table change after macroblock positions are exchanged in a real-time video encryption method for counteracting deep learning face attacks in an embodiment of the present invention.

[0058] Figure 6 This is a schematic diagram comparing the results of different encryption methods attacking a face privacy reconstruction model based on deep learning for a real-time video encryption method against deep learning face attacks in a specific application embodiment of the present invention.

[0059] Figure 7 It is a principle block diagram of a real-time video encryption device for counteracting deep learning face attacks provided by an embodiment of the present invention.

[0060] Figure 8 It is a block diagram of the internal structure principle of the intelligent terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0061] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0062] With the development of smart terminals and the popularity of network technology, the use of video communication software such as video conferencing and video classrooms has become increasingly popular. However, these video communication software are prone to privacy leakage during video transmission, and are then used for illegal crimes, such as using faces and voices in videos, using face generation technology and speech synthesis technology to forge realistic videos to defraud money.

[0063] Therefore, a fast and real-time video encryption method is needed to protect the privacy of content during video communication. The recent emergence of a new generation of attacks based on deep learning has also challenged the security of video encryption methods, such as the encrypted face reconstruction attack based on the GAN model, which can recover facial details from encrypted images. Therefore, it is urgent to propose a secure and reliable video encryption method that can resist deep learning attacks. At the same time, considering the country's monitoring of sensitive content in video transmission, it is also necessary to ensure that the encrypted video data is available and can support privacy-protected sensitive content detection to ensure the security supervision of information. In summary, the video encryption scheme of the new era needs to meet three characteristics: real-time, security, and availability.

[0064] At present, video encryption technology is mainly divided into two types: the first is a simple full encryption method, which treats the video bitstream as an unformatted data stream and uses standard encryption algorithms such as AES to encrypt the entire data stream. However, this method is time-consuming and the encrypted data is unusable, so it is not applicable; the second is format-compatible selective encryption, which reduces the computational complexity and ensures format compatibility so that the encrypted data can extract encryption domain features. Selective encryption methods are usually embedded in the video compression encoding process, and privacy protection of video content is achieved by encrypting syntax elements such as IPM, MVD, and DCT coefficients.

[0065] However, in the actual scenario of the existing technology, it is impossible to embed the encryption algorithm into the DSP chip that has been burned into the camera. It is closer to reality to directly encrypt the compressed code stream. If this embedded selective encryption algorithm is to be applied, it will involve the increase in time consumption of compressed video decoding and re-encoding encryption, which is unbearable for video communication software with high real-time requirements. Therefore, the selective encryption method for compressed code stream is suitable for privacy protection of video communication software. Among the existing encryption algorithms, only some encryption methods based on CAVLC can be expanded into code stream encryption methods, while other encryption methods cannot avoid the re-encoding process, including encryption methods based on CABAC, encryption based on scanning order of DCT coefficients, encryption based on DCT transform type, encryption based on macroblock frame position disturbance, etc.

[0066] In order to solve the problems of the prior art, the present embodiment provides a real-time video encryption method against deep learning face attacks. The present invention proposes a real-time video encryption method against deep learning face attacks for tampered images, which is used to support lightweight encryption of video big data and video privacy protection applications based on cloud computing.

[0067] The present invention adopts a lightweight encryption method for H.264 bitstream big data, with low computational complexity and high encryption efficiency, and can achieve real-time encryption even on high-definition video; in addition, the security performance of the present invention is far superior to other bitstream encryption methods, and can effectively resist new attacks based on deep learning; at the same time, it also retains the characteristics of the encryption compression domain to support video processing and analysis based on cloud-based privacy protection applications. The present invention has great application value in scenarios such as secure real-time video communication, privacy-protected cloud monitoring, and secure video big data cloud computing.

[0068] H.26x standard, moving picture coding standard, H.26x and MPEG-X are the most widely used international standards for video and audio compression. Among them, H.26x is a moving picture coding standard, while MPEG mainly includes MPEG video, MPEG audio and MPEG system video and audio synchronization. MPEG-X has both differences and close connections, especially H.262 and H. 264, which are both standards formulated by ITU-T and components of MPEG-2 and MPEG jointly formulated by ITU-T and ISO / IEC.

[0069] Among them, the H.264 original code stream (raw stream) is composed of NALU (video data network abstraction layer unit) one by one, and its functions are divided into two layers, VCL (video coding layer) and NAL (video data network abstraction layer).

[0070] In the H.264 / AVC video coding standard, all bitstream data is ultimately encapsulated into NALUs (Network Abstract Layer Units).

[0071] Since it is a video stream, the NALU must contain video data, in addition to other information, such as timestamp, frame rate, whether the picture is flipped, etc. These data are stored in each NALU as a unit, which can be transmitted over the network (streaming) or decoded locally (playing).

[0072] (1) NAL layer (video data network abstraction layer)

[0073] Because H264 is ultimately transmitted over the network, the maximum transmission unit of a network packet is 1500 bytes. An H264 frame is often larger than 1500 bytes, so a frame needs to be split into multiple packets for transmission. These unpacking and assembly tasks are all handled at the NAL layer.

[0074] (2) VCL layer (video coding layer)

[0075] Compress the original video data.

[0076] Exemplary Methods

[0077] The method of this embodiment can be applied to smart terminals. The H.264 original code stream (raw stream) of the present invention is only 264, which is easier to describe. 265 is also applicable. When it is implemented, Figure 1 As shown in, a real-time video encryption method for resisting deep learning face attacks provided by an embodiment of the present invention specifically includes the following steps:

[0078] Step S100: obtaining a video bitstream, and parsing macroblock syntax elements and their corresponding codewords in the video bitstream;

[0079] The present invention is described by taking H.264 video code stream as an example. For example, the H.264 video code stream is obtained, and macroblock syntax elements and corresponding code words in the H.264 video code stream are parsed.

[0080] like Figure 2 As shown in the figure, the organization of H264 video code stream is arranged from large to small: video sequence, image (frame / field-picture), slice group, slice, macroblock, sub-block, and pixel.

[0081] In the embodiment of the present invention, the H.264 video code stream is divided into a plurality of macroblocks in units of macroblocks, and the syntax elements and corresponding codewords (bitstreams) of the macroblocks in the H.264 video code stream are parsed.

[0082] The syntax element is the basic unit of data in the bitstream. Each syntax element consists of several bits, which represents a specific physical meaning (such as prediction type, quantization coefficient qp, etc.). The syntax of the video coding standard specifies the organizational structure of each syntax element, and the semantics explains the specific meaning of the syntax element. In the embodiment of the present invention, the syntax elements of macroblocks in the H.264 video bitstream and their corresponding codewords (bitstreams) are analyzed.

[0083] Step S200: using the AES algorithm to perform XOR encryption on the codeword bits of the specified syntax element in the entire parsed video bit stream;

[0084] The specified syntax elements in the embodiment of the present invention are some variable parameters used in the H.264 video code stream encoding process, that is, the specified syntax elements include the following variable parameters:

[0085] Intra_4x4_IPM: Intra prediction mode for 4x4 blocks

[0086] Intra_16x16_IPM: Intra prediction mode for 16x16 blocks

[0087] Chroma_IPM: intra prediction mode for chroma blocks;

[0088] MVD: Motion Vector Difference

[0089] ref_idx: reference frame number

[0090] delta_QP: quantization parameter difference

[0091] sign_of_T1s: the sign of the tailing coefficient

[0092] level: residual coefficient amplitude

[0093] run_before: The number of zeros before the non-zero coefficients.

[0094] In the embodiment of the present invention, the AES algorithm is used to perform XOR encryption on the codeword bits of the above-mentioned specified syntax elements in the entire parsed video bit stream.

[0095] Among them, the AES algorithm is a symmetric block encryption technology that uses 128-bit block encryption data and provides higher encryption strength than the RC4 algorithm of WEP / TKIPS. The encryption and decryption code tables of AES are separate, and it supports sub-key encryption, which is better than the previous practice of using a special key for decryption.

[0096] Among them, the XOR in the XOR encryption is a type of logical analysis of two operands, and the symbol is XOR or EOR. Different from the general logical OR, it is false when the two values ​​are the same, and true when the values ​​are different. XOR encryption is an encryption algorithm in cryptography, which refers to the XOR operation of information to achieve the purpose of encryption and decryption. According to this logic, each character of the text serial can be encrypted by performing a bitwise XOR operation with a given key. If you want to decrypt, you only need to perform a bitwise XOR operation on the encrypted result and the key again.

[0097] Step S300: for the XOR-encrypted video stream, using a format-compatible macroblock stream order scrambling technology based on Knuth Shuffle to positionally align and encrypt the I-frame macroblock bit segments in the XOR-encrypted video stream;

[0098] In the embodiment of the present invention, the format-compatible macroblock code stream order scrambling technology of the Knuth Shuffle algorithm is adopted to positionally align and encrypt the I-frame macroblock bit segments in the XOR-encrypted video code stream.

[0099] The Knuth Shuffle algorithm, also known as Fisher-Yates Shuffle, or Knuth Shuffle algorithm, used in the embodiment of the present invention is an algorithm for generating random permutations of a finite sequence. The present invention generates a random sequence using the AES algorithm, and then performs Knuth Shuffle on the macroblock address sequence in the I frame based on the random sequence to generate a random macroblock address sequence for determining the order of format-compatible scrambling operations on the I frame macroblocks. The corresponding decryption operation is restored in the order of scrambling.

[0100] Among them, the format compatible disturbance operation of the I frame macroblock is based on the principle that the VLC (variable length coding) table remains unchanged. The VLC table is a variable length codeword table used in CAVLC context adaptive variable length entropy coding. There are five types of VLC tables in total. Which VLC table the 4x4_DCT block calls depends on the average nC value of the 4x4_DCT blocks on its left and above. Among them, DCT (Discrete Cosine Transformation) is discrete cosine transform, and the nC value is the number of non-zero residual coefficients in the DCT block.

[0101] Step S400: repackaging the encrypted bit stream.

[0102] In this step, the encrypted bit stream is repackaged.

[0103] As can be seen from the above, the embodiments of the present invention provide a real-time video encryption method to counter deep learning face attacks in order to address the security and real-time issues of existing video encryption, and to support lightweight encryption of video big data and video privacy protection applications based on cloud computing. The lightweight encryption method for H.264 bitstream big data in the embodiments of the present invention has low computational complexity and high encryption efficiency, and can achieve real-time encryption even on high-definition videos. In addition, the security performance of the double encryption method adopted by the present invention far exceeds that of other bitstream encryption methods, and can effectively resist new attacks based on deep learning. At the same time, the encrypted compression domain features are also retained to support video processing and analysis of cloud-based privacy protection applications. The present invention has significant application value in scenarios such as secure real-time video communications, privacy-protected cloud monitoring, and secure video big data cloud computing.

[0104] The step S100 in the embodiment of the present invention specifically includes:

[0105] S11: Acquire an H.264 video code stream, and decapsulate the acquired H.264 video code stream from an EBSP (Extended Byte Sequence Payload) into a SODB (Data Bit String).

[0106] S12: Parse the bit positions of macroblock-level syntax elements and their corresponding codewords in SODB (data bit string).

[0107] In the embodiment of the present invention, Figure 3 As shown, the description of EBSP (Extended Byte Sequence Payload), RBSP (Raw Byte Sequence Payload), and SODP (Data Bit String) related to H.264 video code stream is as follows:

[0108] 1) EBSP: Encapsulated Byte Sequence Payload, which removes the start codes 00 00 01 / 00 00 00 01, but includes the 0x3 anti-contention code to prevent duplication with the start code.

[0109] 2) RBSP: Raw Byte Sequence Payload, byte-aligned SODP, which adds a 1 and several 0s at the end of SODP for byte alignment.

[0110] 3) SODP: String Of Data Bits, unaligned data byte stream.

[0111] Among them, SODB: data bit string, that is, the most original data after encoding;

[0112] RBSP: Raw Byte Sequence Payload, that is, trailing bits are added after SODB, that is, one bit 1 and several bits 0 for byte alignment;

[0113] EBSP: Extended Byte Sequence Payload, which adds the parity byte 0x03 on the basis of RBSP

[0114] SODB is the original data received by the code, which is encapsulated into RBSP. RBSP is the encapsulation format of the data part of the NAL unit. In order to prevent competition with the start code, the padding byte 0x03 is introduced inside the NAL, thus forming EBSP.

[0115] In the embodiment of the present invention, an H.264 video code stream is obtained, and the obtained H.264 video code stream is decapsulated from an extended byte sequence payload EBSP into a data bit string SODB; then the macroblock-level syntax elements and the bit positions of their corresponding code words in the data bit string SODB are parsed.

[0116] like Figure 4 As shown, the H.264 video code stream is obtained, decapsulated and parsed to form SEI (supplemental enhancement information) and multiple MBs (macroblocks). For example, MB i Macroblock, ...MB j Macroblock, ...MB N Macroblocks, etc., parse the bit positions of macroblock-level syntax elements and their corresponding codewords in the data bit string SODB.

[0117] Furthermore, if Figure 4As shown, the step S200 of using the AES algorithm to perform XOR encryption on the codeword bits of the specified syntax element in the entire parsed video bit stream specifically includes the following steps:

[0118] S21: Generate a random binary sequence according to the key using the AES algorithm.

[0119] Among them, the mode used by the AES algorithm is the counter mode. In this mode, a random binary sequence of infinite length 110... can be generated based on a 128-bit key.

[0120] S22: Encrypt the last bit of the Intra_16x16_IPM (16x16 block intra prediction mode) codeword and three bits of the Intra_4x4_IPM (4x4 block intra prediction mode) codeword using a random sequence XOR; Note that when encrypting the Intra_16x16_IPM codeword of a P frame, encryption is possible only when the value of mb_type (macroblock type) satisfies the following formula (1):

[0121] (mb_type-7)mod 4<2 (Formula 1)

[0122] Among them, mod means to find the remainder after dividing two values.

[0123] S23: Encrypt the last bit of the intra prediction mode codeword of the chrominance block with a random sequence XOR, and encryption is performed only when Chroma_IPM is equal to 1 or 2.

[0124] S24: All suffix bits of the MVD (motion vector difference) codeword and the last bit of the ref_idx (reference frame number) codeword are encrypted using a random sequence XOR; assuming that λ is the maximum number of reference frames, the encryption of ref_idx (reference frame number) needs to satisfy the following formula (2):

[0125]

[0126] in, Refers to the rounding down operation;

[0127] S25: Use a random sequence to XOR-encrypt all suffix bits of the delta_QP (quantization parameter difference) codeword, all bits of the sign_of_T1s (sign of the trailing coefficient) codeword, all suffix bits of the level (residual coefficient amplitude) codeword, and the last bit of the last run_before (number of zero values ​​between non-zero coefficients) codeword.

[0128] In an embodiment of the present invention, the above steps S21, S22, S23, S24, and S25 are used to implement XOR encryption of the codeword bits of the specified syntax elements in the entire parsed video stream using the AES algorithm. The present invention is a lightweight encryption method for H.264 stream big data, which has strong security, low computational complexity, and high encryption efficiency, and can achieve real-time encryption even on high-definition video.

[0129] Furthermore, the step of using the format-compatible macroblock stream order scrambling technology based on Knuth scrambling to positionally encrypt the I-frame macroblock bit segments in the XOR-encrypted video stream in step S300 of the present invention specifically includes:

[0130] S31: Parse the VLC table types of all 4x4_DCT blocks;

[0131] The VLC table type of each 4x4_DCT block depends on the average nC value of the adjacent 4x4_DCT blocks on its upper and left sides. The nC values ​​of 4x4_DCT blocks in different macroblocks are also different, so the change in the position relationship between macroblocks will affect the VLC table type selected by all 4x4_DCT blocks in the macroblock.

[0132] S32: Generate a random macroblock address sequence using the Knuth scrambling algorithm based on the random number generated by AES;

[0133] The AES algorithm uses a counter mode, which can generate a random binary sequence of infinite length based on a 128-bit key. The Knuth scrambling algorithm scrambles the order of the macroblock addresses of the I frame based on the random numbers generated by AES.

[0134] S33: Take a macroblock MB in random macroblock address order i ; In macroblock MB i Find any macroblock MB around j , if the macroblock MB i and MB j After the I frame position is swapped, the VLC table called by each 4x4_DCT block in the I frame remains unchanged, so the macroblock MB i and MB j The bit segment positions of the macroblock MB are exchanged, and the exchanged displacement vector ΔS is embedded into the SEI message; if the macroblock MB i and MB j After the I frame position is swapped, the VLC table called by each 4x4_DCT block in the I frame changes, and then continue to look for another macroblock MB j with MB i Swap until a macroblock or MB that meets the swap conditions is found iUntil all the surrounding macroblocks have been traversed;

[0135] The encoding method of the exchanged displacement vector ΔS adopts fixed-length encoding, that is, a fixed-length bit quantity is used to describe the value of the displacement vector ΔS, one bit represents the sign, and the remaining bits represent the absolute value.

[0136] S34: repeat step S33 until all macroblocks in the I frame are processed;

[0137] S35: Encrypt the SEI message using the AES algorithm;

[0138] The counter mode of AES is used to generate a random binary sequence of the same length as the SEI message, and then the random binary sequence is encrypted with the bits in the SEI message by bitwise XOR.

[0139] Furthermore, the step S400 of the present invention of repackaging the positionally encrypted bit stream specifically includes:

[0140] S41: Encapsulate the encrypted data bit string SODB into an H.264 code stream in the form of an extended byte sequence payload EBSP.

[0141] Specific as Figure 4 As shown, attached Figure 4 The encryption flow chart of a specific embodiment of the present invention is shown, and the encryption steps are mainly composed of two steps: bit-by-bit encryption and position scrambling.

[0142] In the embodiment of the present invention, bitwise encryption refers to the encryption operation of some specified syntax element codeword bits in the video bit stream in step S200. Figure 4 Only the encryption operation of three bits of the Intra_4x4_IPM (4x4 block intra prediction mode) codeword is shown. The actual encryption process also includes the codeword encryption of syntax elements such as Intra_16x16_IPM (16x16 block intra prediction mode), Chroma_IPM (chrominance block intra prediction mode), MVD (motion vector difference), ref_idx (reference frame number), delta_QP (quantization parameter difference), sign_of_T1s (sign of trailing coefficient), level (residual coefficient amplitude), run_before (number of zero values ​​between non-zero coefficients) in each macroblock. Bitwise encryption uses the AES standard encryption algorithm to generate a random binary sequence according to the key, and performs an XOR operation on the bits to be encrypted and the random sequence, thereby achieving the effect of encrypting the video bit stream bits.

[0143] In the embodiment of the present invention, position disturbance refers to the operation of swapping the position of the macroblock bit segments of the video code stream in step S300. Figure 4 Only one macroblock bitstream position exchange process is shown in the figure. The actual encryption process also includes other macroblocks in the I frame and other I frames in the video. The encryption process first uses the Knuth scrambling algorithm to generate a random macroblock order, and then performs format-compatible exchange encryption on the macroblocks one by one based on the random order. Macroblocks that have been exchanged will no longer participate in the exchange encryption. Each macroblock bitstream position perturbation encryption will produce a corresponding two-dimensional spatial position change in the decoded frame, as shown in the attached figure. Figure 5 As shown. Since there is a strong correlation between the contexts of CAVLC entropy coding, the position change of macroblocks will cause the VLC tables of some DCT blocks to change, which will cause errors in the entropy decoding of these DCT blocks. Even so, since there are only 5 types of VLC tables in the CAVLC entropy coding of H.264, there is still a certain probability that the VLC table of the DCT block can remain unchanged after the macroblock is exchanged. Therefore, if it can be guaranteed that the VLC tables of all DCT blocks need to remain unchanged each time the macroblock is disturbed, it can be guaranteed that no format conflict will occur after the position exchange. Then, the macroblock disturbance operation for format compatibility needs to meet the following conditions: after the two macroblocks are exchanged, under the new macroblock position relationship, the VLC table type used by all 4x4_DCT blocks in the I frame remains the same as before the exchange. However, if it is necessary to judge the VLC tables of all 4x4_DCT blocks, it will consume a lot of calculation, which will seriously slow down the encryption speed. Therefore, the present invention proposes to only calculate as shown in the attached Figure 5 The VLC table of the dark DCT block shown in the figure is changed, which greatly reduces the computational complexity of the format-compatible macroblock scrambling algorithm. It should be noted that in addition to the DCT block of the luminance channel, the VLC table type used for the DCT block of the chrominance channel must also be kept unchanged. Considering the irreversibility of position scrambling encryption, the displacement vector ΔS exchanged each time needs to be recorded in the SEI message, and the encoding method uses fixed-length encoding.

[0144] Among them, SEI (supplemental enhancement information) refers to a data unit in the H.264 code stream structure that is responsible for recording additional messages.

[0145] The principle of the present invention is: by encrypting the video data, it can decode the wrong pixel content, and by using inter-frame prediction and frame difference prediction, this error can be propagated to other areas and other frames, so as to achieve the purpose of protecting the entire video content. The present invention combines the codeword encryption of more grammatical elements, not only considering the value encryption of the code stream bits, but also considering its position encryption, so that the encryption space is significantly increased and the security is further improved. At the same time, the encryption method in the present invention is code stream-oriented, with low complexity and high efficiency, which also ensures the real-time encryption speed. In addition, the macroblock code stream order disruption technology of the present invention destroys the correlation between the macroblock positions in the decoded frame, making it impossible for the position-sensitive convolutional neural network to learn useful features, thereby making the deep learning attack under the known plaintext attack model invalid. At the same time, in order to retain the effectiveness of the encrypted compression domain features on the P frame, the present invention only applies macroblock code stream order disruption encryption on the I frame.

[0146] Some specific embodiments and experimental results of the method of the present invention are given below:

[0147] Example 1

[0148] First, the encryption performance of the present invention is tested and compared with the existing video encryption method for bitstream. The video data of the experiment comes from the video standard test library https: / / media.xiph.org / video / derf / . The experimental results are shown in Table 1, where:

[0149] PSNR (Peak Signal to Noise Ratio) refers to the peak signal-to-noise ratio;

[0150] SSIM (Structural Similarity Index) refers to structural similarity;

[0151] IE (Information Entropy) refers to information entropy;

[0152] EDR (Edges Differential Ratio) refers to the edge difference rate;

[0153] NPRC (Number of Changing Pixel Rate) refers to the number of changing pixel rates;

[0154] UACI (Unified Averaged Changed Intensity) refers to the unified average changed intensity;

[0155] The encryption methods compared in Table 1 are represented by the English names of the inventors.

[0156] It can be found that the encryption space and visual indicators of the present invention are significantly better than other video encryption methods, which means that the security of the present invention is the highest.

[0157] Table 1 Performance comparison of code stream-oriented encryption methods

[0158]

[0159]

[0160] Example 2

[0161] Then the test video is enlarged to explore the encryption performance of the present invention under different video resolutions. Table 2 reports the average performance results of 100 repeated experiments, where MSR refers to the percentage of macroblocks with disturbed positions, and ER refers to the percentage of encrypted bits in the code stream. Obviously, MSR and ER, which represent the size of the encryption space, are further increased in high-definition video, and security is improved; in addition, in terms of encryption speed, even if the encrypted object is a high-definition video, it can meet the real-time requirements.

[0162] Table 2 Encryption performance at different video resolutions

[0163] Resolution MSR(%) ER(%) PSNR(dB) Encryption speed (fps) 352x288 19.0620 26.9340 7.6668 1888.6520 704x576 46.0038 35.8614 7.6340 339.5402 1056x864 65.8697 42.8762 7.6226 77.0341 1408x1152 76.8416 45.4158 7.5264 42.8333

[0164] Example 3

[0165] Finally, an experiment on defending against deep learning face attacks is conducted. In the experiment, the CGAN model of Pix2Pix is ​​used to learn the mapping from encrypted faces to original faces to obtain the face privacy in encrypted images. The experiment is evaluated on the dataset CASIA-WebFace. Figure 6 The attack results of different video encryption algorithms are given. It can be seen that the face reconstructed from the encrypted face of the present invention is completely different from the original face, and even becomes a female. This shows that the present invention can effectively resist the face privacy reconstruction attack based on deep learning.

[0166] As can be seen from the above, the present invention is a lightweight encryption method for H.264 bitstream big data, with low computational complexity and high encryption efficiency, and can achieve real-time encryption even on high-definition video; in addition, the security performance of the present invention is far superior to other bitstream encryption methods, and can effectively resist new attacks based on deep learning; at the same time, it also retains the characteristics of the encryption compression domain to support video processing and analysis based on cloud-based privacy protection applications. The present invention has great application value in scenarios such as secure real-time video communication, privacy-protected cloud monitoring, and secure video big data cloud computing.

[0167] Exemplary Devices

[0168] like Figure 7As shown in , an embodiment of the present invention provides a real-time video encryption device for resisting deep learning face attacks, the device comprising:

[0169] The acquisition and parsing module 410 is used to acquire a video bitstream and parse macroblock syntax elements and their corresponding codewords in the video bitstream;

[0170] The XOR encryption module 420 is used to perform XOR encryption on the code word bits of the specified syntax element in the entire parsed video bit stream using the AES algorithm;

[0171] The position arrangement encryption module 430 is used to use the format compatible macroblock code stream order scrambling technology based on Knuth scrambling to positionally encrypt the I frame macroblock bit segment in the XOR encrypted video code stream;

[0172] The repackaging module 440 is used to repack the bit stream after positional permutation encryption, as described above in detail.

[0173] Based on the above embodiments, the present invention further provides an intelligent terminal, whose principle block diagram can be shown as follows: Figure 8 As shown. The intelligent terminal of an embodiment of the present invention may be an intelligent multimedia device, and the intelligent terminal includes a processor, a memory, a network interface, and a display screen connected through a system bus. Among them, the processor of the intelligent terminal is used to provide computing and control capabilities. The memory of the intelligent terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the intelligent terminal is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a real-time video encryption method for counteracting deep learning face attacks is implemented. The display screen of the intelligent terminal may be a liquid crystal display screen or an electronic ink display screen.

[0174] Those skilled in the art will understand that Figure 8 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the scheme of the present invention, and does not constitute a limitation on the smart terminal to which the scheme of the present invention is applied. The specific smart terminal may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0175] In one embodiment, a smart terminal is provided, comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, and the one or more programs include instructions for performing the following operations:

[0176] Obtain video bitstream and parse macroblock syntax elements and their corresponding codewords in the video bitstream;

[0177] Use the AES algorithm to perform XOR encryption on the codeword bits of the specified syntax elements in the entire parsed video bit stream;

[0178] Using the format-compatible macroblock stream order scrambling technology based on Knuth scrambling, the I-frame macroblock bit segments in the XOR-encrypted video stream are positionally arranged and encrypted;

[0179] Re-encapsulate the positionally encrypted bit stream.

[0180] The step of obtaining a video bitstream and parsing macroblock syntax elements and their corresponding codewords in the video bitstream further includes:

[0181] Obtain an H.264 video code stream, and decapsulate the obtained H.264 video code stream from an extended byte sequence payload EBSP into a data bit string SODB;

[0182] Parse the bit positions of macroblock-level syntax elements and their corresponding codewords in the data bit string SODB.

[0183] The specified syntax element in the step of using the AES algorithm to XOR-encrypt the codeword bits of the specified syntax element in the entire parsed video bit stream includes the following variable parameters:

[0184] Intra_4x4_IPM: intra prediction mode for 4x4 blocks;

[0185] Intra_16x16_IPM: intra prediction mode for 16x16 blocks;

[0186] Chroma_IPM: intra prediction mode for chroma blocks;

[0187] MVD: motion vector difference;

[0188] ref_idx: reference frame number;

[0189] delta_QP: quantization parameter difference;

[0190] sign_of_T1s: the sign of the tailing coefficient;

[0191] level: residual coefficient amplitude;

[0192] run_before: The number of zeros before the non-zero coefficients.

[0193] The step of using the AES algorithm to XOR-encrypt the codeword bits of the specified syntax element in the entire parsed video bit stream includes:

[0194] Use the AES algorithm to generate a random binary sequence based on the key;

[0195] The last bit of the intra prediction mode codeword of the 16x16 block and the three bits of the intra prediction mode codeword of the 4x4 block are encrypted with a random sequence XOR; and when encrypting the intra prediction mode codeword of the 16x16 block of the P frame, encryption is performed only when the value of the macroblock type mb_type satisfies the following formula (1):

[0196] (mb_type-7)mod 4<2 formula (1)

[0197] Among them, mod is the remainder after dividing two values;

[0198] The last bit of the intra prediction mode codeword of the chroma block is encrypted with a random sequence XOR, and can only be encrypted when Chroma_IPM is equal to 1 or 2.

[0199] All suffix bits of the motion vector difference MVD codeword and the last bit of the reference frame number ref_idx codeword are encrypted using a random sequence XOR; assuming that λ is the maximum number of reference frames, the encryption of the reference frame number ref_idx must satisfy the following formula (2):

[0200]

[0201] in, Refers to the rounding down operation;

[0202] Use a random sequence to XOR-encrypt all suffix bits of the quantization parameter difference delta_QP codeword, all bits of the sign of the trailing coefficient sign_of_T1s codeword, all suffix bits of the residual coefficient amplitude level codeword, and the last bit of the run_before codeword, the number of zero values ​​between the last non-zero coefficient.

[0203] The step of using the format-compatible macroblock code stream order scrambling technology based on Knuth scrambling to positionally encrypt the I-frame macroblock bit segments in the XOR-encrypted video code stream includes:

[0204] Parse VLC table types for all 4x4_DCT blocks;

[0205] Based on the random numbers generated by AES, the Knuth scrambling algorithm is used to generate a random macroblock address sequence;

[0206] Take a macroblock MB in random macroblock address order i ; In macroblock MB i Find any macroblock MB around j , if the macroblock MB iand MB j After the I frame position is swapped, the VLC table called by each 4x4_DCT block in the I frame remains unchanged, so the macroblock MB i and MB j The bit segment positions of the macroblock MB are exchanged, and the exchanged displacement vector ΔS is embedded into the SEI message; if the macroblock MB i and MB j After the I frame position is swapped, the VLC table called by each 4x4_DCT block in the I frame changes, and then continue to look for another macroblock MB j with MB i Swap until a macroblock or MB that meets the swap conditions is found i Until all the surrounding macroblocks have been traversed;

[0207] Take another macroblock A in random macroblock address order and repeat the above steps until all macroblocks in the I frame are processed;

[0208] The SEI message is encrypted using the AES algorithm.

[0209] The step of repackaging the positionally encrypted bit stream specifically includes:

[0210] The encrypted data bit string SODB is encapsulated into an H.264 code stream in the form of an extended byte sequence payload EBSP.

[0211] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0212] In summary, the present invention discloses a real-time video encryption method, device, intelligent terminal and storage medium for resisting deep learning face attacks. The present invention provides a real-time video encryption method for resisting deep learning face attacks. The present invention is a lightweight encryption method for H.264 code stream big data, with low computational complexity and high encryption efficiency, and can achieve real-time encryption even on high-definition video; in addition, the security performance of the present invention is far superior to other code stream encryption methods, and can effectively resist new attacks based on deep learning; at the same time, it also retains the encryption compression domain features to support video processing and analysis based on cloud-based privacy protection applications. The present invention has great application value in scenarios such as secure real-time video communication, privacy-protected cloud monitoring, and secure video big data cloud computing.

[0213] The present invention encrypts the video data so that it can decode the wrong pixel content, and uses inter-frame prediction and frame difference prediction to propagate the error to other areas and other frames, thereby achieving the purpose of protecting the entire video content. The present invention combines codeword encryption of more syntax elements, not only considering the value encryption of the code stream bit, but also considering its position encryption, which significantly increases the encryption space and further improves security.

[0214] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A real-time video encryption method against deep learning face attacks, characterized in that: The method comprises: Obtain video bitstream and parse macroblock syntax elements and their corresponding codewords in the video bitstream; Use the AES algorithm to perform XOR encryption on the codeword bits of the specified syntax elements in the entire parsed video bit stream; Using the format-compatible macroblock stream order scrambling technology based on Knuth scrambling, the I-frame macroblock bit segments in the XOR-encrypted video stream are positionally arranged and encrypted; Repackaging the bit stream after positional arrangement encryption; The step of obtaining a video code stream and parsing macroblock syntax elements and their corresponding code words in the video code stream also includes: Obtain an H.264 video code stream, and decapsulate the obtained H.264 video code stream from an extended byte sequence payload EBSP into a data bit string SODB; Parsing the bit positions of macroblock-level syntax elements and their corresponding codewords in the data bit string SODB; The step of using the AES algorithm to XOR encrypt the codeword bits of the specified syntax element in the entire parsed video bit stream includes: Use the AES algorithm to generate a random binary sequence based on the key; The last bit of the intra prediction mode codeword of the 16x16 block and the three bits of the intra prediction mode codeword of the 4x4 block are encrypted by using a random sequence XOR; and when encrypting the intra prediction mode codeword of the 16x16 block of the P frame, encryption is performed only when the value of the macroblock type mb_type satisfies the following formula (1): (mb_type-7) mod 4<2 formula (1) Among them, mod is the remainder after dividing two values; Encrypt the last bit of the intra prediction mode codeword of the chroma block with a random sequence XOR, and only encrypt it when Chroma_IPM is equal to 1 or 2; All suffix bits of the motion vector difference MVD codeword and the last bit of the reference frame number ref_idx codeword are encrypted using a random sequence XOR; assuming that λ is the maximum number of reference frames, the encryption of the reference frame number ref_idx must satisfy the following formula (2): in, Refers to the rounding down operation; Use a random sequence to XOR-encrypt all suffix bits of the quantization parameter difference delta_QP codeword, all bits of the sign of the trailing coefficient sign_of_T1s codeword, all suffix bits of the residual coefficient amplitude level codeword, and the last bit of the zero value run_before codeword between the last non-zero coefficient; The step of using the format-compatible macroblock code stream order scrambling technology based on Knuth scrambling to positionally encrypt the I frame macroblock bit segments in the XOR-encrypted video code stream includes: Parse VLC table types for all 4x4_DCT blocks; Based on the random numbers generated by AES, the Knuth scrambling algorithm is used to generate a random macroblock address sequence; Take a macroblock MBi in random macroblock address order; randomly search for a macroblock MBj around the macroblock MBi. If the VLC table called by each 4x4_DCT block in the I frame remains unchanged after the I frame positions of the macroblocks MBi and MBj are exchanged, then the bit segment positions of the macroblocks MBi and MBj are exchanged, and the exchanged displacement vector ΔS is embedded in the SEI message; if the VLC table called by each 4x4_DCT block in the I frame changes after the I frame positions of the macroblocks MBi and MBj are exchanged, then continue to search for another macroblock MBj to exchange with MBi until a macroblock that meets the exchange conditions is found or the surrounding macroblocks of MBi have been traversed; Take another macroblock A in random macroblock address order and repeat the above steps until all macroblocks in the I frame are processed; The SEI message is encrypted using the AES algorithm.

2. The real-time video encryption method for resisting deep learning face attacks according to claim 1 is characterized in that: The specified syntax element in the step of using the AES algorithm to XOR-encrypt the codeword bits of the specified syntax element in the entire parsed video bit stream includes the following variable parameters: Intra_4x4_IPM: intra prediction mode for 4x4 blocks; Intra_16x16_IPM: intra prediction mode for 16x16 blocks; Chroma_IPM: intra prediction mode for chroma blocks; MVD: motion vector difference; ref_idx: reference frame number; delta_QP: quantization parameter difference; sign_of_T1s: the sign of the tailing coefficient; level: residual coefficient amplitude; run_before: The number of zeros between non-zero coefficients.

3. The real-time video encryption method for resisting deep learning face attacks according to claim 1 is characterized in that: The step of repackaging the positionally encrypted bit stream specifically comprises: The encrypted data bit string SODB is encapsulated into an H.264 code stream in the form of an extended byte sequence payload EBSP.

4. A real-time video encryption device for resisting deep learning face attacks, characterized in that: The device comprises: The acquisition parsing module is used to acquire the video bitstream and parse the macroblock syntax elements and their corresponding codewords in the video bitstream; An XOR encryption module is used to XOR encrypt the codeword bits of the specified syntax elements in the entire parsed video bit stream using the AES algorithm; A position arrangement encryption module is used to use a format-compatible macroblock stream order scrambling technology based on Knuth scrambling to positionally encrypt the I-frame macroblock bit segments in the XOR-encrypted video stream; The repackaging module is used to repack the bit stream after positional permutation encryption. The step of obtaining a video code stream and parsing macroblock syntax elements and their corresponding code words in the video code stream also includes: Obtain an H.264 video code stream, and decapsulate the obtained H.264 video code stream from an extended byte sequence payload EBSP into a data bit string SODB; Parsing the bit positions of macroblock-level syntax elements and their corresponding codewords in the data bit string SODB; The step of using the AES algorithm to XOR encrypt the codeword bits of the specified syntax element in the entire parsed video bit stream includes: Use the AES algorithm to generate a random binary sequence based on the key; The last bit of the intra prediction mode codeword of the 16x16 block and the three bits of the intra prediction mode codeword of the 4x4 block are encrypted by using a random sequence XOR; and when encrypting the intra prediction mode codeword of the 16x16 block of the P frame, encryption is performed only when the value of the macroblock type mb_type satisfies the following formula (1): (mb_type-7) mod 4<2 formula (1) Among them, mod is the remainder after dividing two values; Encrypt the last bit of the intra prediction mode codeword of the chroma block with a random sequence XOR, and only encrypt it when Chroma_IPM is equal to 1 or 2; All suffix bits of the motion vector difference MVD codeword and the last bit of the reference frame number ref_idx codeword are encrypted using a random sequence XOR; assuming that λ is the maximum number of reference frames, the encryption of the reference frame number ref_idx must satisfy the following formula (2): in, Refers to the rounding down operation; Use a random sequence to XOR-encrypt all suffix bits of the quantization parameter difference delta_QP codeword, all bits of the sign of the trailing coefficient sign_of_T1s codeword, all suffix bits of the residual coefficient amplitude level codeword, and the last bit of the zero value run_before codeword between the last non-zero coefficient; The step of using the format-compatible macroblock code stream order scrambling technology based on Knuth scrambling to positionally encrypt the I frame macroblock bit segments in the XOR-encrypted video code stream includes: Parse VLC table types for all 4x4_DCT blocks; Based on the random numbers generated by AES, the Knuth scrambling algorithm is used to generate a random macroblock address sequence; Take a macroblock MBi in random macroblock address order; randomly search for a macroblock MBj around the macroblock MBi. If the VLC table called by each 4x4_DCT block in the I frame remains unchanged after the I frame positions of the macroblocks MBi and MBj are exchanged, then the bit segment positions of the macroblocks MBi and MBj are exchanged, and the exchanged displacement vector ΔS is embedded in the SEI message; if the VLC table called by each 4x4_DCT block in the I frame changes after the I frame positions of the macroblocks MBi and MBj are exchanged, then continue to search for another macroblock MBj to exchange with MBi until a macroblock that meets the exchange conditions is found or the surrounding macroblocks of MBi have been traversed; Take another macroblock A in random macroblock address order and repeat the above steps until all macroblocks in the I frame are processed; The SEI message is encrypted using the AES algorithm.

5. An intelligent terminal, characterized in that: The device comprises a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, and the one or more programs include being used to execute the method according to any one of claims 1 to 3.

6. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method as claimed in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Method for encrypting video streaming information based on hyper-chaotic sequence

    CN102176759A

  • H.264 video perception encryption algorithm with controllable quality on basis of CABAC

    CN104301727A