Video protection method, device and equipment applied to IPC and readable storage medium

By using dynamically negotiated encryption keys and IDR frame-based NALU unit encryption methods in IPC devices, the problems of high computing power consumption and complex key management of traditional IPC devices are solved, improving the security of data transmission and simplifying the deployment architecture. .

CN118695032APending Publication Date: 2024-09-24SHENZHEN SDMC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410956988.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

Traditional IPC equipment has the problem of high computing power consumption during the data encryption and decryption process, and the key management is complex and there is a risk of leakage.

Method used

The method of dynamic negotiation of encryption keys is adopted, and encryption is performed based on the NALU unit of the IDR frame to avoid full data encryption. Key negotiation and encryption are performed through the session private key and public key to simplify key management.

Benefits of technology

It reduces the computing power consumption in the encryption and decryption process, simplifies key management, improves the security of data transmission and simplifies the deployment architecture.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118695032A
    Figure CN118695032A
Patent Text Reader

Abstract

The embodiment of the invention provides a video protection method and device applied to IPC, equipment and a computer readable storage medium. The method comprises the following steps: in response to a message which has been subjected to session public key encryption and is sent by an App client, decrypting the message through a session private key to obtain an encrypted secret key and a strategy; and encrypting a video requested to be played by the App client based on the encryption key and the strategy, and sending the encrypted video to the App client. In this way, the complexity of the deployment architecture is greatly simplified, and the leakage risk of the secret key is reduced; and meanwhile, the encryption of the total data is avoided, and the computing power consumption generated when the encryption / decryption end encrypts / decrypts the data is effectively reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the field of smart home, and more particularly to a video protection method, apparatus, device, and computer-readable storage medium applied to IPC. Background Art

[0002] With the popularization of the Internet and people's increasing attention to home security, the proportion of IPC (IP Camera) devices used in homes has become more and more common, and people's requirements for data security have also become higher and higher.

[0003] The traditional data protection method is to use AES128 / AES256 (Advanced Encryption Standard, AES) to fully encrypt data and use a centralized KMS (Key Management System, KMS) to manage encryption keys. Before encryption / decryption, the encryption end / decryption end needs to establish communication with the KMS to complete the exchange of encryption keys before encryption / decryption can be performed. Summary of the invention

[0004] According to an embodiment of the present application, a video protection scheme applied to IPC is provided, in which an encryption key is dynamically negotiated by an encryption end and a decryption end when a session is created, and the encryption method is based on the NALU (Network Abstract Layer Unit, NALU) unit granularity of an IDR (Instantaneous Decoding Refresh, IDR) frame, that is, part of the NALU units in the IDR frame are encrypted, thereby avoiding encryption of the full amount of data, thereby effectively reducing the computing power consumption generated by the encryption / decryption end when performing data encryption / decryption.

[0005] In a first aspect of the present application, a video protection method applied to IPC is provided. The method comprises:

[0006] In response to a message sent by the App client that has been encrypted with the session public key, the message is decrypted using the session private key to obtain the encryption key and policy;

[0007] Based on the encryption key and the policy, the video requested to be played by the App client is encrypted, and the encrypted video is sent to the App client.

[0008] Furthermore, the App client can encrypt the message using the session public key in the following manner:

[0009] Create the original message based on the preset encryption key and strategy;

[0010] Perform JSON encoding on the original message to obtain a first message;

[0011] Encrypt the first message using the created session public key to obtain a second message;

[0012] The second message is Base64 encoded to complete the encryption of the original message.

[0013] Furthermore, the original message includes an encryption key array, a key group number, an encryption method, an encryption key, an encryption initialization vector, an encryption interval, a session key and / or a session key initialization vector information.

[0014] Further, encrypting the video requested to be played by the App client based on the encryption key and the policy includes:

[0015] Read a frame of video data requested to be played by the App client from the buffer. If the data is an IDR frame, traverse the IDR frame to obtain a set of NALU units.

[0016] The NALU unit set is traversed and analyzed, and if the unit sequence number of the current NALU meets the preset requirements, the current NALU unit is encrypted by using the encryption key and strategy;

