1. Field of the Invention
The present invention generally relates to encryption systems. More specifically, the present invention provides the encryption/decryption of data/cipher text having lengths that are not equal to a multiple of a data chunk of a block cipher system.
2. Background Art
Encryption systems enable the secure transfer of information. Stream cipher systems operate on one bit or one byte of data at a time. In contrast, block cipher systems operate on a chunk of data (i.e., more than one data bit or byte). Theoretically, block cipher systems are quicker than stream cipher systems. Accordingly, block cipher systems are frequently used to securely transfer large amounts of data.
Padding is used to increase the length of plain data when the length of the plain data is larger than a given data chunk of a block cipher system. Specifically, the size of the plain data is increased to a multiple of the data chunk. The longer, modified plain data is subsequently encrypted to produce an encrypted output. The encrypted output has a length that is larger than the length of the original unpadded data.
Many communication systems or protocols accommodate the transfer of encrypted data that is larger than the original unencrypted data. For such systems, padding enables block cipher systems to operate on plain data of any length. However, some systems and protocols impose inflexible constraints on the length of encrypted data. For example, the encrypted payload of an MPEG transport stream packet must be the same length as the original unencrypted payload. Consequently, traditional padding techniques are not applicable to these less flexible communication systems. As a result, plain data having a length that is not equal to a multiple of the data chunk is left wholly or partially unencrypted when block cipher systems are employed.
Accordingly, the present invention provides the complete encryption of data having a length not equal to a multiple of a data chunk of a block cipher algorithm. Additionally, the present invention provides the decryption of encrypted data having a length not equal to a multiple of a data chunk of a block cipher algorithm.
The present invention provides a system, method and apparatus for encrypting/decrypting plain data/cipher text having lengths not equal to a multiple of a data chunk of a block cipher algorithm. The present invention enables plain data having a length that is greater than or less than one data chunk to be encrypted to produce a corresponding encrypted version of the plain data having the same length. Further, the present invention enables cipher text having a length that is greater than or less than one data chunk to be decrypted to produce a corresponding decrypted version of the cipher text having the same length. Decryption of cipher text having a length that is greater than one data chunk uses two rounds of decryption. A first round of decryption recovers all but one portion of the original unencrypted data. The first round of decryption also recovers an indirectly encrypted portion. A second round uses the indirectly encrypted portion to recover the remaining portion of the original plain data. As a result, the original data can be reassembled.
Additional features and advantages of the invention will be set forth in the description that follows, and in part will be apparent from the description, or may be learned by practice of the invention. The advantages of the invention will be realized and attained by the structure and particularly pointed out in the written description and claims hereof as well as the appended drawings.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are intended to provide further explanation of the invention as claimed.
The accompanying drawings illustrate the present invention and, together with the description, further serve to explain the principles of the invention and to enable one skilled in the pertinent art to make and use the invention.
Encryption algorithms can be divided into two general types: symmetric encryption algorithms and public-key encryption algorithms. Symmetric encryption algorithms use the same key for encryption and decryption. Mathematically, a symmetric encryption system can be described as:
E[k,P]=C (Eq. 1)
D[k, C]=P (Eq. 2)
where P represents unencrypted data (plain data), C represents encrypted data (cipher text), k represents the encryption/decryption key, E represents the encrypt engine and D represents the decrypt engine. Equation (1) shows that the encrypt engine, E, scrambles plain data, P, according to key, k, to produce cipher text, C. Equation (2) shows that the decrypt engine, D, descrambles cipher text, C, according to the same key, k, to reproduce plain data, P.
The encryption algorithm implemented by the encrypt engine E and the decryption algorithm implemented by the decrypt engine D are typically well known or available algorithms. Therefore, the security of a symmetric encryption system is maintained by safeguarding the key k.
Public-key encryption algorithms, or asymmetric encryption algorithms, use a first key for encryption and a second key for decryption.
Mathematically, a public-key encryption system can be described as:
E[kPUB,P]=C (Eq. 3)
D[kPRV,C]=P (Eq. 4)
where kPUB represents the public key and kPRV represents the private key.
Equation (3) shows that the encrypt engine, E, scrambles plain data, P, according to the public key, kpub, to produce cipher text, C. Equation (4) shows that the decrypt engine, D, descrambles cipher text, C, according to the private key, kPRI, to reproduce plain data, P.
For public-key encryption systems, the public key kPUB is well known or available. Additionally, the encryption algorithm implemented by the encrypt engine E and the decryption algorithm implemented by the decrypt engine D are typically well known or available algorithms. Therefore, anyone can use the public key kPUB to encrypt plain data. However, only users with knowledge of the private key kPRV can decipher encrypted data.
Theoretically, symmetric key algorithms are faster than public-key algorithms. Consequently, symmetric key systems are more commonly used to encrypt/decrypt large amounts of data.
Symmetric key algorithms can be subdivided into two categories: stream cipher systems and block cipher systems. The encrypt and decrypt engines of a stream cipher system operate on one bit or one byte of data at a time. In contrast, the encrypt and decrypt engines of a block cipher system operate on a group of bits or a chunk of data at a time. The length or size of the data chunk depends on a selected algorithm. For example, the Data Encryption Standard (DES) algorithm and the Triple DES (3DES) algorithm operate on 64 bit data chunks (i.e., 8 byte data chunks) while the Advanced Encryption Standard (AES) algorithm operates on 128 bit data chunks (i.e., 16 byte data chunks).
The encrypt engine of a block cipher system can directly operate on plain data having a length equal to a multiple of a given data chunk. If the input to the encrypt engine has a length that is not a multiple of the data chunk, then the plain data is padded to increase length. Specifically, additional bits are appended to the tail of the original plain data until the total length of the plain data is exactly equal to a multiple of the data chunk. This enables the encrypt engine to operate on the plain data. The format of the padding is user-definable. For example, zero-padding or one-padding can be used.
The conventional encrypt operation illustrated in
Specifically, the cipher text 206 comprises N equal-sized portions (shown as parsed cipher text portions 206-1 through 206-N). The length of each cipher text portion 206-1 through 206-N is equal to one data chunk. The cipher text portions 206-1 through 206-N are decrypted by respective decrypt engines 108-1 through 108-N to reproduce the corresponding plain data portions 202-1 through 202-N. The recovered plain data portions 202-1 through 202-N are concatenated to reproduce the plain data 202. The plain data 202 can be considered a plain data string or vector.
The conventional multiple block cipher and decipher operations illustrated by
ECB mode enables straightforward parallelization of the encrypt engines 104-1 through 104-N and the decrypt engines 108-1 through 108-N for increased encryption and decryption performance, respectively. However, with ECB mode, a given plain data portion always maps to the same cipher text portion. This characteristic can reduce the security of an ECB block cipher system.
To enhance security, Cipher Block Chaining (CBC) can be added to the conventional encrypting and decrypting operations illustrated in
The multiple MPEG standards (e.g., MPEG-2 and MPEG-4) include rules for scrambling data at the transport stream level. Specifically, the MPEG standards specify that only the payload 408 portion of the conventional MPEG transport stream packet 402 can be encrypted. The “transport scrambling control” flag is a 2 bit field located within the packet header 404. The transport scrambling control flag specifies whether the conventional MPEG transport stream packet 402 contains encrypted data or plain data within the payload 408. If the payload 408 carries plain data, then the transport scrambling control flag is set to “0.” If the payload 408 carries encrypted data, then the transport scrambling control flag is set to a non-zero value such as “1”, “2” or “3.” The chosen non-zero value is user-definable.
As previously mentioned, when the length of plain data is not a multiple of a data chunk of an encrypt engine of a block cipher system, padding is typically used to increase the length of the plain data. For example, when the total length of plain data is less than one data chunk, padding can be added such that the total length of the plain data is exactly equal to one data chunk. Alternatively, when the total length of the plain data is greater than one data chunk but not equal to a multiple of the data chunk, padding can be added such that the total length of the plain data is exactly equal to a multiple of the data chunk.
Padding increases the length of the plain data such that the resulting encrypted plain data is larger or longer than the original, unencrypted plain data. Many cryptography applications, such as secure email or secure document transfer, are flexible and allow the length of the resulting cipher text to be longer than the length of the original plain data. However, protocols governing the transmission of MPEG packets at the transport stream level are inflexible. Because the length of each transport stream packet is fixed (188 bytes), cipher text length must be exactly the same length as unpadded plain text. Therefore, conventional padding and encrypting operations cannot be used to encrypt the plain data vector 502.
As an alternative to padding, the plain data portions 502-1 through 502-(N−1) can be encrypted by corresponding block cipher engines and the plain data portion 502-N can be left unencrypted. In doing so, a large portion of the plain data vector 502 can be encrypted while ensuring length remains constant. However, the plain data portion 502-N is transmitted in an unsecured state. In turn, the integrity of the block cipher system may be compromised. Therefore, what is needed is a mechanism by which plain data having a length not equal to a multiple of a data chunk of a block cipher engine can be fully encrypted without increasing the resulting length. Further, what is needed is a mechanism by which cipher text not equal to a multiple of a data chunk of a block decipher engine can be decrypted to reproduce plain data without any loss of information. Additionally, these encryption and decryption mechanism should work across multiple encryption algorithms and variable modes of operation.
As shown in
To produce the corresponding cipher text portion 506-N, the plain data portion 502-N is first padded to increase the length of the plain data portion 502-N. Specifically, a padding portion 512 is appended to the plain data portion 502-N such that the total length of the plain data portion 502-N and the padding portion 512 is equal to one data chunk. As shown in
The second to last cipher text portion 508 is divided into two sections:
a relevant section 506-(N−1) and an extraneous section 510. The second to last cipher text portion 508 corresponds to the input portion 502-(N−1). Further, the input portion 502-(N−1) can be considered the input portion preceding the partial input portion 502-N. The length of the relevant section 506-(N−1) is equal to a length of the plain data portion 502-N. A length of the extraneous section 510 is equal to a length of the padding portion 512. The relevant section 506-(N−1) and the extraneous section 510 are both XORed with the plain data portion 502-N and the padding portion 512 to produce, after encryption by encrypt engine 504-N, the corresponding cipher text portion 506-N. The relevant section 506-(N−1) can be considered the corresponding cipher text portion of the plain data portion 502-(N−1). As shown in
The workflow 520 depicted in
The workflow 520 can be used to fully encrypt any type of plain data such as, for example, MPEG data. Further, the encrypt engines 504-1 through 504-N can implement any type of block cipher algorithm. For example, the encrypt engines 504-1 through 504-N can be DES, 3DES or AES encrypt engines.
This enables the plain data portions 502-1 through 502-N to be encrypted in parallel. Alternatively, a single encrypt engine (e.g., the encrypt engine 504-1) can be used to iteratively encrypt the parsed plain data portions 502-1 through 502-N. In doing so, the plain data portions 502-1 through 502-N are serially encrypted.
As shown in
The intermediate output portion 604-1 is XORed with the IV 514 to reproduce the plain data portion 502-1. The parsed cipher text portion 506-2 is decrypted using decrypt engine 602-2 to produce intermediate output portion 604-2. The intermediate output portion 604-2 is XORed with the input from the previous decryption operation (i.e., the cipher text portion 506-1) to reproduce the plain data portion 502-2. This process is continued for each cipher text portion comprising the cipher text 506.
During the first round of decryption, padding is added to the cipher text portion 506-(N−1). Specifically, a padded portion 606 is appended to the cipher text portion 506-(N−1) such that the total length of the cipher text portion 506-(N−1) and the padded portion 606 is equal to one data chunk of the decrypt engine 602-(N−1). The length and composition of the padded portion 606 that of the padded portion 512. The length of the padded portion 606 can be determined since the length of the cipher text vector 506 is known.
The cipher text portion 506-(N−1) and appended padded portion 606 are decrypted using the decrypt engine 602-(N−1) to produce intermediate output portion 604-(N−1). The intermediate output portion 604-(N−1) is XORed with the input of the previous decryption operation (i.e., the plain data portion 506-(N−2)) to produce an unknown intermediate result 608. The unknown result 608 is an irrelevant portion not equal to the plain data portion 502-(N−1).
The last step of the first round of the decryption operation depicted in
The second round of decryption is used to recover the plain data portion 502-(N−1). As shown in
The combination of the cipher text portion 506-(N−1) and the extraneous portion 510 is used to reproduce the plain data portion 502-(N−1).
The extraneous portion 510, however, is not available to the decrypt engine 602-(N−1) until the conclusion of the first round of decryption. Specifically, the extraneous portion 510 is reproduced or recovered by decrypting the last cipher text portion 506-N. A second round of decryption is therefore used to decrypt the combination of the cipher text portion 506-(N−1) and the recovered extraneous portion 510. Since all other portions of the plain data vector 502 are recovered in the first round of decryption, it is not necessary to conduct any other decryption operations other than decryption of the cipher text portion 506-(N−1) and the extraneous portion 510 in the second round.
The extraneous portion 510 is not directly carried in the encrypted payload 506. The extraneous portion 510, however, is indirectly carried by the encryption payload 506. The extraneous portion 510 is indirectly carried due to the XORing of the cipher text portion 508 with the plain data portion 502-N and padded portion 512 as shown in
The workflows 600-A and 600-B can be used to fully decrypt any type of cipher text such as, for example, encrypted MPEG data. Together, the workflows 600-A and 600-B provide a termination scheme for data scrambled according to the workflow 520 depicted in
The CBC encryption workflow 520 illustrated in
As shown in
The output 706 includes a first cipher text portion 708 and a second portion 710. The cipher text 708 is considered an encrypted version of the plain data 704. The length of the cipher text 708 is equal to the length of the plain data 704. The second portion 710 is an irrelevant or extraneous portion of the cipher text 706. Consequently, the second potion 710 is ignored or discarded. The length of the second portion 710 is equal to a difference in the lengths of the plain data 704 and the initial vector 514.
The CBC encryption workflow 520 and the CBC decryption workflows 600-A and 600-B represent a termination method for encrypting data. That is, the portion of plain data that is less than the data chunk is positioned at the end of the plain data string 502 (i.e., the plain data portion 502-N). Correspondingly, the portion of cipher text created that is less than the data chunk is positioned just before the end of the cipher text vector 506 (i.e., the relevant section 506-(N−1)).
It is to be appreciated by one skilled in the relevant art(s) from the discussion herein that the CBC encryption workflow 520 and the CBC decryption workflows 600-A and 600-B can be modified to accommodate an initialization method for encrypting data. Specifically, the portion of plain data that is less than the data chunk can be positioned near the front of the plain data string 502 (i.e., the plain data portion 502-2), with all other plain data portions being complete data portions. Correspondingly, the portion of cipher text created that is less than the data chunk is positioned at the front of the cipher text vector 506 (e.g., the portion 506-1), with all other cipher text portions being full portions. The encryption and decryption described above is accordingly adjusted to support placement of the partial input portion such a position.
Further, it is to be appreciated by one skilled in the relevant art(s) from the discussion herein that the CBC encryption workflow 520 and the CBC decryption workflows 600-A and 600-B can accommodate a “generic” method for encrypting data. Specifically, the portion of plain data that is less than the data chunk can placed into any position from near the front of the plain data string 502 (i.e., the plain data portion 502-2) to the end of the plain data string 502 (i.e., the plain data portion 502-N). Accordingly, the portion of cipher text created that is less than the data chunk is correspondingly generated anywhere from the front of the cipher text vector 506 (e.g., the portion 506-1) to just before the end of the cipher text vector 506 (i.e., the relevant section 506-(N−1)). The plain data vector 502 can be parsed in any fashion (with the cipher text vector 506 parsed in a corresponding manner) to support this generic mode of encryption/decryption.
The CBC decryption workflows 600-A and 600-B illustrated in
As shown in
The output 716 includes a first reproduced plain data portion 704 and a second portion 718. The second portion 718 is an irrelevant or extraneous portion of the output 716. Consequently, the second potion 718 is ignored or discarded. The length of the second portion 718 is equal to a difference in the lengths of the cipher text 708 and the initial vector 514.
The CBC encryption workflow 520 illustrated in
As shown in
The cipher text portion 804 includes a relevant portion 802-(N−1) and an extraneous portion 806. A length of the relevant cipher text portion 802-(N−1) is equal to the length of the plain data portion 502-N. A length of the extraneous portion 806 is equal to a length of the padding portion 512. The relevant portion 802-(N−1) and the extraneous portion 806 are both XORed with the plain data portion 502-N and the padding portion 512 to produce, after encryption by the encrypt engine 504-N, the corresponding cipher text portion 802-N. In essence, the cipher text portion 802-N is generated by mimicking a CBC mode of encryption.
The CBC decryption workflows 600-A and 600-B illustrated in
As shown in
During the first round of decryption, padding is added to the cipher text portion 802-(N−1). Specifically, a padded portion 902 is appended to the cipher text portion 802-(N−1) such that the total length of the cipher text portion 802-(N−1) and the padded portion 902 is equal to one data chunk of the decrypt engine 602-(N−1). The length of the padded portion 902 is equal to the length of the padded portion 512 appended to the plain data portion 512-N. The length of the padded portion 902 can be determined since the length of the cipher text vector 802 is known. The cipher text portion 802-(N−1) and appended padded portion 902 are then decrypted using the decrypt engine 602-(N−1) to produce an unknown or undesirable result 904. The unknown result 904 is an irrelevant portion not equal to the plain data portion 502-(N−1).
The last step of the first round of the decryption operation involves the decryption of the cipher text portion 802-N. The cipher text portion 802-N is decrypted using decrypt engine 602-N to produce intermediate output 906. The intermediate output 906 is XORed with the input from the prior encryption operation (i.e., the cipher text portion 802-(N−1) and appended padded portion 902) to produce an output 908. In essence, the output 908 is generated by mimicking a CBC mode of decryption. The output 908 can be considered an output portion succeeding the irrelevant portion 904. The output 908 includes the reproduced plain data portion 502-N and the extraneous portion 806. As shown in
The second round of decryption is used to recover the plain data portion 502-(N−1). As shown in
The combination of the cipher text portion 802-(N−1) and the extraneous portion 806 is used to reproduce the plain data portion 502-(N−1). The extraneous portion 806, however, is not available to the decrypt engine 602-(N−1) during the first round of decryption. Specifically, the extraneous portion 806 is reproduced only after decrypting the last cipher text portion 506-N. Therefore, a second round of decryption is used to decrypt the combination of the cipher text portion 802-(N−1) and the extraneous portion 806. Since all other portions of the plain data vector 502 are recovered in the first round of decryption, it is not necessary to conduct any other decryption operations in the second round.
The extraneous portion 806 is not directly carried in the encrypted payload 802. The extraneous portion 806, however, is indirectly carried by the encryption payload 802. The extraneous portion 806 is indirectly carried due to the XORing of the cipher text portion 804 with the plain data portion 502-N and the padded portion 512 as shown in
The workflows 900-A and 900-B can be used to fully decrypt any type of cipher text such as, for example, encrypted MPEG data. Together, the workflows 900-A and 900-B provide a termination scheme for data scrambled according to the workflow 800 depicted in
Further, the workflows 900-A and 900-B can be implemented with parallel or serial operations.
The workflows 700-A and 700-B depicted in
As shown in
The parser 1004 isolates the unencrypted payload of the transmission packet 1014. The parser 1004 also determines the size or length of the unencrypted payload. The operation of the encryption system 1000 varies according to the size of the unencrypted payload. Specifically, the encryption system 1000 implements the signal processing depicted in workflow 520 or the workflow 800 when the length of the plain data vector is longer than one data chunk and implements the signal processing depicted in the workflow 700-A when the plain data vector is shorter than one data chunk. The encryption system 1000 implements the workflow 520 when operating in CBC mode and implements the workflow 800 when operating in ECB mode. The encrypt engine block 1008 can be configured to implement multiple encryption/decryption algorithms such as, for example, DES, 3DES and AES.
When implementing the workflow 520, the parser 1004 slices the plain data vector into N portions and pads the Nth input portion as shown in
When implementing the workflow 800, the parser 1004 also slices the plain data vector into N portions and pads the Nth input portion as shown in
When implementing the workflow 700-A, the initial vector stored in the IV block 1012 is passed to the encrypt engine 1008 using a connection 1020. The encrypted initial vector is then passed to the XOR block 1006 using the feedback connection 1016. The XOR block 1006 combines the output of the encrypt engine 1008 with the plain data vector provided by the parser 1004. The output of the XOR block 1006 is then passed to the output buffer 1010 using a connection 1022.
When implementing the workflow 700-A under ECB mode, the IV block 1012 can be used to format a portion of the received transmission packet 1014 for use as an initial vector. For example, the ADF of an MPEG transmission stream packet can be passed to the IV block 1012 from the parser 1004 for appropriate formatting.
The encryption system 1000 is not limited to the embodiment depicted in
Further, the signal processing functions described herein in relation to
Additionally, it is to be understood that the constituent components and supporting interconnections of the encryption system 1000 can be configured to process portions of a received plain data vector in a serial fashion or in a parallel fashion. For parallel processing of multiple portions of a plain data vector, the XOR block 1006 and the encryption engine block 1008 can include one or more XOR circuits and encryption engines, respectively.
As shown in
The parser 1104 isolates the encrypted payload of the transmission packet 1114. The parser 1104 also determines the size or length of the encrypted payload. The operation of the decryption system 1100 varies according to the size of the encrypted payload. Specifically, the decryption system 1100 implements the signal processing depicted in the workflows 600-A/B or the workflows 900-A/B when the length of the cipher text vector is longer than one data chunk and implements the signal processing depicted in the workflow 700-B when the cipher text vector is shorter than one data chunk. The decryption system 1100 implements the workflows 600-A/B when operating in CBC mode and implements the workflows 900-A/B when operating in ECB mode. The decrypt engine block 1106 can be configured to implement multiple encryption/decryption algorithms such as, for example, DES, 3DES and AES.
When implementing the workflow 600-A, the parser 1104 slices the cipher text vector into N portions and pads the N−1 input portion as shown in
When implementing the workflow 600-B, the output buffer 1110 provides a portion of the Nth decrypted output portion to the decrypt engine 1106 using the connection 1118. The decrypt engine 1106 and XOR block 1108 perform the second round of decryption on the N−1 input portion as illustrated in
When implementing the workflow 900-A, the parser 1104 also slices the cipher text vector into N portions and pads the N−1 input portion as shown in
When implementing the workflow 700-B, the initial vector stored in the IV block 1112 is passed to the decrypt engine 1106 using a connection 1122. The decrypted initial vector is then passed to the XOR block 1108. The XOR block 1108 combines the output of the decrypt engine 1106 with the cipher text vector provided by the parser 1104 using the connection 1116. The output of the XOR block 1108 is then passed to the output buffer 1110.
When implementing the workflow 700-B under ECB mode, the IV block 1112 can be used to format a portion of the received transmission packet 1114 for use as an initial vector. For example, the ADF of an MPEG transmission stream packet can be passed to the IV block 1112 from the parser 1104 for appropriate formatting.
The decryption system 1100 is not limited to the embodiment depicted in
Further, the signal processing functions described herein in relation to
Additionally, it is to be understood that the constituent components and supporting interconnections of the decryption system 1100 can be configured to process portions of a received cipher text vector in a serial fashion or in a parallel fashion. For parallel processing of multiple portions of a cipher text vector, the XOR block 1108 and the decryption engine block 1106 can include one or more XOR circuits and decryption engines, respectively.
The encryption system 1000 and the decryption system 1100 can be used to securely transport digital information. For example, the encryption system 1000 can be used to encrypt digital media so that the encrypted digital media can be provided to desired end-users. Accordingly, the decryption system 1100 can be used by a desired end-user to decrypt the received encrypted digital media. Specifically, the decryption system 1100 can comprise a portion of a digital cable or satellite television “set-top” box.
It is to be appreciated that the Detailed Description section, and not the Summary and Abstract sections, is intended to be used to interpret the claims. The Summary and Abstract sections may set forth one or more but not all exemplary embodiments of the present invention as contemplated by the inventor(s), and thus, are not intended to limit the present invention and the appended claims in any way.
While various embodiments of the present invention have been described above, it should be understood that they have been presented by way of example and not limitation. It will be apparent to one skilled in the pertinent art that various changes in form and detail can be made therein without departing from the spirit and scope of the invention. Therefore, the present invention should only be defined in accordance with the following claims and their equivalents.