Abstract:
A method of encrypting or decrypting an input message block of binary data of predetermined length 2n into an output message block by dividing the message block into two equal size halves, performing one or more transformation rounds on the message block halves, each transformation round further comprising the steps of determining a key, processing the first half data block using a hash function to obtain a modified first half data block of length n, and combining the modified first half data block with the second half data block to obtain a modified second half data block of length n; and, lastly, appending the first modified half data block to the second modified half data block to obtain the output message block.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
     This application claims the benefit of U.S. Provisional Application No. 60/030,357, filed Nov. 7, 1996. 
    
    
     BACKGROUND OF THE INVENTION 
     The present invention relates generally to cryptographic methods and systems to be used in digital data processing, and in particular, is directed to cryptographic methods and systems using block ciphers employing balanced Feistel networks with hash functions as round functions. 
     There are two categories of symmetric key-based cryptographic algorithms. Stream ciphers convert plaintext to ciphertext one bit (or byte) at a time. Block ciphers operate on groups of bits called &#34;blocks.&#34; A block cipher that mixes layers of substitution and permutation is called a Substitution-Permutation Network (SPN). SPNs are alternating layers of nonlinear substitution boxes (s-boxes) and linear permutations which serve to scramble the bits of the plaintext in a key-dependent way to create the ciphertext. An s-box layer and a permutation layer together are often referred to as a single &#34;round.&#34; 
     The input to the cipher is a block of plaintext 2n bits in length. There are two general classes of SPNs: those that operate on the full 2n bits of data in each round; and those that operate on fewer than 2n bits (i.e., partial blocks) and then swap the partial blocks between rounds. The second class is what is typically meant in the cryptographic literature by the terms &#34;Feistel cipher&#34; and &#34;Feistel network.&#34; The DES (U.S. Data Encryption Standard) was constructed using this approach. 
     The general structure of an r-round Feistel network is shown in FIG. 1a. Basic encryption operation is as follows. A plaintext message block 105 of 2n bits is input and split into a left half L 0  110 and a right half R 0  115. If the message block is divided into two equal blocks of length n, the Feistel network is said to be &#34;balanced.&#34; Right half R 0  115, and key K 0  120 are input to round function f 0  125, the output of which is used to modify left half L 0  110. In FIG. 1a, L 0  110 is modified using XOR addition at 114. The result becomes R 1  and is used as the next input to function f 1  at 130; R 0  115 then becomes L 1 . Swapping the left and right halves completes round one. This process continues for as many rounds as the cipher requires. After the final round, which does not contain a swap in order to simplify implementation of the decryption process, the left and right halves are concatenated to form ciphertext 140. 
     In symmetric cryptographic algorithms based on Feistel networks, the same process works for both encryption and decryption with minimal modifications. The decryption process is essentially the encryption process in reverse order. Referring again to FIG. 1a, in the decryption process, ciphertext message block 140 of 2n bits would be split into a left half L r  145 and a right half R r  150. Right half R r  150, and key K r-1  165 are input to round function f r-1  155, the output of which is used to modify left half L r  170. L r  145 is modified using XOR addition at 160. The result becomes R r-1  and is used as the next input to function f r-2  ; R r  then becomes L r-1 . Swapping the left and right halves completes round one. To complete the decryption process, the final left and right halves are concatenated to form plaintext 105. 
     The security of block ciphers based on Feistel networks is directly related to the ability of the round function to resist cryptanalytic attack. In their 1988 paper, &#34;How to Construct Pseudorandom Permutations From Pseudorandom Functions,&#34; SIAM Journal of Computing, Vol. 17, No. 2 (April 1988), M. Luby and C. Rackoff showed that provably secure three- or four-round Feistel networks can be constructed using secure pseudorandom functions as the component round functions. They were able to show that three-round networks provide security against chosen plaintext attacks provided that no more than k plaintext blocks are encrypted and assuming the adversary does not have unlimited computing power with which to perform exhaustive key search for keys of reasonable length. Furthermore, four-round Feistel networks, sometimes called super pseudorandom invertible permutations, are secure against chosen ciphertext attacks under the same conditions. Such attacks are among the strongest known against any cryptosystem, so efficient ciphers which are secure against these attacks would be of immediate value in a number of environments. 
     Some researchers have replaced secure, but inefficient, pseudorandom functions with known hash functions such as MD5, SHA-1, or RIPE-MD. While these ciphers are faster to execute, they are no longer provably secure, since no hash function has yet been proven to be a pseudorandom function. These ciphers also tend to be &#34;unbalanced&#34; Feistel networks (in which the plaintext is split into two pieces of size) and may incorporate other primitive techniques, such as a steam cipher, to deal with the unbalance. This can complicate the analysis of such ciphers so that it is even more difficult to gain confidence in their security. 
     Using a smaller Luby-Rackoff cipher as the round function in a recursive design also has been suggested. For example, a 4n bit to 4n bit Luby-Rackoff cipher uses 2n-bit to 2n-bit Luby-Rackoff ciphers as its round functions, each of which uses n-bit to n-bit Luby Rackoff ciphers for its round functions, and so on. Researchers have shown, however, that a cipher of this design can be used to encrypt only a handful of plaintexts before security is threatened. See U. Maurer, &#34;A Simplified and Generalized Treatment of Luby-Rackoff Pseudorandom Permutation Generators,&#34; in Advances in Cryptography: Proceedings of Eurocrypt 92, Springer (1993), pp. 189-203. 
     Furthermore, research has shown that the theoretical security of any block cipher is at most the square root of the size of the keyspace (due to so-called key-collision attacks), so that for true 128-bit security, 256-bit keys must be used. See E. Biham, &#34;How to Forge DES-Encrypted Messages in 2 28  steps,&#34; Technical Report CS 884, Dept. of Computer Science, Technion, Haifa, Israel, August 1996. Ciphers with large block sizes may be used with a large number of plaintexts (up to the square root of the block size), so that ciphers with larger block sizes may be appropriate even for environments in which many terabytes of data must be encrypted with a single key. 
     It is therefore desirable to develop a cipher that has the simplicity of the balanced Feistel network plus the efficiency of hash functions. 
     It is also desirable to construct Feistel network-based ciphers that rest on the theoretical underpinnings of Luby and Rackoff. 
     It is further desirable to create a function which retains the apparent pseudorandom properties of MD5 and SHA-1, but which is more suitable for a fixed-size, symmetric block cipher. 
     It is also desirable to develop a cipher that even with large key sizes is computationally fast to implement. 
     Additionally, it is desirable that the key scheduling process not be prohibitively long compared with, for example, the encryption or decryption of a single block of plaintext. 
     SUMMARY OF THE INVENTION 
     To meet these desires, a method consistent with this invention begins with a balanced Feistel network using a modified hash function as the round function. The function accepts two fixed-size inputs, each of which is the size of the function output. This new cipher blends the well-studied security of balanced Feistel networks with the increased performance of hash functions. 
     More specifically, a method consistent with the present invention of transforming an input message block of binary data of predetermined length 2n bits into an output message block, where n is a positive integer, comprises the steps of dividing the message block into a first and a second half data block of equal length; processing the message block by one or more transformation rounds, each transformation round further comprising the steps of determining a set of keys processing the first half data block and a key using a hash function to obtain a modified first half data block of length n, and combining the modified first half data block with the second half data block to obtain a modified second half data block of length n; and appending the first modified half data block to the second modified half data block to obtain an output message block. 
     According to another aspect of the invention, a data encryption system for transforming an input message block of binary data of predetermined length 2n into an output message block, where n is a positive integer, comprises a divider for dividing the message block into a first and a second half data block of equal length; a key generator; a hashing processor for processing the first half data block and a key using a hash function to obtain a modified first half data block of length n; a data processor for combining the modified first half data block with the second half data block to obtain a modified second half data block of length n; and a concatenator for appending the first modified half data block to the second modified half data block to obtain an output message block. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate the invention and, together with the description, serve to explain the principles of the invention. 
     FIG. 1a is a diagram of a Feistel cipher; 
     FIG. 1b is a diagram of the Feistel network-like structure of the present invention; 
     FIG. 2 is a flow diagram illustrating in detail a first step of the round function of the present invention; 
     FIG. 3 is a flow diagram illustrating in detail a second step of the round function of the present invention; 
     FIG. 4 is a flow diagram showing the key scheduling process; and 
     FIG. 5 is a flow diagram showing the mapping function of the key generation process. 
     FIG. 6 shows a system for carrying out the method consistent with this invention. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     Reference will now be made in detail to preferred implementations consistent with the present invention, an example of which is illustrated in the accompanying drawings. 
     A system consistent with the present invention is an 8-round Feistel cipher with a input block size and key size of 256 bits. The general structure shown in FIG. 1b resembles the Feistel cipher depicted in FIG. 1a with r=8. FIGS. 2 and 3 illustrate the various components of the round function. Details of the key generation process are illustrated in FIG. 4 and explained in more detail below. 
     The present invention may be designed as a Feistel network with seven or fewer rounds, i.e. r&lt;8, however, a Feistel network with 8 or more rounds is highly recommended. Research has shown that the composition of two permutation generators that are less than perfectly secure creates a permutation generator that is more secure than either one alone. See M. Luby and C. Rackoff, &#34;Pseudorandom permutation generator and cryptographic composition,&#34; in Proceedings of the 18th Annual Symposium on Theory of Computing (May 28-30, 1986). In the embodiment where r=8, for example, the first four rounds can be viewed as one super pseudorandom invertible permutation and the last four rounds can be viewed as another. The overall cipher is then equivalent to the composition of these two ciphers, which will compensate to some degree for any non-optimal security in the component ciphers due to the use of apparently secure, but not provably secure, round functions. 
     Systems consistent with the present invention also may use many different block and key sizes. Block size and key size of at least 256 bits each, however, is recommended to provide a wide safety margin against as yet unknown cryptanalytic attacks, particularly those in which the key bits must be recovered by some attacks before exhaustive search over the remaining bits becomes computationally feasible even within the foreseeable future. The large block size also allows the cipher to be used with a large number of inputs, so that this cipher may be appropriate even for environments in which many terabytes of data must be encrypted with a single key. 
     Referring again to FIG. 1b, an input message block of 256 bits is split into right half R 0  165 and left half L 0  160, each 128 bits long. In the first iteration of the round function, right half R 0  and key K 0  are input to function 175. The round function is a two-step modified hash function that accepts two fixed-size inputs, each of which is the size of the function output. In general, the first step masks the data with the subkey to produce a 128-bit data block. The second step substitutes this 128-bit data block with another pseudorandomly chosen 128-bit data block. The first step uses every 32-bit word of the subkey, with three different binary operations, to modify each 32-bit word of the data. This appears to be a much more effective masking operating than a simple XOR of the two input bit strings and helps to ensure that the input to the second step is not known if the subkey is not known. FIGS. 2 and 3 illustrate the function in greater detail. 
     A. The Round Function 
     FIG. 2 illustrates the first step of the round function. The function takes as input two 128-bit strings, right half R 205 and key K A  210. Right half R 205 is divided at 215 into four 32-bit words, R 0 , R 1 , R 2 , and R 3 . R 0 , for example, represents the 32 most significant bits and R 3  represents the 32 least significant bits. In a similar manner, the 128-bit K A  is divided at 220 into four 32-bit words, K&#39; 0 , K&#39; 1 , K&#39; 2 , K&#39; 3 . R is then combined with K A  using various arithmetic and logical functions. In the following descriptions of the present invention, the symbols +, ⊕, , , and represent addition modulo 32, bitwise XOR, bitwise OR, bitwise AND, and bitwise complement, respectively. FIG. 2 illustrates one embodiment of the present invention, that is, where R and K A  are combined according to the following function: 
     
         for i=0 . . . 3, M.sub.i =((((R.sub.i K&#39;.sub.(i+1)mod 4)+K&#39;.sub.(i+2)mod 4)⊕K&#39;.sub.(i+3)mod 4)K&#39;.sub.(i+4)mod 4) 
    
     where a  b represents a circular left shift of the value in a by b bits. 
     To explain further, the four 32 bit words of R are shifted to the left by K&#39;.sub.(i+1)mod 4 number of bits at 225, 226, 227 and 228. R i  is a 32-bit number so only the least significant 5 bits of K&#39;.sub.(i+1)mod 4 will be used for the rotation operation if K&#39;.sub.(i+1)mod 4 is greater than 5 bits in length. The result of the shifting operation is then combined with K&#39;.sub.(i+2)mod 4 at 230, 231, 232 and 233 using addition modulo 32. Each result is then bitwise XORed at 235, 236, 237 and 238 with K&#39;.sub.(i+3)mod 4. Lastly, each result is shifted to the left at 240, 241, 242 and 243 by the number of bits corresponding to the value in K&#39;.sub.(i+4)mod 4. The end result is four 32-bit intermediate values, M 0 , M 1 , M 2  and M 3  which will be used in the second step as the input vector. 
     The second step of the round function is illustrated in FIG. 3. As a first step of the mapping function of the present invention, each of the input vector values, M 0 , M 1 , M 2  and M 3 , is added modulo 32 to the corresponding input constants D 0 , D 1 , D 2 , and D 3  at 306, 307, 308 and 309. This step randomizes the starting point of the mapping operation without allowing the input to actually be the starting point. The input constants may be any 32-bit numbers, however, in the present example the input constants used are the following and are identical to the four constants used in the compression function of SHA-1. ##EQU1## 
     Once the input vector M is modified by the input constants D i , the result is used as the initializtion vector for the update function. The update function is defined arithmetically as follows: 
     For i=0 . . . 19, do 
     
         d.sub.(-i)mod 4 =(d.sub.(-i)mod 4 +f(i,d.sub.(1-i)mod 4, d.sub.(2-i)mod 4,d.sub.(3-i)mod 4)+m.sub.i +T.sub.(i+1)mod 4)S(i,imod 4))+d.sub.(1-i)mod4 
    
     where ##EQU2## 
     In the present invention, the update function performs 20 iterations. In each iteration, three initialization values are inputted to a nonlinear function at 320. The result is added modulo 32 to the fourth initialization value at 325. Next, one 32-bit block derived from the input vector obtained from step one of the round function is added modulo 32 to the result at 330. For the first iteration, the m i  are equal to the output from step one. For each successive iteration, the m i  values are equal to an arithmetic or logical combination of two or more of the initial m i , the result of which has been shifted a variable number of places. In the embodiment illustrated in FIG. 3, the assignment of values to the m i  follows the SHA-1 design in that the m i  are more than a simple permutation of the input words but, unlike SHA-1, each value depends on only 2 previous values (for faster operation) and a different shift value is used (3 bits instead of 1 bit). 
     The result is then modified by adding a constant, T i , to the result at 335. The result is then shifted at 340 according to the shift values in the function S(t,i), where t is the iteration. At 345, the result is modified by adding it modulo 32 to one of the inputs to the nonlinear function. This loop may be executed any number of times, however, excessive iterations will slow unnecessarily the execution time. Because the data string in the present invention is only 128 bits rather than 512 bits as in SHA-1, the present invention executes this loop only 20 times, which is conceptually similar but considerably faster than the 80 iterations performed in SHA-1. Upon completion of 20 iterations, the modified right half, or R&#39;, is comprised of the last four outputs of the update function, that is, for i=0 . . . 3, R&#39; i  =d i . 
     Referring again to FIG. 1b, modified right half R&#39; 0  is then XORed with left half L 0  110 at 164. The result becomes the next input to the function, or R 1 . R 0  then becomes L 1 . Swapping the left and right halves completes round one. This process continues for eight rounds. Note that after the final round the left and right halves are not swapped, but instead are concatenated to form ciphertext 190. 
     The process for decrypting ciphertext 190 is essentially the encryption process in reverse order. Referring again to FIG. 1b and beginning at the bottom of the diagram, in the decryption process ciphertext message block 190 of 2n bits is split into a left half L 8  and right half R 8 , R 8  and key K 7  are input to round function f 7 , the output of which is used to modify left half L 8  and so on in reverse order of the encryption process described above. After eight iterations, the final left and right halves are concatenated to form original plaintext 155. 
     B. The Key Schedule 
     The key schedule in the present invention takes a 256-bit input and creates eight 128-bit round keys using the mapping function as defined in the section above and as illustrated in FIG. 5. Referring now to FIG. 4, the first step in the key scheduling process is to split the input key into two halves K A  (the most significant 128 bits) and K B  (the least significant 128 bits). K A  is then processed using mapping function, F O . 
     As shown in FIG. 5, K A  is divided into four 32-bit blocks. Each of the input constants D 0 , D 1 , D 2 , D 3  is added modulo 32 to the corresponding key values, K&#39; 0 , K&#39; 1 , K&#39; 2  and K&#39; 3 , at 506, 507, 508 and 509. The resulting values constitute the initialization values to the update function. In each iteration of the update function, three initialization values are combined according to a nonlinear function at 520. The result is added modulo 32 to one of the initialization values at 525. Next, one 32-bit block derived from the input vector obtained from step one of the round function is added modulo 32 to the result at 530. For the first iteration, the m i  values are equal to the four output vector blocks from step one. For successive iterations, however, the m i  values are equal to a arithmetic or logical combination of two or more of the initial m i , the result which is then shifted a variable number of places. In the present invention, a shift value of three is preferred. The result is then modified by adding a constant, T i , to the result at 535. The result is then shifted at 540 according to the shift values in the function S(t,i), where t is the iteration. At 545, the result is modified by adding it modulo 32 to one of the inputs to the nonlinear function. The present invention executes this loop 20 times. 
     Referring again to FIG. 4, the first output K A .sbsb.0 of the mapping function F 0  becomes the input to the mapping function F 1 . Following the eighth execution of the mapping function, output K A .sbsb.0 is combined with K B  and then used as input to F 8 . As with the keys generated from K A , the output K B .sbsb.0 of the mapping function F 8  becomes the input to the update function F 9  and so on. Following the sixteenth execution of the mapping function, the eight keys generated using K A  are XORed with the eight keys generated using K B  as shown in FIG. 4. This process produces eight 128-bit random-looking subkeys. In this context, &#34;random-looking&#34; means that any change in the initial 256-bit key results in a large, unpredictable change in every generated subkey. Also, partial or complete knowledge of any given set of subkeys provides no advantage in the computation of the remaining subkeys if the initial 256-bit key is unknown. 
     The key scheduling process may be mathematically defined as follows: 
     Let K A .sbsb.0 =F(K A ) 
     for i=1 . . . 7 K A .sbsb.i =F(k A .sbsb.i-1) 
     Let K B .sbsb.0 =F(K B  ⊕K A .sbsb.7) 
     for i=1 . . . 7 K B .sbsb.i =F(K B .sbsb.i-1) 
     For i=0 . . . 7 k i  =K A .sbsb.i ⊕K B .sbsb.7-1 
     The key k i  is then the string K given above in the description of the round function. 
     FIG. 6 illustrates a system consistent with the present invention. As shown in FIG. 6, the present invention may be implemented using a personal computer (PC) 600 connected to one or more input/output (I/O) devices 615 and 620. Consistent with this invention, PC 600 may include a processor 610, key generator 630 and memory 620. Processor 610 may be any commonly available processor, however, faster speed processors will decrease the execution time of the invention. Key generator 630 may be implemented in software form on processor 610 or, for example, may be a separate hardware device that is capable of providing keys to the processor. Processor 610, memory 620 and key generator 630 are connected via data links 606, 608 and 610. 
     I/O devices 615 and 620 access PC 600 via data links 602 and 604. In general, I/O devices 615 and 620 can be any devices that are capable of passing information to or receiving data from processor 610. By way of example only, I/O devices 615 and 620 may be monitors, keyboards, modems, printers, display devices or workstations. Each workstation can be a PC or other hardware that includes a visual display device and data entry device such as a keyboard or mouse. It should be further understood that FIG. 6 describes an exemplary network where each of the hardware components may be implemented by conventional, commercially available computer systems. 
     It will be apparent to those skilled in the art that various modifications and variations can be made in the methods and systems consistent with the present invention without departing from the spirit or scope of the invention. The true scope of the claims is defined by the following claims.