[0017] Repeat the above operation until all NALUs that meet the requirements in the NALU unit set are encrypted.

[0018] In a second aspect of the present application, a video protection device applied to IPC is provided. The device comprises:

[0019] A response module, used to respond to a message sent by the App client that has been encrypted with the session public key, decrypt the message using the session private key, and obtain an encryption key and a policy;

[0020] The encryption module is used to encrypt the video requested to be played by the App client based on the encryption key and policy, and send the encrypted video to the App client.

[0021] In a third aspect of the present application, an electronic device is provided, which includes a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the program, the method described above is implemented.

[0022] In a fourth aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method according to the first aspect of the present application is implemented.

[0023] The video protection method applied to IPC provided in the embodiment of the present application responds to a message sent by an App client that has been encrypted with a session public key, decrypts the message with a session private key, and obtains an encryption key and a policy; based on the encryption key and the policy, the video requested to be played by the App client is encrypted, and the encrypted video is sent to the App client, thereby avoiding encryption of the entire amount of data and effectively reducing the computing power consumption generated by the encryption / decryption end when encrypting / decrypting data.

[0024] It should be understood that the contents described in the Summary of the Invention are not intended to limit the key or important features of the embodiments of the present application, nor are they intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The above and other features, advantages and aspects of the embodiments of the present application will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:

[0026] Figure 1 A diagram of the system architecture involved in the method provided in the embodiments of the present application.

[0027] Figure 2 is a flow chart of a video protection method applied to IPC according to an embodiment of the present application;

[0028] Figure 3 Schematic diagram of RSA public key content according to an embodiment of the present application;

[0029] Figure 4 Schematic diagram of RSA private key content according to an embodiment of the present application;

[0030] Figure 5 Schematic diagram of NALU encryption processing according to an embodiment of the present application;

[0031] Figure 6 is a block diagram of a video protection device applied to IPC according to an embodiment of the present application;

[0032] Figure 7 It is a schematic diagram of the structure of a terminal device or a server suitable for implementing the embodiments of the present application. DETAILED DESCRIPTION

[0033] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0034] In addition, the term "and / or" in this article is only a description of the association relationship between the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0035] Figure 1 A schematic diagram of an exemplary operating environment in which the embodiments of the present disclosure can be implemented is shown. The operating environment includes a cloud platform, an App client, and an IPC device.

[0036] Among them, the cloud platform is used to bind IPC devices.

[0037] Specifically, the App provides the IPC device with network configuration information (specific methods include QR code, Bluetooth communication, LAN communication, etc.), and the IPC device starts to configure the network after obtaining the network configuration information. After the IPC device completes the network configuration, it generates a pair of session public keys and private keys (session public key and session private key), and then initiates a request to register and bind the device to the cloud platform, and carries the session public key. After receiving the device registration and binding request, the cloud platform verifies the device. If it is a legitimate device (pre-set), the device binding is completed. Otherwise, the device binding fails. After the App provides the IPC device with network configuration information, it starts to poll the cloud platform regularly. If the device is successfully bound, the cloud platform returns the session public key to the App.

[0038] App client and IPC device are used to negotiate secret keys and encrypt / decrypt content after device binding is completed.

[0039] Figure 2 A flowchart of a video protection method applied to IPC according to an embodiment of the present disclosure is shown.

[0040] The method comprises:

[0041] S210, in response to the message sent by the App client that has been encrypted with the session public key, decrypt the message using the session private key to obtain the encryption key and policy.

[0042] In some embodiments, the cloud platform can perform device binding in the following ways:

[0043] S2111. App connects to the cloud platform and requests a registration token from the cloud platform. After receiving the request, the cloud platform processes the request and returns the registration token.

[0044] S2112, the App obtains the Wi-Fi SSID and Wi-Fi password, and generates QR code data based on the Wi-Fi SSID, Wi-Fi password and registration token;

