1. Field
The present invention relates generally to cryptography and, more specifically, to stream ciphers and combining functions.
2. Description
In some instances, a cryptographic system is used to protect uncompressed video data. Since the video data is uncompressed, the amount of data to be processed for display to a user is very large. Conventionally, encryption of this data using a known block cipher, such as an Advanced Encryption Standard (AES) cipher, for example, is too slow for some content protection applications.
In a typical stream cipher encryption operation, a key stream is applied directly to plaintext data by using a simple combining operation, such as exclusive-or, to produce ciphertext data. Conversely, during a decryption operation, the inverse combining operation is used with the same key stream to change ciphertext data back into plaintext data. One disadvantage to this approach is that it requires the same amount of key stream bits as data to be processed.
What is desirable is a cryptographic system that uses a key stream smaller than the size of the plaintext data in such as way as to improve the performance characteristics of the cryptographic system, yet still provide adequate security.
The features and advantages of the present invention will become apparent from the following detailed description of the present invention in which:
An embodiment of the present invention is a method and apparatus for improving stream cipher performance by using portions of a key stream as round keys in a one-round, one-time block cipher. This allows more data to be encrypted or decrypted in the same amount of time while preserving desirable security properties.
In embodiments of the present invention, a small number of blocks of key stream may be computed as is typically done for a base stream cipher, but the blocks of the key stream may now be used as round keys in a short block cipher, with each combination of key stream blocks being used at most once as the basis for the round keys. In one embodiment, a non-linear transformation such as a substitution box (S-Box), may be used between combining operations to deter an adversary from solving for the key stream if some of the plaintext data blocks are known (thus possibly deriving nearby unknown blocks of plaintext). A short block cipher may use corresponding bits from each of multiple blocks as input data to the substitution operation, and multiple blocks may be encrypted or decrypted together. In one embodiment, shifting or other transformations may be done to key stream bits to form subsequent round keys from the initial blocks of the key stream.
Reference in the specification to “one embodiment” or “an embodiment” of the present invention means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, the appearances of the phrase “in one embodiment” appearing in various places throughout the specification are not necessarily all referring to the same embodiment.
In an embodiment, the key stream 108 may be input to both the round key generator 110 and the combining function 116. The round key generator uses blocks of the key stream to generate a plurality of round keys. In one embodiment, the round keys may be generated in groups of four, by operating on four blocks of the key stream at a time (wherein each block comprises 128 bits in one embodiment). In an embodiment, the round key generator may comprise a logical function such as a shift function (either left or right for a specified number of bits). In other embodiments, other logical functions may be performed on the key stream blocks to generate the round keys. Round keys 112 may be of any arbitrary size. In one embodiment, each round key may comprise 128 bits.
In one embodiment as shown in
The result of the processing of one iteration by the key stream generator and the round key generator is a set of four key stream blocks (KS0, KS1, KS2, and KS3) and four round keys (RK0, RK1, RK2, and RK3), derived from the original key 104 and initialization vector blocks 200, 202, 204, 206. In embodiments of the present invention, each unique combination of a pair of key stream block and round key (e.g., (KS0, RK0), (KS0, RK1), . . . (KS3, RK2), (KS3, RK3)), may be used as keys in two rounds of the combining function 116 to produce 16 blocks of ciphertext from 16 blocks of plaintext. Thus, an encryption or decryption operation may be performed over 16 blocks of data in embodiments of the invention using only 4 blocks of key stream data. This results in a processing improvement of up to a factor of four over prior art systems.
This performance improvement may be obtained as follows.
In one embodiment, each successive portion of 16 blocks of the plaintext data stream (at each iteration of the combining function) may be split into four groups of four blocks each: P0, P1, P2, and P3232; P4, P5, P6, and P7234; P8, P9, P10, and P11236; and P12, P13, P14, and P15238; with each block comprising 128 bits. Thus, in one embodiment, the number of blocks in a set is 16. For first round processing, plaintext block P0 may be input to an invertible algebraic function such as XOR along with key stream 0 (KS0) 216. The output of the XOR handling P0 may be forwarded to a first S-box 240. Plaintext block P1 may be input to an invertible algebraic function such as XOR along with key stream 1 (KS1) 218. The output of the XOR handling P1 may be forwarded to first S-box 240. Plaintext block P2 may be input to an invertible algebraic function such as XOR along with key stream 2 (KS2) 220. The output of the XOR handling P2 may be forwarded to first S-box 240. Plaintext block P3 may be input to an invertible algebraic function such as XOR along with key stream 3 (KS3) 222. The output of the XOR handling P3 may be forwarded to first S-box 240.
In a similar manner, plaintext block P4 may be input to an invertible algebraic function such as XOR along with key stream 0 (KS0) 216. For purposes of clarity of
In a similar manner, plaintext block P8 may be input to an invertible algebraic function such as XOR along with key stream 0 (KS0) 216. The output of the XOR handling P8 may be forwarded to a third S-box 244. Plaintext block P9 may be input to an invertible algebraic function such as XOR along with key stream 1 (KS1) 218. The output of the XOR handling P9 may be forwarded to third S-box 244. Plaintext block P10 may be input to an invertible algebraic function such as XOR along with key stream 2 (KS2) 220. The output of the XOR handling P10 may be forwarded to third S-box 244. Plaintext block P11 may be input to an invertible algebraic function such as XOR along with key stream 3 (KS3) 222. The output of the XOR handling P11 may be forwarded to third S-box 244.
In a similar manner, plaintext block P12 may be input to an invertible algebraic function such as XOR along with key stream 0 (KS0) 216. The output of the XOR handling P12 may be forwarded to a fourth S-box 246. Plaintext block P13 may be input to an invertible algebraic function such as XOR along with key stream 1 (KS1) 218. The output of the XOR handling P13 may be forwarded to fourth S-box 246. Plaintext block P14 may be input to an invertible algebraic function such as XOR along with key stream 2 (KS2) 220. The output of the XOR handling P14 may be forwarded to fourth S-box 246. Plaintext block P15 may be input to an invertible algebraic function such as XOR along with key stream 3 (KS3) 222. The output of the XOR handling P15 may be forwarded to fourth S-box 246.
Thus, each of the 16 XOR functions processes one of the 16 plaintext blocks and forwards a block of transformed plaintext data to a substitution box (S-box), respectively. Each S-box 240, 242, 244, 246 comprises a non-linear mapping function to transform a set of four input blocks taken together (e.g., 512 bits from four blocks) into a set of four output blocks. Any S-box known in the art may be employed herein.
The output of each S-box is input to the second round of the combining function, comprising a set of 16 invertible algebraic functions, such as XOR functions. The first ciphertext block 264 may be generated as follows. Ciphertext block C0 may be generated by performing an invertible algebraic function such as XOR on a first block output from the first S-box 240 and a first round key 0 (RK0) 224. Ciphertext block C1 may be generated by performing an invertible algebraic function such as XOR on a second block output from the first S-box 240 and RK0224. Ciphertext block C2 may be generated by performing an invertible algebraic function such as XOR on a third block output from the first S-box 240 and RK0224. Ciphertext block C3 may be generated by performing an invertible algebraic function such as XOR on a fourth block output from the first S-box 240 and RK0224.
In a similar manner, the second ciphertext block 266 may be generated as follows. Ciphertext block C4 may be generated by performing an invertible algebraic function such as XOR on a first block output from the second S-box 242 and a second round key 1 (RK1) 226. Ciphertext block C5 may be generated by performing an invertible algebraic function such as XOR on a second block output from the second S-box 242 and RK1226. Ciphertext block C6 may be generated by performing an invertible algebraic function such as XOR on a third block output from the second S-box 242 and RK1226. Ciphertext block C7 may be generated by performing an invertible algebraic function such as XOR on a fourth block output from the second S-box 242 and RK1226.
In a similar manner, the third ciphertext block 268 may be generated as follows. Ciphertext block C8 may be generated by performing an invertible algebraic function such as XOR on a first block output from the third S-box 244 and a third round key 2 (RK2) 228. Ciphertext block C9 may be generated by performing an invertible algebraic function such as XOR on a second block output from the third S-box 244 and RK2228. Ciphertext block C10 may be generated by performing an invertible algebraic function such as XOR on a third block output from the third S-box 244 and RK2228. Ciphertext block C11 may be generated by performing an invertible algebraic function such as XOR on a fourth block output from the third S-box 244 and RK2228.
In a similar manner, the fourth ciphertext block 270 may be generated as follows. Ciphertext block C12 may be generated by performing an invertible algebraic function such as XOR on a first block output from the fourth S-box 246 and a fourth round key 3 (RK3) 230. Ciphertext block C13 may be generated by performing an invertible algebraic function such as XOR on a second block output from the fourth S-box 246 and RK3230. Ciphertext block C14 may be generated by performing an invertible algebraic function such as XOR on a third block output from the fourth S-box 246 and RK3230. Ciphertext block C15 may be generated by performing an invertible algebraic function such as XOR on a fourth block output from the fourth S-box 246 and RK3230.
Although encryption of data is depicted in
In other embodiments, various features of the cryptographic system shown in
The combining function of the embodiments of the present invention allow for a small constant factor for performance improvement (e.g., up to 4 or 8 times better, depending on the particulars of the substitution operation) over that of a traditional stream cipher due to the relatively fast computation of the combining function compared to the underlying stream cipher.
When implemented in software, this may allow more processor performance to be used for processing of video data, for example, rather than content protection operations of the uncompressed video data, even if the very fastest conventional stream cipher were used. When implemented in hardware, a smaller number of gates would be required to attain the same performance.
The techniques described herein are not limited to any particular hardware or software configuration; they may find applicability in any computing or processing environment. The techniques may be implemented in hardware, software, or a combination of the two. The techniques may be implemented in programs executing on programmable machines such as mobile or stationary computers, personal digital assistants, set top boxes, cellular telephones and pagers, and other electronic devices, that each include a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and one or more output devices. Program code is applied to the data entered using the input device to perform the functions described and to generate output information. The output information may be applied to one or more output devices. One of ordinary skill in the art may appreciate that the invention can be practiced with various computer system configurations, including multiprocessor systems, minicomputers, mainframe computers, and the like. The invention can also be practiced in distributed computing environments where tasks may be performed by remote processing devices that are linked through a communications network.
Each program may be implemented in a high level procedural or object oriented programming language to communicate with a processing system. However, programs may be implemented in assembly or machine language, if desired. In any case, the language may be compiled or interpreted.
Program instructions may be used to cause a general-purpose or special-purpose processing system that is programmed with the instructions to perform the operations described herein. Alternatively, the operations may be performed by specific hardware components that contain hardwired logic for performing the operations, or by any combination of programmed computer components and custom hardware components. The methods described herein may be provided as a computer program product that may include a machine readable medium having stored thereon instructions that may be used to program a processing system or other electronic device to perform the methods. The term “machine readable medium” used herein shall include any medium that is capable of storing or encoding a sequence of instructions for execution by the machine and that cause the machine to perform any one of the methods described herein. The term “machine readable medium” shall accordingly include, but not be limited to, solid-state memories, optical and magnetic disks, and a carrier wave that encodes a data signal. Furthermore, it is common in the art to speak of software, in one form or another (e.g., program, procedure, process, application, module, logic, and so on) as taking an action or causing a result. Such expressions are merely a shorthand way of stating the execution of the software by a processing system cause the processor to perform an action of produce a result.
While this invention has been described with reference to illustrative embodiments, this description is not intended to be construed in a limiting sense. Various modifications of the illustrative embodiments, as well as other embodiments of the invention, which are apparent to persons skilled in the art to which the invention pertains are deemed to lie within the spirit and scope of the invention.