CN-121985155-A - Program encryption method, decryption method, storage medium and related devices
Abstract
The invention relates to the technical field of digital televisions and discloses a program encryption method, a decryption method, a storage medium and a related device, wherein the program encryption method comprises the following steps of obtaining an original transmission stream of a program, repackaging all data of the original transmission stream into a new encrypted transmission stream, setting stream types and program identifications in a PMT (program table) of the encrypted transmission stream according to a preset encryption protocol, enabling values of the stream types in the PMT of the encrypted transmission stream to be undefined non-standard values, modulating the encrypted transmission stream into a digital television signal, and sending the digital television signal to a user area through a signal transmitting tower. According to the method, the transmission stream of the program to be encrypted is secondarily packaged into the encrypted transmission stream without program information, so that the encrypted program stream cannot be searched and identified by equipment without a preset encryption protocol, the cracking difficulty and the safety of the encrypted program are improved, and the loss of a digital television program operator is reduced.
Inventors
- HOU DAPING
- WU TAO
- ZHANG DAWEI
Assignees
- 珠海迈科智能科技股份有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260129
Claims (10)
- 1. A program encryption method, comprising: acquiring an original transport stream of a program; Repackaging all data of the original transport stream as program data into a new encrypted transport stream, wherein the stream type and the program identifier in a PMT table of the encrypted transport stream are set according to a preset encryption protocol, and 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 a user area through a signal transmitting tower.
- 2. The program encryption method according to claim 1, characterized by further comprising: Program data in the encrypted transport stream is encrypted by an encryption algorithm.
- 3. The program encryption method according to claim 1, wherein the step of repackaging all data of the original transport stream as program data into a new encrypted transport stream, the stream type and the program identification in the PMT table of the encrypted transport stream being set in accordance with the predicted encryption protocol, the value of the stream type in the PMT table of the encrypted transport stream being an undefined non-standard value, comprises: storing a data packet of the original transport stream into a first buffer area in sequence; a plurality of data packets are newly built, the newly built data packets are initialized, and the first 4 bytes of each data packet are filled according to a preset encryption protocol; reading 188 bytes of data from the first buffer area, filling the residual bytes of the earliest newly-built unfilled data packet by using the read data, and storing the residual bytes in the read data into the second buffer area; Reading the data of the residual bytes from the second buffer area, and filling the residual bytes of the earliest newly-built unfilled data packet by using the read data; recording the reading times of the second buffer area, and setting the content start mark of the last newly built data packet to be 1 when the reading times are equal to 46; repeating the steps until no new data arrives in the first buffer area; all data packets are formed into a data stream, PAT and PMT packets are configured according to a preset encryption protocol, and the PAT and PMT packets are periodically inserted into the data stream to form an encrypted transport stream.
- 4. A program encryption method according to claim 3, wherein after the step of storing a packet of the original transport stream in the first buffer in order, the method further comprises: the data in the first buffer area is encrypted by an encryption algorithm.
- 5. A program decryption method, characterized by comprising the steps of; Receiving and analyzing a program stream to obtain a PMT table of the program stream; judging whether the program stream is encrypted according to whether the stream type in the PMT table accords with the configuration of a preset encryption protocol, if so, analyzing the PMT table to obtain the PID of the encrypted data; Extracting the encrypted data according to the PID of the encrypted data, and restoring the encrypted data into an original transport stream; And analyzing the original transport stream to obtain the data of the target program.
- 6. The program decrypting method as claimed in claim 5, wherein the step of extracting the encrypted data based on the PID of the encrypted data and restoring the encrypted data to the original transport stream comprises: filtering the encrypted data packets of the encrypted data according to the PID of the encrypted data; dividing the filtered encrypted data packets into a plurality of groups according to content start marks in the encrypted data packets; removing the first 4 bytes of each encrypted data packet; supplementing the residual data of the previous encrypted data packet of the same group by utilizing the head data of the next encrypted data packet of the same group, and supplementing each data packet to be a recovered data packet of 188 bytes; And restoring the restored data packet after the complementation into the original transmission stream according to the content start mark in the restored data packet with the complementation of 188 bytes.
- 7. A storage medium storing a computer program which, when invoked by a processor for execution, implements the program encryption method according to any one of claims 1 to 4.
- 8. A storage medium storing a computer program which, when invoked by a processor for execution, implements the program encryption method according to claim 5 or 6.
- 9. A program encryption server, comprising: The first acquisition module is used for acquiring an original transport stream of the program; The encryption module is used for repackaging all data of the original transport stream into a new encrypted transport stream, wherein the stream type and the program identifier in a PMT table of the encrypted transport stream are set according to a preset encryption protocol, and the value of the stream type in a program mapping table of the encrypted transport stream is an undefined non-standard value; and the transmission module is used for outputting the encrypted transport stream to the signal modulation equipment to be modulated into a digital television signal, and sending the digital television signal to the user area through the signal transmitting tower.
- 10. A set top box, comprising: The second acquisition module is used for receiving and acquiring the program stream; A decoding module, configured to decode the obtained program stream and the restored original transport stream, extract a PAT table and a PMT table of the program stream or the original transport stream, and extract data of a target program according to the PAT table and the PMT table; and the decryption recovery module is used for analyzing the PMT table of the program stream to obtain the PID of the encrypted data when the stream type in the PMT table of the program stream accords with the configuration of the preset encryption protocol, extracting the encrypted data according to the PID of the encrypted data, and recovering the encrypted data into the original transport stream.
Description
Program encryption method, decryption method, storage medium and related devices Technical Field The invention relates to the technical field of digital televisions, in particular to a program encryption method, a program decryption method, a storage medium and related devices. Background After video coding and transcoding, a digital television program operator pushes a program (TS) stream to a data uploading center according to the DVB standard, the program is transmitted to a user area through a ground signal, a cable signal and a satellite signal, and a user receives the signal by using a set top box and searches the program for watching by using the set top box. In order to avoid the theft of the content of the pay program, the conventional digital television program operator generally adopts a special encryption algorithm to encrypt video and audio data in the program stream, so that only the set top box preloaded with the corresponding key can decrypt the data in the encrypted program stream, thereby obtaining the original program video and audio data. However, in this way, the encrypted program can still be received and searched by all devices conforming to the DVB standard, and the encrypted data is analyzed to realize cracking of the program, which causes loss to the operator. For this reason, a new encryption method of digital television programs needs to be designed to better protect the programs of operators. Disclosure of Invention In order to overcome the defects of the prior art, the invention aims to provide the theme name program encryption method which can improve the safety of encrypted programs, improve the cracking difficulty of the encrypted programs and prevent the paid program content of operators from being stolen and cracked. In order to solve the problems, the technical scheme adopted by the invention is as follows: acquiring an original transport stream of a program; Repackaging all data of the original transport stream as program data into a new encrypted transport stream, wherein the stream type and the program identifier in a PMT table of the encrypted transport stream are set according to a preset encryption protocol, and 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 a user area through a signal transmitting tower. Compared with the prior art, the encryption method has the advantages that the original transmission stream is secondarily packaged into the new encryption transmission stream as the program data, and the value of the stream type of the encryption transmission stream is set to be undefined non-standard value, namely user private data, so that even if the encryption transmission stream can be received by all devices conforming to the DVB standard, the encryption transmission stream cannot be searched by the devices without preset corresponding encryption protocols due to no program information, and if a hacker wants to crack an encryption program, the package protocol also needs to be cracked, so that the cracking difficulty of the encryption program is improved, the safety of the encryption program is improved, and the loss of operators is reduced. The program encryption method further comprises the following steps: Program data in the encrypted transport stream is encrypted by an encryption algorithm. In the above program encryption method, the step of repackaging all data of the original transport stream as program data into a new encrypted transport stream, wherein the stream type and the 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, and the step of repackaging the stream type and the program identifier in the PMT table of the encrypted transport stream comprises: storing a data packet of the original transport stream into a first buffer area in sequence; storing a data packet of the original transport stream into a first buffer area in sequence; a plurality of data packets are newly built, the newly built data packets are initialized, and the first 4 bytes of each data packet are filled according to a preset encryption protocol; reading 188 bytes of data from the first buffer area, filling the residual bytes of the earliest newly-built unfilled data packet by using the read data, and storing the residual bytes in the read data into the second buffer area; Reading the data of the residual bytes from the second buffer area, and filling the residual bytes of the earliest newly-built unfilled data packet by using the read data; recording the reading times of the second buffer area, and setting the content start mark of the last newly built data packet to be 1 when the reading times are equal to 46; repeati