[0045] S2113. The IPC device reads the QR code data, parses the registration Token, WiFi SSID, and WiFi password information in the QR code, and configures the network according to the WiFi SSID and WiFi password.

[0046] S2114. After the network configuration is successful, the IPC device will initiate a device registration request to the cloud platform. Before initiating the request, the IPC device will generate a pair of session keys (RSA Public / Private Key). Both the public key and the private key are in PEM format. Figure 2 , Figure 3 .

[0047] Furthermore, the public key will be sent to the cloud platform when registering the device. After receiving the request, the cloud platform will authenticate the device. After the authentication is passed, the device is successfully registered. At the same time, the App will periodically query the cloud platform device registration status. When the device is successfully registered, the cloud platform will send the session public key to the App.

[0048] In some embodiments, when an App client requests a live broadcast from an IPC device, signaling interaction is first performed, including media negotiation and network negotiation. During the media negotiation process, the App client uses the session public key (RSAPublic Key) created by the IPC device to encrypt the dynamically generated key and encryption policy, and then encodes them with Base64 and sends them to the IPC device based on the Session Description Protocol (SDP). The IPC device uses the session private key (RSAPrivate Key) to decrypt them, obtains the negotiated key and policy, and then returns a response message for confirmation.

[0049] Specifically,

[0050] S2121. When the App client receives the device registration success message sent by the cloud platform, the App client establishes a connection with the signaling server, and the IPC device is connected to the signaling server at the same time. When the App client requests a live broadcast from the IPC device, the App client creates a key message (original message) according to the key message specification. The key message can be encoded in JSON format, for example:

[0051]

[0052]

[0053] Among them, content_key represents the encryption key array;

[0054] content_key.id indicates the key group ID;

[0055] content_key.method indicates the encryption method;

[0056] content_key.key represents the encryption key;

[0057] content_key.iv represents the encryption initialization vector;

[0058] nalu_interval indicates the encryption interval;

[0059] session_key represents the session key;

[0060] session_iv represents the session key initialization vector;

[0061] session_key and session_iv are used by the IPC device to encrypt and confirm the key group information in the response SDP.

[0062] Furthermore, the above original message is encoded in JSON as follows:

[0063]

[0064]

[0065] S2122. The App client uses the session public key (RSA Public Key) to encrypt the JSON string generated in the above step to obtain a second message, and then performs Base64 encoding on the second message to obtain a string S as follows:

[0066] WE / FpIUTxR28RgykSRhHbysrLD9Ws0O0fGWHDrg8 / D954DxQ1dtXt4mKEePshrk3A9umYSzTmyBbWUjpXoRr3BE Zlp3SloTih8H089 / qpr8R2HBfnx / DB2BQYkZPModPexMJoddKjvI0jMkk9EiiAuubWg8n9Gnk9rBKgLxDMyDaZR Tnk9SmLb5xQFl20DFt+HNcJ6Sd7R+dZwwjtwLdVnAoqYPpU7s83+u7kiBKYp pGvg / NZdYpy6awtTtLGHqQJEQNjUsm21VtbQFQEOECkjpDuoPotMtVuZQR RbfQWTPb6d1aob3pkninOgy7oiKWVB+wHq31zOy7Oqk9G9fYP7dBNMpKnaBlKp25zdfAh5T77eRsqPl+n9ZcaEi8vCLzSncKaUcyZ6u2tPqYg+gZyQSTNRJK Wtx170v9cL13viUFvuCGAmzckKTj5rihtJlEHUAbKeeB5 / HcKGAHrk+CHZQ9mzDoT / yZcTxHLTq4wEJKfcmU4LI9I7LnoNRc19OAzWUOLqAhB7oVIH6wd ZEbZIZrjc7wNX9mzN7pqTXGpWniVLcNMJHJ4ejrCrynO30NSLYHnEnybqT YjVmzd7AAtrBZE7rO8u2XK1VsTER+L5OmQS / 4OlpDnzK1CuVBfgo76yYwZ4qw4EXKCDhkE0PD1Rs7K1bJNwxPR2VpVFPKReY=.

