Program encryption method, decryption method, storage medium and related device
By performing secondary encapsulation and encryption on digital television program streams, setting non-standard stream types and program identifiers, and inserting PAT and PMT packets, the problem of easy cracking of pay programs in existing technologies is solved, achieving higher security and protection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHUHAI GOTECH INTELLIGENT TECH CO LTD
- Filing Date
- 2026-01-29
- Publication Date
- 2026-05-05
AI Technical Summary
Existing digital television program encryption methods are ineffective in preventing pay-TV programs from being illegally cracked, leading to losses for operators.
The original transport stream is repackaged into an encrypted transport stream, and the stream type and program identifier are set to undefined non-standard values. At the same time, the data is encrypted using a symmetric encryption algorithm, and PAT and PMT packets are inserted to increase the difficulty of cracking.
It improves the security of encrypted programs, reduces losses for operators, and enhances the protection of pay-TV programs.
Smart Images

Figure CN121985155A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital television technology, specifically to a program encryption method, decryption method, storage medium, and related devices. Background Technology
[0002] Digital television program operators encode and transcode video, then push the program (TS) stream to a data upload center according to the DVB standard. The stream is then transmitted to user areas via terrestrial, cable, and satellite signals. Users receive the signal using set-top boxes and search for and watch programs. To prevent the theft of pay-TV content, existing digital television program operators typically use special encryption algorithms to encrypt the video and audio data in the program stream. Only set-top boxes with the corresponding keys can decrypt the encrypted data to obtain the original program video and audio data. However, this method still allows encrypted programs to be received and searched by all devices compliant with the DVB standard. By analyzing the encrypted data, operators can crack the programs, causing losses to the operators. Therefore, a new encryption method for digital television programs is needed to better protect the operators' programs. Summary of the Invention
[0003] In order to overcome the shortcomings of the existing technology, the purpose of this invention is to provide a method for encrypting program titles, which can improve the security of encrypted programs, increase the difficulty of cracking encrypted programs, and prevent operators' paid program content from being stolen and cracked.
[0004] To solve the above problems, the technical solution adopted by the present invention is as follows: a program encryption method, comprising: Obtain the raw streaming stream of the program; All data from the original transport stream is repackaged as program data into a new encrypted transport stream. The stream type and program identifier in the PMT table of the encrypted transport stream are set according to the preset encryption protocol. The value of the stream type in the PMT table of the encrypted transport stream is an undefined non-standard value. The encrypted transport stream is modulated into a digital television signal and transmitted to the user area via a signal tower.
[0005] Compared with existing technologies, the beneficial effects of this invention are as follows: This encryption method re-encapsulates the original transport stream as program data into a new encrypted transport stream, and sets the stream type value of the encrypted transport stream to an undefined non-standard value, that is, to user private data. In this way, even if the encrypted transport stream can be received by all devices that conform to the DVB standard, it cannot be searched by devices that do not have the corresponding encryption protocol pre-installed because it does not contain program information. If a hacker wants to crack the encrypted program, he also needs to crack the encapsulation protocol, thereby increasing the difficulty of cracking the encrypted program, improving the security of the encrypted program, and reducing the losses of operators.
[0006] The aforementioned program encryption methods also include: The program data in the encrypted transport stream is encrypted using an encryption algorithm.
[0007] The above-mentioned program encryption method, wherein the step of re-encapsulating all data of the original transport stream as program data into a new encrypted transport stream, setting the stream type and program identifier in the PMT table of the encrypted transport stream according to the predicted encryption protocol, and setting the stream type value in the PMT table of the encrypted transport stream to an undefined non-standard value includes: One data packet from the original transport stream is stored into the first buffer in sequence; One data packet from the original transport stream is stored into the first buffer sequentially; Create several new data packets and initialize them by filling the first 4 bytes of each data packet according to the preset encryption protocol; Read 188 bytes of data from the first buffer, use the read data to fill the remaining bytes of the earliest newly created but not filled data packet, and store the remaining bytes of the read data into the second buffer; Read the remaining bytes of data from the second buffer and use the read data to fill the remaining bytes of the earliest newly created, unfilled data packet; Record the number of reads from the second buffer. When the number of reads equals 46, set the start flag of the last newly created data packet to 1. Repeat the above steps until no new data arrives in the first buffer; All data packets are combined into a data stream, and PAT and PMT packets are configured according to a preset encryption protocol. PAT and PMT packets are periodically inserted into the data stream to form an encrypted transmission stream.
[0008] The above-described program encryption method, after the step of storing a data packet of the original transport stream into the first buffer in sequence, further includes: The data in the first buffer is encrypted using the encryption algorithm.
[0009] A method for decrypting a program includes the following steps; Receive and parse the program stream to obtain the PMT table of the program stream; The program stream is determined to be encrypted based on whether the stream type in the PMT table conforms to the preset encryption protocol configuration. If the program stream is encrypted, the PMT table is parsed to obtain the PID of the encrypted data. Extract encrypted data based on the PID of the encrypted data, and restore the encrypted data to the original transport stream; The raw transport stream is parsed to obtain the data for the target program.
[0010] The above-mentioned program decryption method, wherein the step of extracting encrypted data based on the PID of the encrypted data and restoring the encrypted data to the original transport stream includes: Filter encrypted data packets based on the PID of the encrypted data; The filtered encrypted data packets are divided into several groups based on the content of the encrypted data packets. Remove the first 4 bytes of each encrypted data packet; The remaining data of the previous encrypted data packet in the same group is padded with the header data of the next encrypted data packet in the same group, so that each data packet is padded to a 188-byte restored data packet. Starting from the content of the restored data packet padded to 188 bytes, the padded data packet is restored to the original transport stream.
[0011] A storage medium storing a computer program, which, when executed by a processor, implements the above-described program encryption method.
[0012] A storage medium storing a computer program, which, when executed by a processor, implements the above-described program encryption method.
[0013] A program encryption server, comprising: The first acquisition module is used to acquire the raw transport stream of the program; The encryption module is used to repackage all the data of the original transport stream as program data into a new encrypted transport stream. The stream type and program identifier in the PMT table of the encrypted transport stream are set according to a preset encryption protocol, and the value of the stream type in the program mapping table of the encrypted transport stream is an undefined non-standard value. The transmission module is used to output the encrypted transmission stream to a signal modulation device to modulate it into a digital television signal, and then transmit it to the user area through a signal transmission tower.
[0014] A set-top box includes: a second acquisition module for receiving and acquiring a program stream; a decoding module for decoding the acquired program stream and a restored original transport stream, extracting the PAT table and PMT table of the program stream or the original transport stream, and extracting data of a target program based on the PAT table and PMT table; and a decryption and restoration module for parsing the PMT table of the program stream, obtaining the PID of encrypted data, extracting encrypted data based on the PID of the encrypted data, and restoring the encrypted data to the original transport stream when the stream type in the PMT table of the program stream conforms to a preset encryption protocol configuration.
[0015] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. Attached Figure Description
[0016] Figure 1 This is a flowchart of a program encryption method according to an embodiment of the present invention.
[0017] Figure 2 This is a flowchart illustrating the encapsulation process of the encrypted transport stream according to an embodiment of the present invention.
[0018] Figure 3 This is a flowchart of a program decryption method according to an embodiment of the present invention.
[0019] Figure 4 This is a schematic diagram of the system consisting of a program encryption server and a set-top box, according to an embodiment of the present invention. Detailed Implementation
[0020] The embodiments of the present invention are described in detail below, with reference to... Figure 1 The present invention provides a program encryption method, comprising the following steps: Obtain the raw streaming stream of the program; All data from the original transport stream is repackaged as program data into a new encrypted transport stream. The stream type (stream_type) and program identifier (elementary_PID) in the PMT (Program Mapping) table of the encrypted transport stream are set according to the preset encryption protocol. The value of the stream type in the PMT table of the encrypted transport stream is an undefined non-standard value. The encrypted transport stream is modulated into a digital television signal and transmitted to the user area via a signal tower.
[0021] This program encryption method involves re-encapsulating the original transport stream as program data into a new encrypted transport stream. The stream type value of the encrypted transport stream is set to an undefined, non-standard value, essentially set to user private data, ranging from 0x80 to 0xFF. This means that even if the encrypted transport stream can be accepted by all devices compliant with the DVB standard, it cannot be searched or identified by devices without an encryption protocol because it lacks program information. If a hacker wants to crack a program encrypted using this method, they would also need to crack the encapsulation protocol, thus increasing the difficulty of cracking the encrypted program, improving its security, and reducing losses for the operator.
[0022] It is understood that the stream type can be any value in the range of 0x80 to 0xFF, and the program identifier can be any value. The value of the program identifier should preferably be different from other known program identifier values. The specific values of the stream type and the program identifier are determined by a preset encryption protocol. For example, in this embodiment, the value of the stream type of the encrypted transport stream is uniformly set to 0x99, and the value of the program identifier is uniformly set to 0x331.
[0023] In some embodiments, to further enhance the security of encrypted programs, the data of the original transport stream can be encrypted using encryption algorithms such as the symmetric encryption algorithm 3DES before the original transport stream data is re-encapsulated as user private data into an encrypted transport stream.
[0024] Understandably, according to the transport stream standard, each data packet in a transport stream consists of 188 bytes, with the first 4 bytes being the header. Therefore, during secondary encapsulation, each data packet in the encapsulated encrypted transport stream can only store 184 bytes of the original transport stream data packet. Thus, during secondary encapsulation, two buffers, buffer1 and buffer2, are needed. Buffer1 temporarily stores the original transport stream data packets, while buffer2 temporarily stores the remaining bytes of data from the secondary encapsulation. In other words, each data packet in the secondary encapsulated encrypted transport stream includes only one data packet from the original transport stream or a portion of two adjacent data packets. (Refer to...) Figure 2 Specifically, the secondary encapsulation process of the encrypted transmission stream includes the following steps: Store one data packet from the original transport stream into buffer1 in sequence; The data in buffer1 is encrypted using the symmetric encryption algorithm 3DES with a preset 8-byte fixed key. Create two new data packets, package1 and package2, and initialize them. According to the standard of the transport stream, fill the first 4 bytes of each data packet with the preset encryption protocol. Read 188 bytes of data from buffer1, and use the read data to fill the remaining 184 bytes of package1 in the two newly created data packets. Store the remaining 4 bytes of data from the read data into buffer2. Read the remaining 4 bytes of data from buffer2, and use the read data to fill the remaining 184 bytes of package2 in the two newly created data packets; Then, one data packet from the original transport stream is stored into buffer1 in sequence; The data in buffer1 is encrypted using the symmetric encryption algorithm 3DES with a preset 8-byte fixed key. Create a new data packet package3 and initialize the new data packet. According to the standard of the transport stream, fill the first 4 bytes of the data packet according to the preset encryption protocol. Read 188 bytes of data from buffer1, and use the read data to fill the remaining 180 bytes of package2 in the two newly created data packets. Store the remaining 8 bytes of data from the read data into buffer2. Read the remaining 8 bytes of data from buffer2 and use the read data to fill the remaining 184 bytes of the newly created package3; The process then repeats, reading a data packet from the original transport stream and storing it in buffer1. The data in buffer1 is encrypted, and new data packets package4, package5, and so on, package6, are created. The remaining 184 bytes of the newly created data packets are filled with data from buffer1, and the remaining data is temporarily stored in buffer2. The data from buffer2 is then used to fill the next 184 bytes of the data packet. Since 46 times 4 equals 184, when buffer2 is read for the 46th time, it contains exactly 184 bytes of data, enough to fill the most recently created data packet. At this point, exactly 47 encrypted transport stream data packets have been created. These 47 encrypted transport stream data packets can carry the complete data from the 46 original transport stream data packets. The start flag (playload_unit_start) in the first four bytes of the latest data packet is then set to 1 to facilitate the set-top box's reconstruction of the original transport stream. In the secondary encapsulation process, a counter is set to count the number of times buffer2 is read. Whenever the number of reads of buffer2 equals 46, the start mark of the content of the most recently created data packet is set to 1, the count value of the counter is reset, and two more data packets are created to continue the secondary encapsulation of the original transport stream data packets.
[0025] When no new data arrives in buffer1, it is determined that the original transport stream has been completely encapsulated into an encrypted transport stream. At this point, all data packets are combined into a data stream, and PAT (Program Association) and PMT packets are configured according to a preset encryption protocol. Based on the transport stream standard, PAT and PMT packets are periodically inserted into the data stream to form the encrypted transport stream. In this embodiment of the program encryption method, because the data from the original 46 data packets in the original transport stream is encapsulated into data packets of 47 encrypted transport streams after secondary encapsulation, the data in any data packet of any encrypted transport stream is incomplete and cannot be parsed by devices without a preset encryption protocol, further increasing the difficulty of cracking encrypted programs and improving the security of encrypted programs.
[0026] Reference Figure 3 Based on the same inventive concept, embodiments of the present invention also propose a program decryption method, comprising the following steps: Receive and parse the program stream to obtain the PMT table of the program stream; The program stream is determined to be encrypted based on whether the stream type in the PMT table conforms to the preset encryption protocol configuration. If the program stream is encrypted, the PMT table is parsed to obtain the PID of the encrypted data. Extract encrypted data based on the PID of the encrypted data, and restore the encrypted data to the original transport stream; The raw transport stream is parsed to obtain the data for the target program.
[0027] This method uses a pre-set encryption protocol within the set-top box to identify programs in the received program stream that employ the aforementioned encryption method, based on the stream type value set in the encryption protocol. It then re-encapsulates the original program stream as user private data into encrypted data packets within the encrypted program stream. If the program is encrypted, the set-top box does not directly parse the program stream. Instead, it first filters out the encrypted data packets of the program based on the PID of the encrypted data recorded in the PMT table, then restores the filtered encrypted data packets to the original transport stream, and finally parses the original transport stream to obtain the target program data.
[0028] Understandably, if the stream type of the received program stream is inconsistent with the preset value in the encryption protocol, then the program stream is an unencrypted program stream, and the target program data in the program stream is extracted according to the normal parsing process.
[0029] Understandably, since each data packet in the encrypted transport stream only includes a portion of the data from one or two adjacent packets in the original transport stream, it is necessary to reassemble the encrypted data in the filtered encrypted data packets to recover the original program stream. Specifically, the recovery process of the original transport stream includes the following steps: First, filter the encrypted data packets based on the PID of the encrypted data; Then, based on the start marker of the content in the encrypted data packets, the filtered encrypted data packets are divided into several groups. Since, according to the program encryption method described above, every 47 encrypted transport stream data packets can perfectly accommodate the content of 46 original transport stream data packets, and the start marker of the content in the encrypted data packets in the encrypted transport stream is set according to the number of reads of buffer2, grouping the encrypted data packets according to the start marker of the content in the encrypted data packets can precisely divide the filtered encrypted data packets into several groups, each group containing at most 47 encrypted data packets. Each group can precisely include the content of the original transport stream data packets of an integer number of programs, thereby avoiding the restoration of data packets that do not belong to the same program into a single data packet during restoration, which would lead to errors in the extracted target program data.
[0030] Subsequently, the first 4 bytes of each encrypted data packet are removed. These 4 bytes are headers added during secondary encapsulation according to the TS stream standard, and are not data from the original transport stream of the original program. The remaining data of the previous encrypted data packet in the same group is padded with the header data of the next encrypted data packet in the same group, so that each data packet is padded to a 188-byte restored data packet. Starting from the content of the restored data packet padded to 188 bytes, the padded data packet is restored to the original transport stream.
[0031] In some embodiments, to further enhance the security of encrypted programs, the data of encrypted programs may be encrypted by an encryption algorithm and then repackaged. Therefore, after the restored data packet is recovered, it is also necessary to decrypt the restored data packet according to the fixed key pre-stored in the set-top box.
[0032] Based on the same inventive concept, embodiments of the present invention also provide a storage medium storing a computer program, which, when executed by a processor, implements the above-described functions.
[0033] In some possible implementations, various aspects of the program encryption or decryption method provided by the present invention can also be implemented in the form of a program product, which includes program code that, when the program product is run on a device, causes the control device to perform the steps in the program encryption or decryption method according to the various exemplary embodiments of the present application described above.
[0034] By designing and programming the processor, the code corresponding to the program encryption or decryption methods described in the foregoing embodiments can be embedded into the chip, enabling the chip to execute the steps of the program encryption or decryption methods shown in the embodiments of this invention during operation. How to design and program the processor is a technique well-known to those skilled in the art and will not be elaborated upon here.
[0035] Based on the same inventive concept, embodiments of the present invention also provide a program encryption server. The program encryption server may include a memory, a controller, and a data bus. The controller is communicatively connected to the memory via the data bus. The controller can implement the above-described program encryption method by calling and executing a computer program stored in the memory. Specifically, refer to... Figure 4 The controller of the program encryption server can implement the first acquisition module, encryption module, and transmission module by calling and executing computer programs stored in memory. The first acquisition module is used to acquire the original transport stream of the program from the transport stream sending server. The encryption module is used to repackage all the data from the original transport stream received by the first acquisition module as program data into a new encrypted transport stream. The stream type and program identifier in the PMT table of the encrypted transport stream are set according to a preset encryption protocol, and the stream type value in the program mapping table of the encrypted transport stream is an undefined non-standard value. The transmission module is used to output the encrypted transport stream, after secondary encapsulation by the encryption module, to the data upload center. The signal modulation equipment in the data upload center modulates it into a digital television signal and transmits it to the user area via a signal transmission tower in the form of wired or wireless signals.
[0036] Based on the same inventive concept, embodiments of the present invention also provide a set-top box, which may also include a memory, a controller, and a data bus. The set-top box's memory stores a preset encryption protocol and a fixed key, as described below. Figure 4 The set-top box controller can implement the second acquisition module, decoding module, and decryption / restoration module by calling and executing computer programs stored in the memory. The second acquisition module receives the program stream restored from the digital television signal from the set-top box's signal demodulation module. The decoding module decodes the acquired program stream, or the original transport stream restored from a program stream encrypted using the aforementioned program encryption method, and extracts the target program data based on the PAT table and PMT table of the program stream or original transport stream, so that the set-top box can send the video and audio data of the program to terminal devices such as televisions for playback. The decryption / restoration module, when the stream type in the program stream's PMT table matches the configuration of the preset encryption protocol in the memory, parses the PMT table of the program stream to obtain the PID of the encrypted data of the encrypted program, filters and extracts the encrypted data based on the PID, restores the encrypted data to the original transport stream, and then sends the restored original transport stream to the decoding module for extraction of the target program data.
[0037] In one possible design, the processor may include one or more processing units. The processor and memory may be implemented on the same chip or on separate chips. The processor may be a general-purpose processor, such as a central processing unit (CPU), digital signal processor, application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the program encryption or decryption methods disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
[0038] Memory, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory can include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic memory, magnetic disk, optical disk, etc. Memory is any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited to this. The memory in the embodiments of this application can also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.
[0039] The program encryption set-top box and set-top box of the present invention can be configured as follows: Figure 4 In the aforementioned digital television system, for programs that require encryption, the program encryption server re-encapsulates the program that needs encryption in the transmission stream sending server into an encrypted transmission stream without program information. This ensures that the encrypted program information can only be searched and identified by set-top boxes with a pre-set encryption protocol and defined as encrypted program data. This increases the difficulty of cracking encrypted programs, enhances the security of encrypted programs, and reduces losses for digital program operators.
[0040] It should be noted that in the description of this invention, "several" means one or more, "more than" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. If "first" or "second" is mentioned, it is only for the purpose of distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.
[0041] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0042] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0043] These computer program instructions can also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0044] In the description of this invention, unless otherwise explicitly defined, terms such as "set up," "install," and "connect" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this invention in conjunction with the specific content of the technical solution.
[0045] The above embodiments are merely preferred embodiments of the present invention and should not be construed as limiting the scope of protection of the present invention. Any non-substantial changes and substitutions made by those skilled in the art based on the present invention shall fall within the scope of protection claimed by the present invention.
Claims
1. A program encryption method, characterized in that, include: Obtain the raw streaming stream of the program; All data from the original transport stream is repackaged as program data into a new encrypted transport stream. The stream type and program identifier in the PMT table of the encrypted transport stream are set according to the preset encryption protocol. The value of the stream type in the PMT table of the encrypted transport stream is an undefined non-standard value. The encrypted transport stream is modulated into a digital television signal and transmitted to the user area via a signal tower.
2. The program encryption method according to claim 1, characterized in that, Also includes: The program data in the encrypted transport stream is encrypted using an encryption algorithm.
3. The program encryption method according to claim 1, characterized in that, The step of repackaging all data from the original transport stream as program data into a new encrypted transport stream, wherein the stream type and program identifier in the PMT table of the encrypted transport stream are set according to the predicted encryption protocol, and the value of the stream type in the PMT table of the encrypted transport stream is an undefined non-standard value, includes: One data packet from the original transport stream is stored into the first buffer sequentially; Create several new data packets and initialize them by filling the first 4 bytes of each data packet according to the preset encryption protocol; Read 188 bytes of data from the first buffer, use the read data to fill the remaining bytes of the earliest newly created but not filled data packet, and store the remaining bytes of the read data into the second buffer; Read the remaining bytes of data from the second buffer and use the read data to fill the remaining bytes of the earliest newly created, unfilled data packet; Record the number of reads from the second buffer. When the number of reads equals 46, set the start flag of the last newly created data packet to 1. Repeat the above steps until no new data arrives in the first buffer; All data packets are combined into a data stream, and PAT and PMT packets are configured according to a preset encryption protocol. PAT and PMT packets are periodically inserted into the data stream to form an encrypted transmission stream.
4. The program encryption method according to claim 3, characterized in that, After the step of storing a data packet of the original transport stream into the first buffer in sequence, the method further includes: The data in the first buffer is encrypted using the encryption algorithm.
5. A program decryption method, characterized in that, Includes the following steps; Receive and parse the program stream to obtain the PMT table of the program stream; The program stream is determined to be encrypted based on whether the stream type in the PMT table conforms to the preset encryption protocol configuration. If the program stream is encrypted, the PMT table is parsed to obtain the PID of the encrypted data. Extract encrypted data based on the PID of the encrypted data, and restore the encrypted data to the original transport stream; The raw transport stream is parsed to obtain the data for the target program.
6. The program decryption method according to claim 5, characterized in that, The step of extracting encrypted data based on the PID of the encrypted data and restoring the encrypted data to the original transport stream includes: Filter encrypted data packets based on the PID of the encrypted data; The filtered encrypted data packets are divided into several groups based on the content of the encrypted data packets. Remove the first 4 bytes of each encrypted data packet; The remaining data of the previous encrypted data packet in the same group is padded with the header data of the next encrypted data packet in the same group, so that each data packet is padded to a 188-byte restored data packet. Starting from the content of the restored data packet padded to 188 bytes, the padded data packet is restored to the original transport stream.
7. A storage medium storing a computer program, characterized in that, When the computer program is invoked and executed by the processor, it implements the program encryption method according to any one of claims 1 to 4.
8. A storage medium storing a computer program, characterized in that, When the computer program is invoked and executed by the processor, it implements the program encryption method according to claim 5 or 6.
9. A program encryption server, characterized in that, include: The first acquisition module is used to acquire the raw transport stream of the program; The encryption module is used to repackage all the data of the original transport stream as program data into a new encrypted transport stream. The stream type and program identifier in the PMT table of the encrypted transport stream are set according to a preset encryption protocol, and the value of the stream type in the program mapping table of the encrypted transport stream is an undefined non-standard value. The transmission module is used to output the encrypted transmission stream to a signal modulation device to modulate it into a digital television signal, and then transmit it to the user area through a signal transmission tower.
10. A set-top box, characterized in that, include: The second acquisition module is used to receive and acquire program streams; The decoding module is used to decode the obtained program stream and the restored original transport stream, extract the PAT table and PMT table of the program stream or the original transport stream, and extract the data of the target program based on the PAT table and PMT table. The decryption and restoration module is used to parse the PMT table of the program stream, obtain the PID of the encrypted data, extract the encrypted data according to the PID of the encrypted data, and restore the encrypted data to the original transport stream when the stream type in the PMT table of the program stream conforms to the configuration of the preset encryption protocol.