Video encryption and key hiding method and device and computer readable storage medium

By encrypting the sensitive area at the video acquisition end, embedding the encryption key into the video frame and converting it into watermark information to be embedded in the audio data transmission, the problem of easy cracking of the video file key is solved, and high-security transmission of the video file is achieved.

CN120378692APending Publication Date: 2025-07-25NANNING FUGUI PRECISION IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410095103.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-23
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

In the prior art, the encryption key of the video file is easily cracked, resulting in the personal privacy information in the video being exposed to the network and insufficient security.

Method used

The sensitive area is detected at the video acquisition end, and the encryption key is generated using the timestamp of the video frame to encrypt the sensitive area, embed the encryption key into the video frame, and at the same time convert the embedded position information into watermark information and embed it in the audio data for transmission.

Benefits of technology

It improves the security of video file transmission, increases the difficulty of cracking, and protects sensitive information from being obtained by unauthorized receivers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120378692A_ABST
    Figure CN120378692A_ABST
Patent Text Reader

Abstract

A video encryption and secret key hiding method is executed in an electronic device and comprises the following steps: firstly, detecting whether an acquired video frame contains sensitive information or not, when detecting that the video frame contains the sensitive information, encrypting an area containing the sensitive information, and embedding an encryption secret key into the video frame; and meanwhile, the position information embedded with the secret key is transmitted after being embedded into the audio in a watermark manner. The invention further provides a device for implementing the method and a computer readable storage medium. The method can be used for encrypting the sensitive area of the video, and meanwhile, the encryption key is embedded into the video for transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field The present invention relates to the field of streaming media technology, and particularly to a method, device and computer-readable storage medium for video encryption and key hiding. Background Art With the wide application of audio-visual technology, home video surveillance has become normal, bringing convenience as well as concerns. Once the surveillance device is hacked, personal privacy in the video will be exposed on the network. The prior art proposes to use a key composed of randomly generated 128 binary numbers to encrypt a video file and store the key in the video file. The advantage is that the key is randomly generated, but the disadvantage is that the key is directly stored in the header part of the video and is easily cracked. Summary of the Invention In view of this, the purpose of the present invention is to provide a method, device and computer-readable storage medium for video encryption and key hiding, which can encrypt the video and hide the key in the video for transmission, with high cracking difficulty and ensure the security of video file transmission. An embodiment of the present invention provides a method for video encryption and key hiding, which is executed on an electronic device. The method includes: obtaining video frames in the collected video data; detecting whether the video frame is a sensitive video frame containing sensitive information; when detecting that the video frame is a sensitive video frame containing sensitive information, extracting the sensitive area containing the sensitive information; generating an encryption key according to the timestamp of the first video frame, and using the encryption key to encrypt the sensitive area; embedding the encryption key in the video frame and recording the embedding position information of the encryption key; and converting the embedding position information into watermark information and embedding the watermark information in the collected audio data. An embodiment of the present invention further provides a device for video encryption and key hiding, which is characterized by including a processor; and a memory for storing a computer program, which when executed by the processor, enables the processor to implement the method for video encryption and key hiding. An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, which is characterized in that when the computer program is executed by a processor, the method for video encryption and key hiding is implemented. Compared with the prior art, the method for video encryption and key hiding provided by the present invention can be used to encrypt sensitive areas at the audio-visual acquisition end and hide the encryption key in the video for transmission to protect sensitive videos. Brief Description of the Drawings Figure 1 It is a schematic diagram of a video encryption process according to an embodiment of the present invention. Figure 2A flowchart of a video encryption and key hiding method according to an embodiment of the present invention. Figure 3 A schematic diagram of an audio - video file decryption process according to an embodiment of the present invention. Figure 4 A block diagram of a device for video encryption and key hiding according to an embodiment of the present invention. Figure 5 A block diagram of a computer - readable storage medium for video encryption and key hiding according to an embodiment of the present invention. Description of main component symbols The following specific embodiments will further illustrate the present invention in conjunction with the above - mentioned drawings. Specific embodiments For the convenience of those skilled in the art of the present invention to understand and implement the present invention, the present invention will be further described in detail below in conjunction with the drawings and embodiments. It should be understood that the present invention provides many applicable inventive concepts, which can be implemented in various specific forms. Those skilled in the art of the present invention can utilize the details described in these embodiments or other embodiments and other available structural, logical, and electrical changes to implement the invention without departing from the spirit and scope of the present invention. The specification of the present invention provides different embodiments to illustrate the technical features of different embodiments of the present invention. Among them, the configuration of each component in the embodiment is for illustrative purposes and is not intended to limit the present invention. And the partial repetition of the figure reference numerals in the embodiments is for the purpose of simplifying the description and does not mean the relevance between different embodiments. Among them, the same component numbers used in the figures and the specification represent the same or similar components. The figures in this specification are in a simplified form and are not drawn to an exact scale. Furthermore, in describing some embodiments of the present invention, the specification describes the method and / or program of the present invention in a specific step sequence. However, since the method and program are not necessarily implemented according to the specific step sequence described, they are not limited to the specific step sequence described. Those skilled in the art of the present invention know that other sequences are also possible embodiments. Therefore, the specific step sequence described in the specification is not used to limit the scope of the patent application. Furthermore, the scope of the patent application of the present invention for the method and / or program is not limited to the execution step sequence written, and those skilled in the art of the present invention can understand that adjusting the execution step sequence does not depart from the spirit and scope of the present invention. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terms used in the description of the present invention herein are for the purpose of describing specific embodiments only and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items. The following describes in detail some embodiments of the present invention in conjunction with the accompanying drawings. Please refer to Figure 1 , which shows a schematic diagram of the video encryption process according to an embodiment of the present invention. This video encryption can be applied to electronic devices such as mobile phones, tablet computers, desktop computers, and servers. The electronic device includes a video capture device for capturing video data and an audio capture device for capturing audio data. It can be understood that in different embodiments, the electronic device can be presented in different product forms. In one embodiment, the video capture device and the audio capture device can be integrated into the electronic device. In different embodiments, the video capture device and the audio capture device can be independent of the electronic device and communicate with the video electronic device in a wired or wireless manner. Blocks 101 and 102 respectively collect video data and audio data via the video capture device and the audio capture device. Among them, the video data includes multiple video frames, and the audio data includes multiple audio frames. The video frames and audio frames use the same clock source, which can be used for audio-visual synchronization operations. Block 103 uses the timestamp of the video frame as a random seed to calculate and generate an encryption key, and uses the key to encrypt the sensitive area of the video frame, and at the same time embeds the encryption key into the video frame. Among them, the sensitive area is the area containing moving objects. After encrypting the video frame, the encryption key embedding information is converted into a binary bit rate as the watermark information. Block 104 embeds the watermark information into the audio data. Blocks 105 and 106 respectively perform encoding processing on the video frame queue and the audio frame queue. Block 107 encapsulates the encoded video packet queue and audio packet queue according to the default rules to generate an audio-visual file for transmission. The electronic device can transmit the video file to the receiving end via the network. After receiving the video file, the receiving end completes demultiplexing and decoding, extracts the watermark information to obtain the original audio frame, and obtains the key embedding position information according to the watermark information to obtain the key, and decrypts the corresponding video frame to obtain the original video frame. Please refer to Figure 2 , which shows a flowchart of the video encryption method according to an embodiment of the present invention. This method is an implementation manner of Blocks 103 and 104. The following describes each step in the method flow. Step S201, obtain video frames in the collected audio - video data. Step S202, detect whether the video frame is a sensitive video frame containing sensitive information. If so, continue to execute Step S203. Step S203, extract the sensitive area where the sensitive information is located from the video frame. Specifically, the sensitive information is a moving object. In one example, the moving object includes a human body. In one embodiment, the three - frame difference method is used to detect and identify sensitive information in the video frame, and the sensitive area is extracted according to the position and contour of the sensitive information in the video frame. Specifically, using the three - frame difference method, the video frame is differentiated from the adjacent front and rear frames respectively, and then the individual differentiation results are AND - calculated to obtain the position and contour of the moving object in the video frame. Based on obtaining the contour of the moving object through frame - to - frame difference, morphological erosion operation is performed on the differentiated binary image to eliminate small noises in the image; then dilation operation is performed to fill the cracks and holes in the contour of the moving object. According to the contour of the moving object, four positions, namely the highest point position, the lowest point position, the left - most point position, and the right - most point position in the contour are obtained, and a regular rectangular area is extracted according to these four positions, which is the sensitive area. In another embodiment, the background difference method can also be used to detect sensitive video frames. Specifically, take the previous frame as the background picture, and judge whether there is a contour of a moving object in the difference image obtained by differentiating the previous frame and the video frame. If so, judge that the video frame is a sensitive video frame. If not, further judge whether the previous frame is a sensitive video frame. If so, compare the similarity between the video frame and the previous frame. When the similarity between the video frame and the previous frame is greater than a preset threshold, mark the video frame as a sensitive video frame, and the sensitive area is set to be the same as the sensitive area of the previous frame. Step S204, generate an encryption key according to the timestamp of the video frame to encrypt the sensitive area, and embed the encryption key into the same video frame or another video frame. In one embodiment, a globally unique identifier (GUID) can be generated according to the timestamp of the video frame, the device serial number and MAC address of the pre - registered receiving end, and the encryption key is composed of the globally unique identifier and a random code. In one embodiment, before embedding the encryption key into the video frame, the encryption key can also be converted into a QR - code image and segmented, and the segmented sub - QR - code images are embedded into the video frame. For example, GUID = b6915568-bbc7-8fcb-b69b-9e1e8d4793f4, the random code is 104C11 DB7, and the complete encrypted key after combination is b6915568bbc78fcbb69b9e1e8d4793f4104C11 DB7. Convert the complete encrypted key into a QR code image. Taking the minimum pixel size of the QR code image, 21×21, as an example, the size is 441 ppi, with a total of 3528 bits (441×8). When divided into 6 equal parts, each part is 588 bits. Taking the common video resolution 1080P60 as an example, there are 60 frames per second, and the number of pixels per frame is 1920×1080 = 2073600, with a total of 16588800 bits (2073600×8). The embedding rate of each equal part in the video frame is only 3.544560185185185e-5 (588 / 16588800). The advantages of encoding the encrypted key into a QR code are, in addition to the relatively high data security of the QR code, secondly, the QR code image has an error correction function. Even if part of the QR code image is missing during transmission, the receiving end can ultimately recognize the complete data and obtain a reliable encrypted key. In one embodiment, an area outside the sensitive area in the video frame is selected as the embedding area for the encrypted key. In different embodiments, a non-sensitive video frame can also be selected as the embedding video frame for the encrypted key. Specifically, the embedding area of the encrypted key in the video is selected according to the sensitivity of the human eye to brightness and chrominance. Research shows that the human eye is less sensitive to colors with high saturation. High saturation means pure colors, such as red, black, or white. Therefore, the video frame to be embedded is converted from the RGB color space to the HSV color space to obtain information such as hue H, saturation S, and value V. The video frame image to be embedded is binarized according to the hue information, and the contour is calculated after morphological erosion of the binarized image to obtain the embedding area where the encrypted key can be embedded. In one embodiment, after selecting the embedding area of the encrypted key, the pixel values of the embedding area are converted into binary, and the encrypted key is embedded into the least significant bit of the pixel values of the embedding area through the LSB (Least Significant Bit) algorithm. Since the human eye cannot recognize the chromaticity difference caused by changing the least significant bit pixel value, the encrypted key can be well hidden. After the encrypted key is embedded in the video frame, the embedding position information of the encrypted key is recorded at the same time. For example, after encoding the encrypted key into a QR code and dividing it into four encrypted key segments and embedding them into the video frame numbered U, the embedding position information of the encrypted key can be obtained as A(X1, Y1), B(X2, Y2), C(X3, Y3), D(X4, Y4) and the frame number U. Step S205: Convert the embedding position information of the encryption key into a binary bit sequence as watermark information. After scrambling the watermark information, embed it into the audio data. In one embodiment, an audio information hiding algorithm in the Discrete Cosine Transform (DCT) domain is used to embed the watermark information. Specifically, perform a discrete cosine transform on the audio sampling points of the audio frame, and adaptively quantize and embed the watermark information into the mid-low frequency coefficients of the discrete cosine transform. Then perform an inverse transform on the discrete cosine transform coefficients after each adaptive quantization and embedding of the watermark information to generate an audio signal containing the watermark information. Please refer to Figure 3 , which shows a flowchart of the decryption process at the receiving end after receiving a video file according to an embodiment of the present invention. Block 301: Decode the video into multiple video frames. Block 302: Extract the watermark information after audio decoding and obtain the embedding position information of the encryption key. Decision box 303: According to the embedding position information of the encryption key, determine whether the current video frame is a video frame with an encryption key. When it is determined that the current video frame is a video frame with an encryption key, execute block 304; when it is determined that the current video frame is not a video frame with an encryption key, continue to execute decision box 305. Block 304: Use a reverse algorithm to extract the encryption key from the video frame with the encryption key according to the embedding position information of the encryption key obtained in block 302. Decision box 305: Determine whether the current video frame is an encrypted sensitive video frame. When it is determined that the current video frame is an encrypted sensitive video frame, execute block 306; when it is determined that the current video frame is not an encrypted sensitive video frame, execute block 307. Block 306: Decrypt and restore the sensitive video frame according to the encryption key obtained in block 304. Block 307: Restore the decoded audio and video data into a simulation signal and output it to an output device. In one example, the output device is a display and a speaker. Please refer to Figure 4 , which shows a block diagram of a device 400 for video encryption and key hiding according to an embodiment of the present invention. The device 400 includes a processor 402, a memory 404, and a computer program 406. The device 400 is an electronic device. Those skilled in the art should understand that Figure 4 The composition of the shown device 400 does not constitute a limitation on the embodiments of the present invention. Figure 4 The shown device 400 is simplified for ease of description. In different embodiments, it may include fewer or more components than shown. In one embodiment, the processor 402 may be composed of an integrated circuit. For example, it may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 402 is the control core (Control Unit) of the device 400, connecting various components of the entire device 400 through various interfaces and lines. By running or executing the computer program 406 or module stored in the memory 404, and by calling the data stored in the memory 404, it executes various functions of the device 400 and processes data, such as video encryption and key hiding methods.