[0067] S2123. The App client creates an Offer SDP and adds the key information generated in step S2122 in the format of k=base64:<encoded key>, as shown below, and then sends it to the signaling server:

[0068] v=0

[0069] o=-2397106153131073818 2 IN IP4 127.0.0.1

[0070] s=-

[0071] t=0 0

[0072] a=group:BUNDLE video

[0073] a=msid-semantic:WMSgLzQPGuagv3xXolwPiiGAULOwOLNItvl8LyS

[0074] m=video 9 UDP / TLS / RTP / SAVPF 96 97

[0075] c=IN IP4 0.0.0.0

[0076] a=rtcp:9 IN IP4 0.0.0.0

[0077] a=ice-ufrag:l5KU

[0078] a=ice-pwd:+Sxmm3PoJUERpeHYL0HW4 / T9

[0079] a=ice-options:trickle

[0080] a=fingerprint:sha-256

[0081] 7C:93:85:40:01:07:91:BE:DA:64:A0:37:7E:61:CB:9D:91:9B:44:F6:C9:AC:3B:37:1C:00:15:4C:5A:B5:67:74

[0082] a=setup:actpass

[0083] a=mid:video

[0084] a=sendrecv

[0085] a=rtcp-mux

[0086] a=rtcp-rsize

[0087] a=rtpmap:96 H264 / 90000

[0088] k=base64:WE / FpIUTxR28Rg......K1bJNwxPR2VpVFPKReY=

[0089] a=rtcp-fb:96 goog-remb

[0090] a=rtcp-fb:96 transport-cc

[0091] a=rtcp-fb:96ccm fir

[0092] a=rtcp-fb:96nack

[0093] a=rtcp-fb:96nack pli

[0094] a=rtpmap:97rtx / 90000

[0095] a=fmtp:97apt=96

[0096] a=ssrc-group:FID 2527104241.

[0098] S2124. After receiving the Offer SDP message sent by the App client, the signaling server forwards it to the IPC device. After receiving the Offer SDP message, the IPC device parses the secret key information, decodes it with Base64, decrypts it, and uses the session private key (RSA Private Key) to decrypt it to obtain the negotiated secret key information.

[0099] The IPC device selects the encryption key from the content_key array, uses session_key and session_iv to encrypt and Base64 encode, and sends it in the Answer SDP after encoding.

[0100] For example, if the encryption method confirmed by the IPC device is AES128, the key confirmation message is: {"content_key":{"id":1}}. The result obtained after encrypting and Base64 encoding the string using session_key is as follows:

[0101] U2FsdGVkX1+OSQEqVJLoaW / bAJfkCGpCr6jx15HiTXrBDN2W / euRmB / NUp7pwtYlMjWtVL4Vf9gQWJtApALkiw==

[0102] Furthermore, the IPC device will create an Answer SDP message and add the key confirmation information generated above to the Answer SDP. The final Answer SDP is as follows:

[0103] v=0

[0104] o=-5443219974135798586 2IN IP4 127.0.0.1

[0105] s=-

[0106] t=0 0

[0107] a=group:BUNDLE video

[0108] a=msid-semantic:WMS iZ7cB0hsFDRGgTIMNp6TajUK9dOoHi43HVsm=video 9UDP / TLS / RTP / SAVPF 96 97

[0109] c=IN IP4 0.0.0.0

[0110] a=rtcp:9 IN IP4 0.0.0.0

[0111] a=ice-ufrag:MUZf

[0112] a=ice-pwd:4QhikLcmGXnCfAzHDB++ZjM5

[0113] a=ice-options:trickle

[0114] a=fingerprint:sha-256

[0115] 2A:5A:B8:43:66:05:B3:6A:E9:46:36:DF:DF:20:11:6A:F6:11:EA:D9:4E:26:E3:CE:5A:3A:C6:8D:03:49:7B:DE

[0116] a=setup:active

[0117] a=mid:video

[0118] a=sendrecv

[0119] a=rtcp-mux

[0120] a=rtcp-rsize

[0121] a=rtpmap:96 H264 / 90000

