Video encryption transmission method and related device
By encrypting and transmitting the playback address information and video stream data during the video cloud, the problem of low security when transmitting video data in complex network environments is solved, and the dual protection of address and video content is achieved, improving the Transmission security.
Patent Information
- Application Number
- CN202411437699.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-10-15
AI Technical Summary
During the process of video on the cloud, video data is easily leaked when transmitted in complex network environments, resulting in low security problems.
By realizing the encrypted transmission of playback address information between the playback device and the video network service platform, and implementing the encrypted transmission of video stream data between the playback device and the streaming media server, the plaintext key encryption and decryption process is used to generate and use the second One encrypted message and the second encrypted message ensure the security of address and video streaming data.
It reduces the risk of leakage of playback address information and video streaming data, improves the security of the video transmission process, and prevents data theft and leakage.
Smart Images

Figure CN119094819A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of streaming media transmission, and in particular to a video encryption transmission method and related devices. Background Art
[0002] With the development of security monitoring technology and the promotion of visual networking, the scale of video monitoring systems has continued to increase, and the amount of video stream data has seen a huge increase. Therefore, video cloud storage has become one of the main ways to store video data. When using cloud servers to store video data, users need to upload and read video data in a complex network environment, which is prone to security risks caused by data leakage during video transmission, and there is a problem of low security. Summary of the invention
[0003] The purpose of this application is to solve at least one of the above-mentioned technical defects, especially the technical defect of low security in the prior art.
[0004] In a first aspect, an embodiment of the present application provides a video encryption transmission method, which is applied to a playback device, and the method includes:
[0005] In response to a video playback instruction, a plaintext key is generated, and an address acquisition request is generated;
[0006] Sending the address acquisition request to the visual networking service platform, and receiving a first encrypted message returned by the visual networking service platform in response to the address acquisition request; wherein the first encrypted message includes first encryption information and address encryption data, and the address encryption data is obtained by encrypting the playback address information according to the first encryption information;
[0007] Decrypting the address encrypted data according to the first encryption information to obtain the playback address information;
[0008] Sending a play request carrying a first ciphertext key to a streaming media server according to the play address information; wherein the first ciphertext key is obtained by encrypting the plaintext key;
[0009] Receiving a second encrypted message returned by the streaming media server in response to the play request; wherein the second encrypted message includes video encryption data, and the video encryption data is obtained by encrypting the video stream data according to the plaintext key;
[0010] The video encrypted data is decrypted based on the plaintext key to obtain the video stream data.
[0011] In one embodiment, generating an address acquisition request includes:
[0012] Encrypting the plaintext key to obtain a second ciphertext key;
[0013] Generate the address acquisition request carrying the second ciphertext key;
[0014] Among them, the address acquisition request is used to instruct the visual network service platform to decrypt the second ciphertext key, obtain the plaintext key, and re-encrypt the plaintext key to obtain the first ciphertext key, and encrypt the first ciphertext key and the playback address information according to the first encryption information to obtain the first encrypted message.
[0015] In one embodiment, sending a playback request carrying a first ciphertext key to a streaming media server according to the playback address information includes:
[0016] Parsing the playback address information and obtaining streaming media connection verification information;
[0017] Establishing an SRT connection between the playback device and the streaming media server according to the streaming media connection verification information;
[0018] generating the playback request carrying the first ciphertext key;
[0019] Based on the SRT connection, the playback request is sent to the streaming media server.
[0020] In one of the embodiments, the second encrypted message further includes second encryption information, and the video encryption data is obtained by encrypting the video stream data according to the second encryption information and the plaintext key;
[0021] The decrypting the video encrypted data based on the plaintext key to obtain the video stream data includes:
[0022] The video encrypted data is decrypted according to the second encryption information and the plaintext key to obtain the video stream data.
[0023] In a second aspect, an embodiment of the present application provides a video encryption transmission method, which is applied to a visual network service platform, and the method includes:
[0024] In response to the address acquisition request sent by the playback device, generate a decryption key;
[0025] Extracting a second ciphertext key from the address acquisition request; wherein the second ciphertext key is obtained by encrypting the plaintext key by the playback device;
[0026] Decrypting the second ciphertext key according to the decryption key to obtain the plaintext key;
[0027] Encrypting the plaintext key according to a preset key encryption algorithm to obtain a first ciphertext key;
[0028] respectively determining the playback address information corresponding to the address acquisition request, and assembling and splicing the playback address information with the first ciphertext key to obtain spliced data;
[0029] Determine a first encryption algorithm, and use the first encryption algorithm to encrypt the spliced data to obtain address encrypted data;
[0030] Determine first encryption information corresponding to the first encryption algorithm, and generate a first encrypted message according to the first encryption information and the address encryption data;
[0031] Return the first encrypted message to the playback device.
[0032] In one embodiment, the method further comprises:
[0033] Receiving a key query request sent by a streaming media server in response to a play request; wherein the play request is sent by the play device and carries a target first key;
[0034] Extracting the target first key from the key query request;
[0035] Performing a query according to the target first key and determining a target plaintext key corresponding to the target first key;
[0036] The target plaintext key is returned to the streaming media server.
[0037] In a third aspect, an embodiment of the present application provides a video encryption transmission device, which is applied to a playback device, and the device includes:
[0038] An address acquisition request generation module, used to generate a plaintext key and an address acquisition request in response to a video playback instruction;
[0039] An address acquisition module, used to send the address acquisition request to the visual network service platform, and receive a first encrypted message returned by the visual network service platform in response to the address acquisition request; wherein the first encrypted message includes first encryption information and address encryption data, and the address encryption data is obtained by encrypting the playback address information according to the first encryption information;
[0040] A first decryption module, used for decrypting the address encrypted data according to the first encryption information to obtain the playback address information;
[0041] a play request sending module, configured to send a play request carrying a first ciphertext key to a streaming media server according to the play address information; wherein the first ciphertext key is obtained by encrypting the plaintext key;
[0042] A second encrypted message acquisition module is used to receive a second encrypted message returned by the streaming media server in response to the play request; wherein the second encrypted message includes video encryption data, and the video encryption data is obtained by encrypting the video stream data according to the plaintext key;
[0043] The video stream data acquisition module is used to decrypt the video encryption data based on the plaintext key to obtain the video stream data.
[0044] In a fourth aspect, an embodiment of the present application provides a video encryption transmission device, which is applied to a visual network service platform, and the device includes:
[0045] A decryption key generation module, used to generate a decryption key in response to an address acquisition request sent by a playback device;
[0046] A second ciphertext key extraction module, used to extract a second ciphertext key from the address acquisition request; wherein the second ciphertext key is obtained by encrypting the plaintext key by the playback device;
[0047] A second decryption module, used to decrypt the second ciphertext key according to the decryption key to obtain the plaintext key;
[0048] A key encryption module, used to encrypt the plaintext key according to a preset key encryption algorithm to obtain a first ciphertext key;
[0049] An assembling and splicing module, used to respectively determine the playback address information corresponding to the address acquisition request, and assemble and splice the playback address information with the first ciphertext key to obtain spliced data;
[0050] An address encryption module, used to determine a first encryption algorithm, and use the first encryption algorithm to encrypt the spliced data to obtain address encrypted data;
[0051] A first encrypted message generating module, used to determine first encrypted information corresponding to the first encryption algorithm, and generate a first encrypted message according to the first encrypted information and the address encrypted data;
[0052] The first encrypted message returning module is used to return the first encrypted message to the playback device.
[0053] In a fifth aspect, an embodiment of the present application provides a playback device, including: one or more processors, and a memory;
[0054] The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the video encryption transmission method applied to a playback device described in any of the above embodiments are executed.
[0055] In a sixth aspect, an embodiment of the present application provides a visual networking service platform, including: one or more processors, and a memory;
[0056] The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the video encryption transmission method applied to the visual network service platform described in any of the above embodiments are executed.
[0057] In the video encryption transmission method and related devices provided in some embodiments of the present application, the encrypted transmission of the playback address information can be achieved between the playback device and the visual network service platform through the first encrypted message to reduce the risk of leakage of the playback address information. At the same time, the encrypted transmission of video stream data can be achieved between the playback device and the streaming media server through the second encrypted message to reduce the risk of theft of the video stream data. In this way, by encrypting the transmission of both the playback address information and the video stream data, the risk of address leakage can be reduced, and the risk of theft of the video content can be reduced, thereby improving the security of the video transmission process. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0059] Figure 1 A diagram of an application environment of a video encryption transmission method in one embodiment;
[0060] Figure 2 One of the flowcharts of the video encryption transmission method applied to a playback device in one embodiment;
[0061] Figure 3 This is a second flow chart of a video encryption transmission method applied to a visual networking service platform in an embodiment;
[0062] Figure 4 This is a third flow chart of a method for video encryption transmission in one embodiment;
[0063] Figure 5 This is a fourth flow chart of a method for video encryption transmission in one embodiment;
[0064] Figure 6 A schematic diagram of the structure of a video encryption transmission device applied to a playback device in one embodiment;
[0065] Figure 7 The present invention is a schematic diagram of the structure of a video encryption transmission device applied to a visual network service platform in one embodiment. DETAILED DESCRIPTION
[0066] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0067] The terms involved in this application are explained below.
[0068] SRT (Secure Reliable Transport) protocol: an open source video transmission protocol designed to provide secure, reliable, low-latency, and high-bandwidth video streaming transmission.
[0069] AES (Advanced Encryption Standard) algorithm: A symmetric encryption algorithm that uses the same key for encryption and decryption.
[0070] SM4 algorithm: The city uses the national secret SM4 block cipher algorithm, which is a symmetric encryption algorithm.
[0071] CBC (Cipher-block chaining): An encryption mode in which each plaintext block is XORed with the previous ciphertext block before being encrypted, thus ensuring the uniqueness of each message.
[0072] ECB (Electronic Codebook): An encryption mode in which the information to be processed is divided into blocks of appropriate size and each block is encrypted independently.
[0073] CFB (Cipher FeedBack): An encryption mode. In CFB mode, the previous ciphertext block can be re-encrypted, and the re-encrypted ciphertext block is XORed with the plaintext block to obtain the current ciphertext block.
[0074] CTR (Counter): An encryption mode. In CTR mode, the key is used to encrypt the input counter, and then the counter encrypted data is XORed with the plaintext block to obtain the ciphertext block.
[0075] OFB (Output-FeedBack): an encryption mode.
[0076] NAL (Network Abstraction Layer): Part of the H.264 / AVC video coding standard.
[0077] In one embodiment, the video encryption transmission method provided by the present application can be applied to Figure 1 In the application environment shown. Among them, the playback device 102 refers to an electronic device used to play videos, which can be but is not limited to smart phones, tablet computers, desktop computers, laptops, wearable devices, Internet of Things devices, home appliances, etc. In one example, the playback device 102 can be installed with a visual network APP (application) and a player component, and the visual network APP can achieve video playback through the player component. The visual network business platform 104 refers to a business platform for managing the streaming media server 106 (i.e., video source information). The streaming media server 106 refers to a device for storing video stream data.
[0078] Specifically, the streaming media servers 106 corresponding to different video stream data may be different. When playing a video, the playback device 102 needs the designated streaming media server to initiate a playback request to obtain the video stream data of the video to be played from the designated streaming media server. Based on this, before sending a playback request, the playback device 102 needs to first determine the aforementioned "designated streaming media server". Since the visual networking service platform 104 manages the information of each video source, the playback device 102 can obtain the playback address information corresponding to the video to be played from the visual networking service platform 104, and determine the designated streaming media server 106 based on the playback address information, thereby achieving the acquisition of video stream data.
[0079] In one embodiment, the present application provides a video encryption transmission method, which is applied to Figure 1 The playback device shown. Figure 2 As shown, the video encryption transmission method provided by the present application may include the following steps:
[0080] S202: In response to the video playback instruction, generate a plaintext key and generate an address acquisition request.
[0081] The video playback instruction refers to an instruction for instructing the playback device to play the video stream to be played. The triggering condition of the instruction can be determined according to the actual situation, and this document does not impose specific restrictions on this. The plaintext key refers to the unencrypted key data. The address acquisition request is used to obtain the playback address information of the video stream to be played.
[0082] In this step, when the playback device receives the video playback instruction, it can generate a plaintext key and an address acquisition request corresponding to the video stream to be played. It is understandable that the playback device can generate the plaintext key in any way, and this application does not impose specific restrictions on this. For example, the plaintext key can be pre-set. For another example, the plaintext key can be generated according to a preset key generation algorithm.
[0083] In one example, in order to further improve the security of video data, the plaintext keys corresponding to every two video streams to be played may be different. For example, when the video stream to be played is the first video stream, the playback device can generate a first plaintext key, so that the playback device, the visual network service platform and the streaming media server implement encrypted transmission of the first video stream based on the first plaintext key. When the video stream to be played is the second video stream, the playback device can generate a second plaintext key, so that the playback device, the visual network service platform and the streaming media server implement encrypted transmission of the second video stream based on the second plaintext key. In this way, even if a plaintext key is stolen, the stolen plaintext key can only be used to obtain a certain video stream data, but cannot obtain other video stream data.
[0084] S204: Send an address acquisition request to the visual networking service platform, and receive a first encrypted message returned by the visual networking service platform in response to the address acquisition request.
[0085] The first encrypted message includes first encrypted information and address encrypted data, and the address encrypted data is obtained by encrypting the playback address information according to the first encrypted information.
[0086] In this step, the address acquisition request can be used to instruct the visual network service platform to determine the playback address information corresponding to the video stream to be played, encrypt the playback address information according to the first encryption information, obtain address encryption data, and generate a first encrypted message based on the address encryption data and the first encryption information, and return the first encrypted message to the playback device. The playback device can send an address acquisition request to the visual network service platform to obtain the first encrypted message corresponding to the video stream to be played from the visual network service platform.
[0087] S206: Decrypt the address encrypted data according to the first encryption information to obtain the playback address information.
[0088] In this step, the playback device can extract the first encryption information and the address encryption data from the first encrypted message, and decrypt the address encryption data according to the first encryption information to obtain the playback address information corresponding to the video stream to be played. The playback address information is plain text data.
[0089] S208: Sending a play request carrying the first ciphertext key to the streaming media server according to the play address information.
[0090] The first ciphertext key is obtained by encrypting the plaintext key. It should be noted that the encryption device corresponding to the first ciphertext key may be a playback device, or other platforms / devices other than the playback device. In other words, the first ciphertext key may be obtained by encrypting the plaintext key by the playback device. Alternatively, the first ciphertext key may be obtained by encrypting the plaintext key by other platforms / devices.
[0091] In this step, when the playback address information is obtained, the playback device can determine the streaming media server corresponding to the video stream to be played according to the playback address information. Therefore, the playback device can send a playback request to the streaming media server corresponding to the video stream to be played according to the playback address information, and the playback request carries the first ciphertext key.
[0092] S210: Receive a second encrypted message returned by the streaming media server in response to the play request.
[0093] The second encrypted message includes video encryption data, and the video encryption data is obtained by encrypting the video stream data according to the plaintext key.
[0094] In this step, the play request can be used to instruct the streaming media server to encrypt the video stream data corresponding to the video stream to be played according to the plaintext key to obtain video encryption data, generate a second encrypted message based on the video encryption data, and return the second encrypted message to the playback device. Therefore, after the playback device sends the play request to the streaming media server, it can receive the second encrypted message including the video encryption data returned by the streaming media server.
[0095] S212: Decrypt the video encrypted data based on the plaintext key to obtain video stream data.
[0096] In this step, since the video encryption data is obtained by encrypting the video stream data using a plaintext key by the streaming media server, the playback device can decrypt the acquired video encryption data based on the plaintext key to obtain the video stream data and play the video based on the video stream data.
[0097] In this application, the first encrypted message can be used to encrypt the transmission of the playback address information between the playback device and the visual network service platform to reduce the risk of leakage of the playback address information. At the same time, the second encrypted message can be used to encrypt the transmission of video stream data between the playback device and the streaming media server to reduce the risk of theft of the video stream data. In this way, by encrypting the transmission of both the playback address information and the video stream data, the risk of address leakage and the risk of video content being stolen can be reduced, thereby improving the security of the video transmission process.
[0098] In one embodiment, generating an address acquisition request includes:
[0099] Encrypting the plaintext key to obtain a second ciphertext key;
[0100] Generate an address acquisition request carrying the second ciphertext key.
[0101] Among them, the address acquisition request is used to instruct the visual network service platform to decrypt the second ciphertext key, obtain the plaintext key, and re-encrypt the plaintext key to obtain the first ciphertext key, and encrypt the first ciphertext key and playback address information according to the first encryption information to obtain the first encrypted message.
[0102] In this embodiment, considering that the visual networking service platform may use plaintext keys in scenarios such as address encryption and address query, the playback device can send the plaintext key to the visual networking service platform to facilitate subsequent processing by the visual networking service platform.
[0103] To reduce the risk of plaintext key leakage and to further improve the security of the video transmission process, the playback device can encrypt the plaintext key to obtain a second ciphertext key, and generate an address acquisition request based on the second ciphertext key, so that the address acquisition request carries the second ciphertext key.
[0104] When the visual network service platform receives the address acquisition request, it can decrypt the second ciphertext key carried in the address acquisition request to obtain the plaintext key. In addition, the visual network service platform can re-encrypt the plaintext key to obtain the first ciphertext key, and encrypt the first ciphertext key and the playback address information corresponding to the video stream to be played according to the first encryption information to obtain the first encrypted message, and return the first encrypted message to the playback device.
[0105] In this way, the visual network service platform can know the correspondence between the first ciphertext key and the plaintext key. After the playback device transmits the first ciphertext key to the streaming media server, the streaming media server can determine the plaintext key corresponding to the first ciphertext key through data interaction with the visual network service platform, and encrypt the video stream data accordingly, thereby avoiding the playback device directly transmitting the plaintext key to the streaming media server, so as to further reduce the risk of leakage of the plaintext key and improve the security of the video stream data.
[0106] In one embodiment, sending a play request carrying a first ciphertext key to a streaming media server according to the play address information includes:
[0107] Step A1: parsing the playback address information and obtaining streaming media connection verification information;
[0108] Step A2: establishing an SRT connection between the playback device and the streaming media server according to the streaming media connection verification information;
[0109] Step A3: generating a play request carrying a first ciphertext key;
[0110] Step A4: Based on the SRT connection, a playback request is sent to the streaming media server.
[0111] The streaming media connection verification information refers to information used to determine the client address of the streaming media server and to perform identity authentication, and may include, for example, the IP (Internet Protocol) address, port information, and token information of the streaming media server.
[0112] Furthermore, after obtaining the streaming media connection verification information, the playback device may check the version protocol set that the device can support, and reassemble the streaming media connection verification information to obtain the video playback address that the playback device can support.
[0113] In this embodiment, after obtaining the streaming media connection verification information, the playback device can initiate an SRT connect request to the streaming media server based on the streaming media connection verification information to establish an SRT connection between the playback device and the streaming media server, and interact with the streaming media server based on the successfully established SRT connection.
[0114] In one example, the play request may also carry encrypted play address information and token information. After receiving the play request, the streaming media server may decrypt the encrypted play address information and verify it according to the token information. If the verification passes, the video stream data is determined according to the play address information. In this way, security can be further improved.
[0115] In one embodiment, the second encrypted message also includes second encryption information, and the video encryption data is obtained by encrypting the video stream data according to the second encryption information and the plaintext key. It should be noted that the first encryption information and the second encryption information can be the same or different. In other words, the visual network service platform and the streaming media server can use the same or different encryption algorithms to encrypt the playback address information and the video stream data respectively, and this document does not make specific restrictions on this.
[0116] Decrypting the video encrypted data based on the plaintext key to obtain the video stream data includes: decrypting the video encrypted data based on the second encryption information and the plaintext key to obtain the video stream data. In this way, security can be further improved.
[0117] In one embodiment, the present application provides a video encryption transmission method, which is applied to Figure 1 In the visual networking business platform shown in FIG. Figure 3 As shown, the video encryption transmission method provided by the present application may include the following steps:
[0118] S302: Generate a decryption key in response to the address acquisition request sent by the playback device.
[0119] In this step, the address acquisition request carries a second ciphertext key, which is obtained by encrypting the plaintext key by the playback device. For the relevant description of the second ciphertext key, please refer to the above embodiment, which will not be repeated here.
[0120] After receiving the address acquisition request sent by the playback device, the visual networking service platform can generate a decryption key for decrypting the second ciphertext key. It can be understood that the generation and acquisition method of the decryption key can be determined according to actual conditions, and this article does not make specific restrictions on this.
[0121] S304: extracting a second ciphertext key from the address acquisition request; wherein the second ciphertext key is obtained by encrypting the plaintext key by the playback device.
[0122] S306: Decrypt the second ciphertext key according to the decryption key to obtain a plaintext key.
[0123] In this step, the visual network service platform can use the decryption key to decrypt the second ciphertext key carried in the address acquisition request to obtain the plaintext key generated by the playback device.
[0124] S308: Encrypt the plaintext key according to a preset key encryption algorithm to obtain a first ciphertext key.
[0125] In this step, the visual network service platform can use a preset key encryption algorithm to re-encrypt the plaintext key and obtain a first ciphertext key.
[0126] S310: respectively determining the playback address information corresponding to the address acquisition request, and assembling and splicing the playback address information with the first ciphertext key to obtain spliced data.
[0127] In this step, the visual network service platform can determine the playback address information corresponding to the video stream to be played according to the address acquisition request, and assemble and splice the playback address information with the first ciphertext key to obtain spliced data. It should be noted that in this application, the playback address information is unencrypted plaintext information.
[0128] S312: Determine a first encryption algorithm, and use the first encryption algorithm to encrypt the spliced data to obtain address encrypted data.
[0129] In this step, the visual networking service platform may use the first encryption algorithm to encrypt the spliced data to obtain address encrypted data. It can be understood that the address encrypted data includes data obtained by performing a secondary encryption on the plaintext key and data obtained by performing a primary encryption on the playback address information.
[0130] In one example, the first encryption algorithm may be an AES algorithm or an SM4 algorithm.
[0131] S314: Determine first encryption information corresponding to the first encryption algorithm, and generate a first encrypted message according to the first encryption information and the address encryption data.
[0132] In this step, the visual network service platform can determine the first encryption information used to represent the first encryption algorithm based on the first encryption algorithm, and generate a first encrypted message based on the first encryption information and the address encryption data, so that the first encrypted message carries the first encryption information and the address encryption data.
[0133] S316: Return the first encrypted message to the playback device.
[0134] In this step, the visual network service platform returns the first encrypted message to the playback device, so that the playback device can obtain the playback address information according to the steps described in the above embodiment.
[0135] In this embodiment, on the one hand, the visual network service platform can obtain the plaintext key from the second ciphertext key, so as to perform subsequent steps based on the plaintext key, and reduce the risk of leakage of the plaintext key, thereby improving the security of video transmission. On the other hand, when the visual network service platform receives the address acquisition request, the second ciphertext key carried in the address acquisition request can be decrypted to obtain the plaintext key. In addition, the visual network service platform can re-encrypt the plaintext key to obtain the first ciphertext key, and encrypt the first ciphertext key and the playback address information corresponding to the video stream to be played according to the first encryption information to obtain the first encrypted message, and return the first encrypted message to the playback device. In this way, the encrypted transmission of the playback address information can be realized between the visual network service platform and the playback device through the first encrypted message to reduce the risk of leakage of the playback address information. At the same time, the visual network service platform can know the corresponding relationship between the first ciphertext key and the plaintext key, so as to perform the subsequent steps more safely and reliably.
[0136] In one embodiment, the first encrypted message may be a binary message, and the message structure of the first encrypted message may be as shown in Table 1.
[0137] Table 1 Message structure table
[0138]
[0139] As shown in Table 1, the first encrypted message includes a start word, an extension bit, a type word, a method word, a data length, an encryption mark word, a reserved word, and data. Among them, the type word and the method word can be used to describe the type of data. For example, as shown in Table 2, the type word may include instructions, real-time audio and video streams, and video playback streams, and the method word may include real-time streams and related extended definitions.
[0140] Table 2 Description of type words and method words
[0141]
[0142] As shown in Table 3, the encryption mark word can represent different meanings through different values. Since the SM4 algorithm only supports 128 encryption mode, the first 16 bytes of the key can be encrypted. In the encryption mark word, the first 3 bits describe the encryption mode, the middle 2 bits describe the key length, and the last 3 bits describe the encryption length.
[0143] Table 3 Description of encryption mode and encryption length
[0144]
[0145] The reserved words are used to define the extended encryption algorithm type and media format, including audio and video encoding. Among them, 2 bits of the reserved word represent the encryption algorithm type, 3 bits represent the video encoding type, and 3 bits represent the audio encoding type. Table 4 is a description of each type.
[0146] Table 4 Reserved word description
[0147]
[0148] For example, when the encryption algorithm is the AES algorithm, the video codec is H.264, and the audio codec is G711a, the binary value of the reserved word is 0x10100100.
[0149] Since the reserved word space is limited and cannot be filled with information such as sampling rate, the extended bit in Table 1 is used to extend 8 bytes, of which 1 byte describes the audio information and the remaining bytes are used as reserved words. The extended bit and 8 bytes are only carried when it is an I frame. In this embodiment, the data format of the real-time stream can be shown in Table 5.
[0150] Table 5 Data format of real-time stream
[0151]
[0152] In one embodiment, the video encryption transmission method provided by the present application may include the following steps:
[0153] Step B1: receiving a key query request sent by a streaming media server in response to a play request; wherein the play request is sent by a play device and carries a target first key;
[0154] Step B2: extracting the target first key from the key query request;
[0155] Step B3: querying according to the target first key, and determining the target plaintext key corresponding to the target first key;
[0156] Step B4: Return the target plaintext key to the streaming media server.
[0157] In this embodiment, after the playback device transmits a playback request to the streaming media server, the streaming media server can determine the plaintext key corresponding to the target first key carried in the playback request through data interaction with the visual network service platform, and encrypt the video stream data accordingly, thereby avoiding the playback device directly transmitting the plaintext key to the streaming media server, so as to further reduce the risk of leakage of the plaintext key and improve the security of the video stream data.
[0158] Specifically, when the streaming media server receives a playback request sent by a playback device, it can extract the target first key from the playback request, and through data interaction with the visual network service platform, query the target plaintext key corresponding to the target first key, so as to subsequently encrypt the video stream data according to the target plaintext key to obtain the second encrypted message.
[0159] It can be understood that the message structure of the second encrypted message can be the same as the message structure of the first encrypted message. The message structure of the second encrypted message can refer to the relevant descriptions of Tables 1 to 5, and will not be repeated here.
[0160] To facilitate understanding of the solution of the present application, a specific example is provided below for illustration.
[0161] like Figure 4 As shown, in the video encryption transmission method provided in this example, Figure 4 The process shown obtains the playback address information and the first ciphertext key respectively. Specifically, it may include the following steps:
[0162] S402: The visual network APP generates a plaintext key and encrypts the plaintext key to obtain a second ciphertext key;
[0163] S404: The visual network APP sends an address acquisition request to the visual network service platform, where the address acquisition request carries the second ciphertext key;
[0164] S406: The visual networking service platform generates a decryption key, and decrypts the second ciphertext key according to the decryption key to obtain a plaintext key;
[0165] S408: The visual network service platform re-encrypts the plaintext key using a preset key encryption algorithm to obtain a first ciphertext key;
[0166] S410: The visual network service platform queries the playback address information, assembles and splices the playback address information with the first ciphertext key, and obtains spliced data;
[0167] S412: The visual networking service platform encrypts the spliced data using a first encryption algorithm and generates a first encrypted message; wherein, the description of the first encrypted message can refer to the above embodiment, which will not be repeated herein;
[0168] S414: The visual network service platform returns the first encrypted message to the visual network APP;
[0169] S416: The visual network APP decrypts the first encrypted message to obtain the playback address information and the first ciphertext key;
[0170] S418: The visual network APP sends the playback address information and the first ciphertext key to the player.
[0171] like Figure 5 As shown, in the video encryption transmission method provided in this example, Figure 5 The process shown is respectively video stream data. Specifically, it may include the following steps:
[0172] S502: The player parses the playback address information to obtain streaming media connection verification information;
[0173] S504: The player sends an SRT connection request to the streaming media server;
[0174] S506: The streaming media server returns a connection establishment result to the player in response to the SRT connection request;
[0175] S508: When the SRT connection is established successfully, the player sends a play request to the streaming media server, where the play request carries the first ciphertext key;
[0176] S510: The streaming media server sends a key query request to the visual network service platform according to the first ciphertext key;
[0177] S512: The visual networking service platform returns a plaintext key corresponding to the first ciphertext key to the streaming media server;
[0178] S514: The streaming media server uses a second encryption algorithm and a plaintext key to encrypt and encapsulate the video stream data to obtain a second encrypted message;
[0179] S516: The streaming media server returns a second encrypted message to the player; for the description of the second encrypted message, please refer to the description of the first encrypted message in the above embodiment, which will not be repeated here;
[0180] S518: The player decrypts the second encrypted message according to the plaintext key to obtain video stream data;
[0181] S520: The player plays the video according to the video stream data.
[0182] The following is a description of a video encryption transmission device applied to a playback device provided in an embodiment of the present application. The video encryption transmission device applied to a playback device described below and the video encryption transmission method applied to a playback device described above can be referenced to each other.
[0183] In one embodiment, Figure 6 As shown, the present application provides a video encryption transmission device, which is applied to a playback device 600, including:
[0184] The address acquisition request generation module 602 is used to generate a plaintext key and an address acquisition request in response to a video playback instruction;
[0185] The address acquisition module 604 is used to send the address acquisition request to the visual network service platform, and receive the first encrypted message returned by the visual network service platform in response to the address acquisition request; wherein the first encrypted message includes first encryption information and address encryption data, and the address encryption data is obtained by encrypting the playback address information according to the first encryption information;
[0186] A first decryption module 606, configured to decrypt the address encrypted data according to the first encryption information to obtain the playback address information;
[0187] The play request sending module 608 is used to send a play request carrying a first ciphertext key to the streaming media server according to the play address information; wherein the first ciphertext key is obtained by encrypting the plaintext key;
[0188] A second encrypted message acquisition module 610 is configured to receive a second encrypted message returned by the streaming media server in response to the play request; wherein the second encrypted message includes video encryption data, and the video encryption data is obtained by encrypting the video stream data according to the plaintext key;
[0189] The video stream data acquisition module 612 is used to decrypt the video encryption data based on the plaintext key to obtain the video stream data.
[0190] In one embodiment, the address acquisition request generation module 602 of the present application includes:
[0191] A first key encryption unit, used to encrypt the plaintext key to obtain a second ciphertext key;
[0192] An address acquisition request generating unit, configured to generate the address acquisition request carrying the second ciphertext key;
[0193] Among them, the address acquisition request is used to instruct the visual network service platform to decrypt the second ciphertext key, obtain the plaintext key, and re-encrypt the plaintext key to obtain the first ciphertext key, and encrypt the first ciphertext key and the playback address information according to the first encryption information to obtain the first encrypted message.
[0194] In one embodiment, the play request sending module 608 of the present application includes:
[0195] An address parsing unit, used to parse the playback address information and obtain streaming media connection verification information;
[0196] An SRT connection unit, configured to establish an SRT connection between the playback device and the streaming media server according to the streaming media connection verification information;
[0197] a play request generating unit, configured to generate the play request carrying the first ciphertext key;
[0198] A play request sending unit is used to send the play request to the streaming media server based on the SRT connection.
[0199] In one embodiment, the second encrypted message further includes second encryption information, and the video encrypted data is obtained by encrypting the video stream data according to the second encryption information and the plaintext key. The video stream data acquisition module 612 of the present application includes:
[0200] A decryption unit is used to decrypt the video encrypted data according to the second encryption information and the plaintext key to obtain the video stream data.
[0201] The following describes a video encryption transmission device applied to a visual networking service platform provided in an embodiment of the present application. The video encryption transmission device applied to a visual networking service platform described below and the video encryption transmission method applied to a visual networking service platform described above can be referenced to each other.
[0202] In one embodiment, Figure 7 As shown, the present application provides a video encryption transmission device 700, which is applied to a visual network service platform, including:
[0203] The decryption key generation module 702 is used to generate a decryption key in response to an address acquisition request sent by the playback device;
[0204] A second ciphertext key extraction module 704 is used to extract a second ciphertext key from the address acquisition request; wherein the second ciphertext key is obtained by encrypting the plaintext key by the playback device;
[0205] A second decryption module 706, configured to decrypt the second ciphertext key according to the decryption key to obtain the plaintext key;
[0206] A key encryption module 708, configured to encrypt the plaintext key according to a preset key encryption algorithm to obtain a first ciphertext key;
[0207] An assembling and splicing module 710 is used to respectively determine the playback address information corresponding to the address acquisition request, and assemble and splice the playback address information with the first ciphertext key to obtain spliced data;
[0208] The address encryption module 712 is used to determine a first encryption algorithm and use the first encryption algorithm to encrypt the spliced data to obtain address encrypted data;
[0209] A first encrypted message generating module 714, configured to determine first encrypted information corresponding to the first encryption algorithm, and generate a first encrypted message according to the first encrypted information and the address encrypted data;
[0210] The first encrypted message returning module 716 is configured to return the first encrypted message to the playback device.
[0211] In one embodiment, the video encryption transmission device of the present application further includes:
[0212] A key query request receiving module, used to receive a key query request sent by a streaming media server in response to a play request; wherein the play request is sent by the play device and carries a target first key;
[0213] A key extraction module, used to extract the target first key from the key query request;
[0214] A key query module, used to query according to the target first key and determine a target plaintext key corresponding to the target first key;
[0215] The key return module is used to return the target plaintext key to the streaming media server.
[0216] In one embodiment, the present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the video encryption transmission method applied to the playback device in any embodiment, and / or the steps of the video encryption transmission method applied to the visual networking platform.
[0217] In one embodiment, the present application also provides a playback device, in which computer-readable instructions are stored. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the video encryption transmission method applied to the playback device in any embodiment.
[0218] In one embodiment, the present application also provides a visual networking service platform, which stores computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the video encryption transmission method applied to the visual networking service platform in any embodiment.
[0219] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not clearly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements. Herein, "one", "one", "said", "the" and "it" may also include plural forms, unless the context clearly indicates another way. A plurality refers to at least two cases, such as 2, 3, 5 or 8, etc. "And / or" includes any and all combinations of the relevant listed items.
[0220] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.
[0221] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A video encryption transmission method, characterized in that: Applied to a playback device, the method comprises: In response to a video playback instruction, a plaintext key is generated, and an address acquisition request is generated; Sending the address acquisition request to the visual networking service platform, and receiving a first encrypted message returned by the visual networking service platform in response to the address acquisition request; wherein the first encrypted message includes first encryption information and address encryption data, and the address encryption data is obtained by encrypting the playback address information according to the first encryption information; Decrypting the address encrypted data according to the first encryption information to obtain the playback address information; Sending a play request carrying a first ciphertext key to a streaming media server according to the play address information; wherein the first ciphertext key is obtained by encrypting the plaintext key; Receiving a second encrypted message returned by the streaming media server in response to the play request; wherein the second encrypted message includes video encryption data, and the video encryption data is obtained by encrypting the video stream data according to the plaintext key; The video encrypted data is decrypted based on the plaintext key to obtain the video stream data.
2. The method according to claim 1, characterized in that The generating of the address acquisition request comprises: Encrypting the plaintext key to obtain a second ciphertext key; Generate the address acquisition request carrying the second ciphertext key; Among them, the address acquisition request is used to instruct the visual network service platform to decrypt the second ciphertext key, obtain the plaintext key, and re-encrypt the plaintext key to obtain the first ciphertext key, and encrypt the first ciphertext key and the playback address information according to the first encryption information to obtain the first encrypted message.
3. The method according to claim 1, characterized in that The sending a play request carrying a first ciphertext key to a streaming media server according to the play address information includes: Parsing the playback address information and obtaining streaming media connection verification information; Establishing an SRT connection between the playback device and the streaming media server according to the streaming media connection verification information; generating the playback request carrying the first ciphertext key; Based on the SRT connection, the playback request is sent to the streaming media server.
4. The method according to any one of claims 1 to 3, characterized in that: The second encrypted message further includes second encryption information, and the video encryption data is obtained by encrypting the video stream data according to the second encryption information and the plaintext key; The decrypting the video encrypted data based on the plaintext key to obtain the video stream data includes: The video encrypted data is decrypted according to the second encryption information and the plaintext key to obtain the video stream data.
5. A video encryption transmission method, characterized in that: Applied to the visual networking service platform, the method includes: In response to the address acquisition request sent by the playback device, generate a decryption key; Extracting a second ciphertext key from the address acquisition request; wherein the second ciphertext key is obtained by encrypting the plaintext key by the playback device; Decrypting the second ciphertext key according to the decryption key to obtain the plaintext key; Encrypting the plaintext key according to a preset key encryption algorithm to obtain a first ciphertext key; respectively determining the playback address information corresponding to the address acquisition request, and assembling and splicing the playback address information with the first ciphertext key to obtain spliced data; Determine a first encryption algorithm, and use the first encryption algorithm to encrypt the spliced data to obtain address encrypted data; Determine first encryption information corresponding to the first encryption algorithm, and generate a first encrypted message according to the first encryption information and the address encryption data; Return the first encrypted message to the playback device.
6. The method according to claim 5, characterized in that The method further comprises: Receiving a key query request sent by a streaming media server in response to a play request; wherein the play request is sent by the play device and carries a target first key; Extracting the target first key from the key query request; Performing a query according to the target first key and determining a target plaintext key corresponding to the target first key; The target plaintext key is returned to the streaming media server.
7. A video encryption transmission device, characterized in that: Applied to a playback device, the device comprises: An address acquisition request generation module, used to generate a plaintext key and an address acquisition request in response to a video playback instruction; An address acquisition module, used to send the address acquisition request to the visual network service platform, and receive a first encrypted message returned by the visual network service platform in response to the address acquisition request; wherein the first encrypted message includes first encryption information and address encryption data, and the address encryption data is obtained by encrypting the playback address information according to the first encryption information; A first decryption module, used for decrypting the address encrypted data according to the first encryption information to obtain the playback address information; a play request sending module, configured to send a play request carrying a first ciphertext key to a streaming media server according to the play address information; wherein the first ciphertext key is obtained by encrypting the plaintext key; A second encrypted message acquisition module is used to receive a second encrypted message returned by the streaming media server in response to the play request; wherein the second encrypted message includes video encryption data, and the video encryption data is obtained by encrypting the video stream data according to the plaintext key; The video stream data acquisition module is used to decrypt the video encryption data based on the plaintext key to obtain the video stream data.
8. A video encryption transmission device, characterized in that: Applied to the visual networking service platform, the device includes: A decryption key generation module, used to generate a decryption key in response to an address acquisition request sent by a playback device; A second ciphertext key extraction module, used to extract a second ciphertext key from the address acquisition request; wherein the second ciphertext key is obtained by encrypting the plaintext key by the playback device; A second decryption module, used to decrypt the second ciphertext key according to the decryption key to obtain the plaintext key; A key encryption module, used to encrypt the plaintext key according to a preset key encryption algorithm to obtain a first ciphertext key; An assembling and splicing module, used to respectively determine the playback address information corresponding to the address acquisition request, and assemble and splice the playback address information with the first ciphertext key to obtain spliced data; An address encryption module, used to determine a first encryption algorithm, and use the first encryption algorithm to encrypt the spliced data to obtain address encrypted data; A first encrypted message generation module, used to determine first encrypted information corresponding to the first encryption algorithm, and generate a first encrypted message according to the first encrypted information and the address encrypted data; The first encrypted message returning module is used to return the first encrypted message to the playback device.
9. A playback device, characterized in that: include: one or more processors, and memory; The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the video encryption transmission method according to any one of claims 1 to 4 are performed.
10. A visual networking service platform, characterized in that: include: one or more processors, and memory; The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the video encryption transmission method as described in any one of claims 5 or 6 are performed.
Citation Information
Patent Citations
Method and system for playing online videos
CN105721903A
A streaming media login and data transmission encryption method and device
CN109743170A
Video playing address analysis and acquisition method and system, and medium
CN109951735A
Video processing method, system and device, electronic equipment and storage medium
CN118055270A
Method for acquiring video resource file, and management system
WO2020019387A1