[0039] In one embodiment, the memory 404 is used to store the code of the computer program 406 and various data, such as the target image capture method, and realizes high-speed and automatic access to programs or data during the operation of the device 400. The memory 404 includes read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM), or other optical disc memories, magnetic disk memories, tape memories, or any other computer-readable storage medium capable of carrying or storing data.

[0040] Please refer to Figure 5 , which shows a block diagram of a computer-readable storage medium 500 for video encryption and key hiding in an embodiment of the present invention. As Figure 4 shown, the computer-readable storage medium 500 stores a computer program 502, which, when executed by a processor, implements a video encryption and key hiding method. In summary, the method and device for video encryption and key hiding of the present invention encrypt sensitive areas at the audio-visual acquisition end and hide the encryption key in the video for transmission. The receiving party cannot restore the sensitive video frames containing sensitive areas without a reversible algorithm, which well protects the information to be hidden. It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A video encryption and key hiding method, which is executed on an electronic device, characterized in that, The method includes: Obtain video frames from the collected video data; Detect whether the video frame is a sensitive video frame containing sensitive information; When it is detected that the video frame is a sensitive video frame containing sensitive information, extract the sensitive area containing the sensitive information; Generate an encryption key according to the timestamp of the first video frame, and use the encryption key to encrypt the sensitive area; Embed the encryption key into the video frame, and record the embedding position information of the encryption key: and Convert the embedding position information into watermark information, and embed the watermark information into the collected audio data.