[0122] k=base64:U2FsdGVkX1+OSQEqVJLoaW / bAJfkCGpCr6jx15HiTXrBDN2W / euRmB / NUp7pwtYlMjWtVL4Vf9gQWJtApALkiw==

[0123] a=rtcp-fb:96 goog-remb

[0124] a=rtcp-fb:96 transport-cc

[0125] a=rtcp-fb:96 ccm fir

[0126] a=rtcp-fb:96 nack

[0127] a=rtcp-fb:96 nack pli

[0128] a=rtpmap:97 rtx / 90000

[0129] a=fmtp:97 apt=96

[0130] a=ssrc-group:FID 3587783331

[0131] The IPC device sends the Answer SDP to the signaling server.

[0132] S2125. After receiving the Answer SDP message sent by the IPC device, the signaling server forwards it to the App client. After receiving the Answer SDP message, the App client uses session_key to decrypt the key confirmation information and obtain the negotiated key group number. At this point, the App client and the IPC device complete the key negotiation. The result of the current negotiation between the two parties is that the video stream is encrypted and decrypted using the key group numbered 1.

[0133] S220: Encrypt the video requested to be played by the App client based on the encryption key and the policy, and send the encrypted video to the App client.

[0134] In some embodiments, after completing media negotiation and network negotiation, a P2P channel can be established between the App and the IPC for the transmission of media data. The IPC device encrypts the video stream according to the negotiated encryption key and policy; the App uses the negotiated key and policy to decrypt and play.

[0135] The video encryption method used in the present disclosure is based on the NALU unit of the IDR frame. If it is a non-IDR frame, no encryption is performed; otherwise, the NALU unit is encrypted according to the encryption interval of nalu_interval.

[0136] After the P2P channel is established between the App and the IPC, the specific process of dynamic encryption on the IPC device side during outgoing traffic is as follows:

[0137] S2211. The processing thread on the IPC device side reads a frame of data from the ring buffer and determines whether the video frame is an IDR frame. If so, proceed to step S2212; otherwise, proceed to step S2213.

[0138] S2212, traverse the IDR frame, find all the NALU units in the frame, obtain a NALU unit set, traverse and analyze the NALU unit set, if the sequence number of the currently found NALU unit is k, and satisfies k% (nalu_interval) == 0, encrypt the NALU unit.

[0139] It should be noted that a NALU is composed of a NALU Header and a NALU Body. Encrypting a NALU unit actually means encrypting the NALU Body, and the NALU Header is not encrypted. Assuming that an IDR frame consists of 20 NALUs, and nalu_interval is equal to 10, the 10th NALU unit and the 20th NALU of the IDR frame will be encrypted. After encryption, refer to Figure 4 , then add it to the sending queue and go to step S2213.

[0140] S2213. The sending thread of the IPC device takes out the video frame from the sending queue and sends the data to the App client through the P2P channel.

[0141] S2214. After receiving the data, the App client determines whether the current frame is an IDR frame. If it is an IDR frame, it traverses all NALU units in the IDR frame, decrypts the encrypted NALU units according to the negotiated nalu_interval interval, and can randomly decode and render after decryption; if not, it directly decodes and renders the output according to the associated IDR frame.

[0142] According to the embodiments of the present disclosure, the following technical effects are achieved:

[0143] The App client and IPC device avoid centralized management of the keys by the KMS system by autonomously negotiating the keys, which greatly simplifies the complexity of the deployment architecture, reduces the risk of key leakage, and greatly improves the security of data transmission.

[0144] The data encryption method is based on the NALU (Network Abstract Layer Unit, NALU) unit of the IDR (Instantaneous Decoding Refresh, IDR) frame as the granularity, that is, by encrypting some NALU units in the IDR frame, the encryption of the full amount of data is avoided, thereby effectively reducing the computing power consumption generated by the encryption / decryption end when encrypting / decrypting data.

[0145] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.

[0146] The above is an introduction to the method embodiment. The following is a further explanation of the scheme described in this application through an apparatus embodiment.

