Video stream data encryption method and system, video stream data decryption method and system, equipment and medium
By inverting the video stream data, hexadecimal encoding and multiple encryption processing, combined with user ID and member ID, the problem of the existing technology being difficult to prevent pirated video websites from illegally obtaining video works is solved, and the video stream data is effective Encryption and decryption enhance defense against pirated websites.
Patent Information
- Application Number
- CN202411398579.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-01-07
AI Technical Summary
The existing video streaming data encryption protocol is difficult to prevent pirated video websites from illegally obtaining video works through streaming analysis. The servers of pirated websites are usually set up overseas, and the domain name is updated frequently, making it difficult to effectively deal with it.
By obtaining the original video stream data, user ID and member ID, inverting and hexadecimal encoding, dividing data segments and adding randomly generated flag bits, multiple encryption is realized to prevent unauthorized users from pulling streams and resolving.
Effectively prevent video streaming data from being parsed by unauthorized users, protect the legitimate rights and interests of copyright owners, and improve the defense capabilities of pirated websites through segmented encryption and decryption processing.
Smart Images

Figure CN119277128A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data encryption and decryption, and specifically relates to a video stream data encryption method, decryption method, system, equipment and medium. Background Art
[0002] At present, most video websites use common encryption protocols to encrypt video streaming data, which makes it easy for pirated video websites to illegally obtain these video works through streaming analysis, infringing the legitimate rights and interests of copyright owners and causing economic losses to copyright owners. In addition, the servers of these pirated video websites are usually located overseas, and their domain names are frequently updated, making it difficult to effectively handle them. Summary of the invention
[0003] In order to overcome the above technical defects, the present invention provides a video stream data encryption method, decryption method, system, device and medium.
[0004] In order to solve the above problem, the first aspect of the present invention provides a video stream data encryption method, comprising:
[0005] Obtaining original video stream data, user ID and member ID, wherein the original video stream data, user ID and member ID are binary numbers;
[0006] The original video stream data is inverted, and the inverted video stream data is hexadecimal encoded;
[0007] The hexadecimal-encoded video stream data is divided into several data segments, and the user ID and member ID are added to the data segments and connected with a flag bit to obtain the encrypted video stream data, wherein the flag bit is a randomly generated hexadecimal number with a value range of 9-F.
[0008] Furthermore, the hexadecimal-encoded video stream data is divided into a plurality of data segments, including:
[0009] Decomposing each bit of the hexadecimal video stream data so as to convert each bit of the video stream data into a data segment;
[0010] Check each bit of the data segment to determine whether it meets the preset conditions.
[0011] Furthermore, before the original video stream data is inverted, the process includes:
[0012] Authenticate the obtained user ID and member ID;
[0013] If the authentication is passed, the original video stream data is inverted;
[0014] If the authentication fails, the encryption process ends.
[0015] In a second aspect, the present invention further provides a video stream data decryption method for decrypting the above encryption method, comprising:
[0016] Identify the flag bit in the encrypted video stream data;
[0017] Based on the flag bit, the encrypted video stream data is divided to obtain the user ID, member ID and data segment;
[0018] The data segment is processed, the result of the operation is converted into a binary number and inverted to obtain the original video stream data.
[0019] Further, the identifying of the flag bit in the encrypted video stream data includes:
[0020] Traverse each bit of the encrypted video stream data to determine whether there is a hexadecimal number in the value range of 9-F. If so, the bit is a flag bit.
[0021] Furthermore, the performing operation processing on the data segment includes:
[0022] Add several data segments to obtain the result.
[0023] In a third aspect, the present invention further provides a video stream data transmission system, comprising:
[0024] The user end is used to send the user ID, member ID and video request signal according to the user instruction;
[0025] The first server is connected to the user end and is used to authenticate the user ID and member ID according to the video request signal, and send a video stream data request if the authentication is successful;
[0026] The second server is connected to the first server, and is used to obtain and encrypt the original video stream data using the above encryption method according to the video stream data request from the first server, and send the encrypted video stream data to the first server, and the first server uses the above decryption method to decrypt the data;
[0027] The back-end module is connected to the second server and is used to store the original video stream data, user ID and member ID.
[0028] In a fourth aspect, the present invention further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the processor implements the steps of the above-mentioned video stream data encryption method and / or implements the steps of the above-mentioned video stream data decryption method.
[0029] In a fifth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the above-mentioned video stream data encryption method and / or the steps of the above-mentioned video stream data decryption method are implemented.
[0030] Compared with the prior art, the present invention has the following beneficial effects:
[0031] The present invention discloses a video stream data encryption method, comprising: obtaining original video stream data, user ID and member ID, wherein the original video stream data, user ID and member ID are binary numbers; inverting the original video stream data, and performing hexadecimal encoding on the inverted video stream data; dividing the hexadecimal-encoded video stream data into a plurality of data segments, adding user ID and member ID to the data segments and connecting them with a flag bit, and obtaining encrypted video stream data, wherein the flag bit is a randomly generated hexadecimal number with a value range of 9-F. The first step of processing the original video stream data is performed by inverting the original video stream data, so that the video stream data is "wrong" from the beginning of the transmission process, and the hexadecimal-encoded video stream data is divided into a plurality of data segments, and the flag bit, the binary user ID, the member ID and the hexadecimal data segment are combined for mixed encoding to achieve multiple encryption, so as to prevent unauthorized users from pulling the stream and parsing. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The specific embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings, wherein:
[0033] Figure 1 The process of the video stream data encryption method described in Example 1 Figure 1 ;
[0034] Figure 2 The process of the video stream data encryption method described in Example 1 Figure 2 ;
[0035] Figure 3 This is a flowchart of the video stream data decryption method described in Example 2;
[0036] Figure 4 This is a schematic diagram of the structure of the video stream data transmission system described in Example 3;
[0037] Marking description: 100, user end; 200, first server end; 300, second server end; 400, back-end module. DETAILED DESCRIPTION
[0038] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0039] In the description of this application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0040] Example 1
[0041] This embodiment discloses a method for encrypting video stream data. Figure 1 and 2 ,include:
[0042] S101. Obtain original video stream data, user ID and member ID. Specifically, the original video stream data is 00000001, the user ID is 00000001, and the member ID is 00000010.
[0043] S102, invert the original video stream data, and perform hexadecimal encoding on the inverted video stream data. The original video stream data 00000001 is inverted to 11111110, and the inverted video stream data 11111110 is used as the first data set; the first data set is hexadecimal encoded to obtain a second data set: FE.
[0044] S103, dividing the hexadecimal-encoded video stream data into several data segments, adding the user ID and the member ID to the data segments and connecting them with a flag bit to obtain the encrypted video stream data, wherein the flag bit is a randomly generated hexadecimal number with a value range of 9-F.
[0045] Specifically, step S103 includes:
[0046] Each bit of the hexadecimal video stream data is decomposed and processed, so that each bit of the video stream data is converted into a data segment: each bit of the hexadecimal video stream data is divided by a preset value, and if it can be divided, it is converted into a data segment containing a number of quotients, wherein the specific number of data in the data segment is determined by the specific value of the preset value. For example, in this embodiment, the preset value is 2, E in the second data set FE is divided by 2, E is divisible by 2, E / 2=7, that is, E can be decomposed into 7 and 7, E is converted into a data segment with a content of 77, and 77 is used as the third data set.
[0047] If a certain bit in the hexadecimal video stream data cannot be divided by the preset value, a modulus operation is performed to obtain a remainder after the division operation is performed to obtain a quotient, and the remainder is added to the quotient obtained by the division to obtain a digit of the data segment, and the remaining digits of the data segment are the quotient obtained by the division, wherein the specific number of data in the data segment is determined by the specific value of the preset value. When the preset value is 2, F in the second data set FE is divisible by 2, F / 2=7, F cannot be divided by 2, F%2=1, 1+7=8, that is, F can be decomposed into 7 and 8.
[0048] Before decomposing each bit of the hexadecimal video stream data, the video stream data is traversed to obtain the size relationship between each adjacent data, and the decomposition results of the video stream data that cannot be divided by the preset value and needs to be modulo-operated are sorted according to the size relationship between each adjacent data. In this embodiment, if the second data set is FE, F is converted into a data segment with a content of 87, and 87 is used as the fourth data set. If it is EF, F is converted into a data segment with a content of 78.
[0049] Each bit of the data segment is checked to determine whether it meets the preset conditions: when the preset value is 2, since the maximum quotient that can be obtained when a hexadecimal number is divided by the preset value is 7, 77 and 87 are compared with 8 respectively to determine whether they meet the preset condition of being less than or equal to 8. If the preset condition is met, it is considered that the decomposition processing is correct. The preset value can also be 3, 4, etc. according to actual needs. The relevant calculation process involved in different preset values is the same as above and will not be repeated here.
[0050] The user ID 00000001 and the member ID 00000010 are added to the third data set and the fourth data set respectively, and connected by a flag bit, wherein any number from the hexadecimal numbers 9 to F is selected as the flag bit. In this embodiment, A is selected as the flag bit, and the third data set after mixed coding is: 00000001A00000010A77; the fourth data set after mixed coding is: 00000001A00000010A87.
[0051] And 00000001A00000010A77 is used as the fifth data set, and 00000001A00000010A87 is used as the sixth data set. The fifth data set and the sixth data set are the encrypted video stream data.
[0052] Specifically, before step S102, the following steps are included:
[0053] Authenticate the obtained user ID and member ID;
[0054] If the authentication is passed, the original video stream data is inverted;
[0055] If the authentication fails, the encryption process ends.
[0056] The video stream data encryption method disclosed in this embodiment uses the inversion method to perform the first step of processing the original video stream data, so that the video stream data is "wrong" from the beginning of the transmission process, and divides the hexadecimal-coded video stream data into several data segments by integer and modulus division to achieve decomposition processing with verification; then the hexadecimal flag bit, binary user ID, member ID and hexadecimal data segment are combined for mixed encoding to achieve multiple encryption to prevent unauthorized users from pulling the stream for parsing.
[0057] Example 2
[0058] This embodiment discloses a video stream data decryption method, which is used to decrypt the encryption method described in Embodiment 1. Figure 3 ,include:
[0059] S201, identifying a flag bit in encrypted video stream data.
[0060] Specifically, step S201 includes:
[0061] The encrypted video stream data 00000001A00000010A77 and 00000001A00000010A87 are obtained.
[0062] Each bit of the encrypted video stream data is checked to determine whether there is a hexadecimal number in the value range of 9-F. If so, the bit is a flag bit: it is recognized that there is a hexadecimal number A in 00000001A00000010A77 and 00000001A00000010A87, so A is a flag bit.
[0063] S202: Based on the flag bit, the encrypted video stream data is divided to obtain a user ID, a member ID and a data segment.
[0064] Based on the flag bit A, 00000001A00000010A77 and 00000001A00000010A87 are divided to obtain 00000001, 00000010, 77 and 87, among which the binary numbers 00000001 and 00000010 are the user ID and member ID, and the hexadecimal numbers 77 and 87 are the data segments. 77 is used as the seventh data set and 87 is used as the eighth data set.
[0065] S203, performing operation processing on the data segment, converting the operation result into a binary number and negating it, to obtain original video stream data.
[0066] Specifically, step S203 includes:
[0067] The seventh data set and the eighth data set are added in hexadecimal to obtain a calculation result FE: 77+87=FE.
[0068] The operation result FE is converted into binary to obtain: 11111110; the binary number 11111110 is inverted to obtain 00000001. At this time, 00000001 is the original video stream data.
[0069] Example 3
[0070] This embodiment discloses a video stream data transmission system. Figure 4 , including a user end 100, a first server end 200, a second server end 300 and a backend module 400, specifically:
[0071] The user terminal 100 is used to send a user ID, a member ID and a video request signal according to a user instruction;
[0072] The first server 200 is connected to the user terminal 100 and is used to authenticate the user ID and the member ID according to the video request signal, and send a video stream data request if the authentication is successful;
[0073] The second server 300 is connected to the first server 200, and is used to obtain and encrypt the original video stream data using the encryption method described in Example 1 according to the video stream data request from the first server, and send the encrypted video stream data to the first server, and the first server uses the decryption method described in Example 2 to decrypt the data;
[0074] The backend module 400 is connected to the second server 300 and is used to store original video stream data, user ID and member ID.
[0075] For the specific encryption process, please refer to Example 1, and for the specific decryption process, please refer to Example 2, which will not be repeated here.
[0076] The video stream data transmission system provided in this embodiment divides the server in the prior art into two parts, namely, a first server end 200 and a second server end 300. The first server end 200 and the second server end 300 as well as the second server end 300 and the back-end module 400 communicate through the system's internal http protocol, and the user end 100 and the first server end 200 communicate through traditional http or https, so that the user end 100 can only access the first server end 200, and cannot directly access the back-end module 400, nor can it access the back-end module 400 through the first server end 200; the original video stream data is protected by performing encryption operations such as inversion, hexadecimal conversion, decomposition processing, and mixed coding and corresponding decryption operations on the original video stream data to prevent it from being pulled and parsed by unauthorized users.
[0077] Example 4
[0078] This embodiment discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the video stream data encryption method described in Embodiment 1 is implemented, or the video stream data decryption method described in Embodiment 2 is implemented, or the video stream data encryption method described in Embodiment 1 and the video stream data decryption method described in Embodiment 2 are implemented.
[0079] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.
[0080] Example 5
[0081] This embodiment discloses a computer-readable storage medium having a computer program stored thereon. When the computer program 10 is executed by a processor, the video stream data encryption method described in Embodiment 1 is implemented, or the video stream data decryption method described in Embodiment 2 is implemented, or both the video stream data encryption method described in Embodiment 1 and the video stream data decryption method described in Embodiment 2 are implemented.
[0082] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0083] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0084] It should be noted that the various embodiments in the present invention are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments can be referred to each other. It should also be noted that in the present invention, 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 any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0085] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Therefore, any modification, equivalent change and modification made to the above embodiment based on the technical essence of the present invention without departing from the technical solution of the present invention shall still fall within the scope of the technical solution of the present invention.
Claims
1. A video stream data encryption method, characterized in that: include: Obtaining original video stream data, user ID and member ID, wherein the original video stream data, user ID and member ID are binary numbers; The original video stream data is inverted, and the inverted video stream data is hexadecimal encoded; The hexadecimal-encoded video stream data is divided into several data segments, and the user ID and member ID are added to the data segments and connected with a flag bit to obtain the encrypted video stream data, wherein the flag bit is a randomly generated hexadecimal number with a value range of 9-F.
2. The video stream data encryption method according to claim 1, characterized in that: The hexadecimal encoded video stream data is divided into a plurality of data segments, including: Decomposing each bit of the hexadecimal video stream data so as to convert each bit of the video stream data into a data segment; Check each bit of the data segment to determine whether it meets the preset conditions.
3. The video stream data encryption method according to claim 1, characterized in that: Before the original video stream data is negated, the method includes: Authenticate the obtained user ID and member ID; If the authentication is successful, the original video stream data is inverted; If the authentication fails, the encryption process ends.
4. A video stream data decryption method, used for decrypting the encryption method according to any one of claims 1 to 2, characterized in that: include: Identify the flag bit in the encrypted video stream data; Based on the flag bit, the encrypted video stream data is divided to obtain the user ID, member ID and data segment; The data segment is processed, the result of the operation is converted into a binary number and inverted to obtain the original video stream data.
5. The video stream data decryption method according to claim 4, characterized in that: The identifying of the flag bit in the encrypted video stream data includes: Traverse each bit of the encrypted video stream data to determine whether there is a hexadecimal number in the value range of 9-F. If so, the bit is a flag bit.
6. The video stream data decryption method according to claim 4, characterized in that: The performing operation processing on the data segment includes: Add several data segments to obtain the result.
7. A video stream data transmission system, characterized in that: include: The user end is used to send the user ID, member ID and video request signal according to the user instruction; The first server is connected to the user end and is used to authenticate the user ID and member ID according to the video request signal, and send a video stream data request if the authentication is successful; The second server is connected to the first server, and is used to obtain and encrypt the original video stream data using the encryption method described in any one of claims 1 to 3 according to the video stream data request from the first server, and send the encrypted video stream data to the first server, and the first server uses the decryption method described in any one of claims 4 to 6 to decrypt the data; The back-end module is connected to the second server and is used to store the original video stream data, user ID and member ID.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the processor implements the steps of the video stream data encryption method described in any one of claims 1-3, and / or implements the steps of the video stream data decryption method described in any one of claims 4-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the video stream data encryption method described in any one of claims 1 to 3 and / or the steps of the video stream data decryption method described in any one of claims 4 to 6 are implemented.