2. The video encryption and key hiding method according to claim 1, wherein The sensitive information is a moving object.

3. The video encryption and key hiding method according to claim 2, wherein The moving object is a human body.

4. The video encryption and key hiding method according to claim 2, characterized in that, Detecting whether the video frame is a sensitive video frame containing sensitive information further includes: Use the three-frame difference method to detect and identify the sensitive information in the video frame.

5. The video encryption and key hiding method according to claim 2, characterized in that, The method further includes: According to the contour of the moving object, obtain four position points including the highest point position, the lowest point position, the leftmost point position, and the rightmost point position in the contour; Extract a rectangular area from the video frame as the sensitive area according to the four position points.

6. The video encryption and key hiding method according to claim 1, characterized in that, Generating the encryption key according to the timestamp of the first video frame further includes: Generate a globally unique identifier according to the timestamp of the video frame, the device serial number and MAC address of the pre-registered receiver; and. Form the encryption key by combining the globally unique identifier and a random code.

7. The video encryption and key hiding method according to claim 1, characterized in that, Embedding the encryption key into the video frame further includes: Convert the encryption key into a two-dimensional code image and segment it; and Embed each sub-two-dimensional code image after segmentation into the video frame.

8. The video encryption and key hiding method according to claim 1, wherein Embedding the encryption key into the video frame further includes: Select an area outside the sensitive area as the embedding area of the encryption key.

9. A device for video encryption and key hiding, characterized in that, Include A processor; and A memory for storing a computer program, which when executed by the processor, causes the processor to implement the video encryption and key hiding method according to any one of claims 1-8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the video encryption and key hiding method according to any one of claims 1-8.