[0147] Figure 6 A block diagram 600 of a video protection device applied to IPC according to an embodiment of the present application is shown. Figure 6 Shown include:

[0148] The response module 610 is used to respond to the message sent by the App client that has been encrypted with the session public key, decrypt the message using the session private key, and obtain the encryption key and policy;

[0149] The encryption module 620 is used to encrypt the video requested to be played by the App client based on the encryption key and policy, and send the encrypted video to the App client.

[0150] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0151] Figure 7 A schematic diagram of the structure of a terminal device or server suitable for implementing an embodiment of the present application is shown.

[0152] like Figure 7As shown, the terminal device or server includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 702 or the program loaded from the storage part 708 into the random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the terminal device or server are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0153] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.

[0154] In particular, according to an embodiment of the present application, the above method flow steps can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a machine-readable medium, and the computer program includes a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present application are executed.

[0155] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0156] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of the code, and the aforementioned module, program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0157] The units or modules involved in the embodiments described in the present application may be implemented by software or hardware. The units or modules described may also be arranged in a processor. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves.

[0158] As another aspect, the present application further provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable storage medium stores one or more programs, and when the above programs are used by one or more processors to execute the method described in the present application.

[0159] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of application involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the aforementioned application concept. For example, the above features are replaced with (but not limited to) technical features with similar functions applied in the present application.

Claims

1. A video protection method applied to IPC, characterized in that: include: In response to a message sent by the App client that has been encrypted with the session public key, the message is decrypted using the session private key to obtain the encryption key and policy; Based on the encryption key and the policy, the video requested to be played by the App client is encrypted, and the encrypted video is sent to the App client.

2. The method according to claim 1, characterized in that The App client can encrypt the message using the session public key in the following manner: Create the original message based on the preset encryption key and strategy; Perform JSON encoding on the original message to obtain a first message; Encrypt the first message using the created session public key to obtain a second message; The second message is Base64 encoded to complete the encryption of the original message.

3. The method according to claim 2, characterized in that The original message includes an encryption key array, a key group number, an encryption method, an encryption key, an encryption initialization vector, an encryption interval, a session key and / or session key initialization vector information.

4. The method according to claim 3, characterized in that The encrypting the video requested to be played by the App client based on the encryption key and the policy includes: Read a frame of video data requested to be played by the App client from the buffer. If the data is an IDR frame, traverse the IDR frame to obtain a set of NALU units. The NALU unit set is traversed and analyzed, and if the unit sequence number of the current NALU meets the preset requirements, the current NALU unit is encrypted by using the encryption key and strategy; Repeat the above operation until all NALUs that meet the requirements in the NALU unit set are encrypted.

5. A video protection device applied to IPC, characterized in that: include: A response module, used to respond to a message sent by the App client that has been encrypted with the session public key, decrypt the message using the session private key, and obtain an encryption key and a policy; The encryption module is used to encrypt the video requested to be played by the App client based on the encryption key and policy, and send the encrypted video to the App client.

6. The device according to claim 5, characterized in that The App client can encrypt the message using the session public key in the following manner: Create the original message based on the preset encryption key and strategy; Perform JSON encoding on the original message to obtain a first message; Encrypt the first message using the created session public key to obtain a second message; The second message is Base64 encoded to complete the encryption of the original message.

7. The device according to claim 6, characterized in that The original message includes an encryption key array, a key group number, an encryption method, an encryption key, an encryption initialization vector, an encryption interval, a session key and / or session key initialization vector information.

8. The device according to claim 7, characterized in that The encrypting the video requested to be played by the App client based on the encryption key and the policy includes: Read a frame of video data requested to be played by the App client from the buffer. If the data is an IDR frame, traverse the IDR frame to obtain a set of NALU units. The NALU unit set is traversed and analyzed, and if the unit sequence number of the current NALU meets the preset requirements, the current NALU unit is encrypted by using the encryption key and strategy; Repeat the above operation until all NALUs that meet the requirements in the NALU unit set are encrypted.

9. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 4 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.