Methods and apparatus for scrambling and unscrambling compressed data streams5285497Abstract Methods and apparatus for encoding compressed data streams efficiently, and methods and apparatus for decoding the encrypted data streams efficiently and inexpensively, are disclosed. In an encoder 10', an incoming data stream is fed to a Huffman coding block 10 that performs data compression. The output codewords of the Huffman coding block are fed to a forward error correction block 30, the output of which is a series of data blocks and associated parity data. The data blocks are fed to an error insertion block 32, which inserts a one-bit error in each data block. The parity data is fed to a first encryption block 34 that produces encrypted parity data. The output of the error insertion block 32, the encrypted parity data, and a synchronization word output by a sync generator 50 are fed to a multiplexer 48. A seed generator block 36 generates random numbers for use by the first encryption block 34 as seeds for encrypting the parity data. A multisession key register 40 stores a multisession key employed as a seed in a second encryption block 38 to encrypt the random number seed. A secret serial number (SSN) read from a database 46 and stored in an SSN register 44 is employed by a third encryption block 42 as a seed for encrypting the multisession key. The multiplexer outputs a multiplex comprising the sync signal, SDP, ADP, and Reed-Solomon data blocks with their corresponding parity data. A decoder 14' receives the multiplex data and recovers the original data. Claims What is claimed is: Description FIELD OF THE INVENTION
______________________________________
HUFFMAN TABLE
Symbol Codeword
______________________________________
0 0
-1 100
-2 101
+2 110
-3 11100
+1 11101
+7 11110
______________________________________
In a digital video system, identical code books, typically stored in read only memory, are employed at the data encoder and decoder locations. The decoder is able to separate the received codewords to perform the decompression process, despite the fact that the codewords are of variable lengths, because only prescribed symbols are allowed. For example, if the bits "0100101" were received, the decoder would be able to separate this received data stream into the codewords "0", "100", and "101". Typically, a synchronization pattern is employed to separate large groups of codewords. However, the decoder still must be able to separate the individual codewords between the synchronization patterns. Thus, the most efficient compression is obtained when variable length coding (VLC) is used. However, because of the variable codeword lengths, if a single bit error occurs, the Huffman decoder will lose synchronization and be unable to recover any data following the error. For example, if the data stream "0100101" were changed to "1100101" due to an erroneous inversion of the first bit, the decoder would be unable to decide whether the received data stream should be interpreted as "1100", "101" (two distinct codewords), or "110", "0", "101" (three distinct codewords). In view of the problems associated with decoding variable length codewords in most real world environments, where bit errors are likely, forward error correction (FEC) should be employed to detect and correct errors before Huffman coding is performed. For example, the Reed-Solomon algorithm is a well known FEC technique whereby parity data is computed and transmitted with data blocks of a prescribed length. The parity data enables the decoder to detect and correct errors in the codewords before decompressing the codewords to recover the original data. Theft is also a serious problem in the pay television world. Thieves have been known to illegally decode program data with home made or stolen decoders. Highly sophisticated encryption techniques for scrambling the program data before it is distributed to cable television operators and individual subscribers are known. For example, the Data Encryption Standard (DES), described in NBS, Data Encryption Standard (FIPS Publication 46), National Bureau of Standards, U.S. Department of Commerce, Washington, D.C. (January, 1977)), and the Rivest-Shamir-Adleman (RSA) scheme, described in R. L. Rivest, A. Shamir, and L. Adleman, A Method of Obtaining Digital Signatures and Public-key Cryptosystems, Communications of the ACM 21(2), pp. 120-126 (February, 1978)), are well known. However, decryption of high speed data requires complex, specially designed circuitry, usually in the form of application specific integrated circuits (ASICs). The ASICs are expensive but are needed to perform decryption rapidly, in real time. Therefore, the benefit gained by employing encryption to deter program theft is offset by the cost incurred by the decryption circuitry. Accordingly, a primary goal of the present invention is to provide methods and apparatus for encrypting digital data streams in a manner that enables decryption in real time with inexpensive hardware. SUMMARY OF THE INVENTION The present invention provides methods and apparatus for encoding compressed data streams efficiently, and methods and apparatus for decoding the encrypted data streams efficiently and inexpensively. Methods for encoding data in accordance with the present invention comprise the steps of: compressing an incoming data stream into variable length codewords; generating error correction parity data for the codewords; introducing an error into the codewords; encrypting the parity data; and transmitting the codewords and encrypted parity data. A preferred embodiment of the present invention further comprises the steps of generating a seed for encrypting the parity data, encrypting the seed, and transmitting the encrypted seed as a system data packet (SDP). In addition, embodiments of the invention may include the steps of employing a multisession key to encrypt the seed, encrypting the multisession key, and transmitting the encrypted multisession key as an addressable data packet (ADP). Embodiments of the invention may also include the step of employing a secret serial number (SSN) to encrypt the multisession key. The encrypted parity data may advantageously be transmitted before the codewords are transmitted. This provides the decoder more time to decrypt the parity data, and is useful in that the decrypted parity data is required by the decoder when correcting the deliberate error in the program data. In addition, the step of generating error correction parity data may advantageously employ a Reed-Solomon forward error correction process, whereby parity words and associated data blocks are generated. The step of encrypting the parity data may comprise inserting one error per Reed-Solomon data block, and the step of compressing an incoming data stream into variable length codewords may employ Huffman coding to generate variable length Huffman codewords. Preferred embodiments may also include the steps of generating a synchronization word; multiplexing the synchronization word with the codewords and encrypted parity data before transmitting the codewords and encrypted parity data; and transmitting the multiplexed data. The present invention also provides encoders including means for carrying out the above-described methods. In one preferred embodiment, the first, second, and third decryption means, and the means for storing an SSN, are embodied in a secure microprocessor, making it extremely difficult for an unauthorized person to discover the SSN and decryption processes. The present invention also provides methods and apparatus for decoding the encrypted data. According to the invention, a decoder receives an incoming data stream and demultiplexes the data stream into variable length codewords representing a compressed data stream, encrypted parity data, a system data packet (SDP) defining an encrypted seed, and an addressable data packet (ADP) defining an encrypted multisession key. The ADP is then decrypted to derive the multisession key; the SDP is decrypted in accordance with the multisession key to derive the seed; the parity data is decrypted in accordance with the seed; errors in the codewords are corrected in accordance with the decrypted parity data; and a decompressed data stream is generated in accordance with the corrected codewords. Thus, in preferred embodiments of the invention, a deliberate error is added to the Huffman codewords in the encoder and the associated FEC parity bytes are encrypted. The parity bytes are much smaller than the coded data, and thus can be decrypted off-line in a microprocessor. Consequently, decryption of high-speed program data is accomplished effectively by background decryption of the FEC parity bytes, enabling the FEC means in the decoder to correct the deliberate error. The present invention simplifies encryption and decryption of high-speed program data by employing the FEC system and hardware, which is typically used for correction of noise-induced errors, for an additional purpose: to provide conditional access to the program data. Off-line (or background, or non-real time) hardware can be used to perform real time decryption of the high-speed program data. Decoder cost may therefore be significantly reduced. Other features and advantages of the present invention are disclosed below. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a schematic representation of a digital television system comprising an encoder 10, a digital channel 12, and a decoder 14. FIG. 2 is a block diagram of an encoder 10' in accordance with the present invention. FIG. 3 is a block diagram of a decoder 14' in accordance with the present invention. DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS FIG. 2 schematically depicts one embodiment of an encoder 10' in accordance with the present invention. As shown, an incoming data stream is fed to a Huffman coding block 10 that performs data compression. The output codewords of the Huffman coding block are fed to a Reed-Solomon forward error correction block 30, the output of which is a series of data blocks and associated parity data. The data blocks are fed to an error insertion block 32, which inserts a one-bit error in each data block. The parity data is fed to a first encryption block 34 that employs a known encryption algorithm, e.g., the DES algorithm, to produce encrypted parity data. The output of the error insertion block 32, the encrypted parity data, and a synchronization word output by a sync generator 50 are fed to a multiplexer 48. In addition, a seed generator block 36 generates random numbers for use by the first encryption block 34 as seeds for encrypting the parity data. A multisession key register 40 stores a multisession key employed as a seed in a second encryption block 38 to encrypt the random number seed. The encrypted random number seed is referred to herein as a system data packet (SDP). A secret serial number (SSN) read from a database 46 and stored in an SSN register 44 is employed by a third encryption block 42 as a seed for encrypting the multisession key. The encrypted multisession key output by the third encryption block 42 is referred to herein as an addressable data packet (ADP). As shown, the SDP and ADP are also fed to the multiplexer 48. The multiplexer outputs a multiplex comprising the sync signal, SDP, ADP, and Reed-Solomon data blocks with their corresponding parity data. In one example of the present invention, the random number seed changes at a rate of eight times per second; the multisession key is changed at a rate of one time per month; and the secret serial number is a fixed number stored in the database 46. There is a unique SSN for each authorized decoder in the system. FIG. 3 schematically depicts one embodiment of a decoder in accordance with the present invention. As shown, multiplex data 52 is received and fed to a demultiplexer 54, which separates out the Huffman data, encoded parity data, SDP, and ADP. The Huffman data blocks are fed to a Reed-Solomon FEC block 56, which outputs corrected Huffman data. Since the FEC block 56 requires decrypted parity data to perform error correction on the program data, the encrypted parity data is fed to a first decryption block 58, which decrypts the parity data in accordance with the decryption process corresponding to the encryption process employed by the encoder. The first decryption block 58 employs the random number seed generated by the random number generator of the encoder. Thus, the SDP (which is the encrypted version of the random number seed) must also be decrypted to obtain the random number seed. To decrypt the SDP, the ADP is decrypted to produce the multisession key, the latter being employed as a seed in a second decryption block 60. The ADP is decrypted by employing the decoder's secret serial number, which is stored in memory 64 inside the decoder, as a seed for a third decryption block 62. The output of the Reed-Solomon FEC block 56 is a series of compressed but corrected Huffman codewords. The corrected Huffman codewords are fed to a Huffman decoder 14, which employs a lookup table 16 to produce the original compressed data. In preferred embodiments of the invention, the first, second and third decryption blocks, as well as the decoder's secret serial number, are embodied in a secure microprocessor, for example, a Motorola SC21 or SC27 secure microprocessor. Such a microprocessor has a limited number of pins (e.g., six) and employs extraordinary measures to prevent an unauthorized person from discovering the SSN or the decryption procedures employed in the decoder. It will be appreciated by those skilled in the art that changes could be made to the embodiments described herein without departing from the inventive concepts thereof. For example, the present invention is not limited to systems employing any particular encryption technique (e.g., DES) or compression technique (e.g., Huffman coding), although the invention is especially well suited for systems employing variable length coding, since the latter systems must employ forward error correction. In addition, embodiments of the invention may introduce more than one error into the codewords or introduce one or more errors into some but not all codewords. It is understood, therefore, that the scope of protection of the following claims is not limited to the particular embodiments disclosed, but is broad enough to encompass all modifications which are within the true scope and spirit of the invention.
|
Same subclass Same class Consider this |
||||||||||
