CRYPTOGRAPHIC METHOD AND APPARATUS FOR NON-LINEARLY MERGING A DATA BLOCK AND A KEY

Abstract: The method and apparatus are used for cryptographically converting a digital input block into a digital output block. The apparatus (400) comprises first input means (410) for obtaining the digital input block and second input means (440) for obtaining a key K1. Cryptographic processing means (420) of the apparatus (400) convert the digital input block into the digital output block by merging a selected part M1 of the digital input block with the key K1 and producing a data block B1 which non-linearly depends on M1 and K1. The merging is performed in one, sequentially inseparable step. Output means (430) are used to output the digital output block of which a selected part is derived from B1.

Description: Cryptographic method and apparatus for non-linearly merging a data block and a key The invention relates to a method for converting a digital input block into a digital output block; said conversion comprising the step of merging a selected part Ml of said digital input block with a first key Kl and producing a data block BI which non-linearly depends on said selected part Ml and said first key Kl, and where a selected part of said digital output block is derived from said data block BI . The invention further relates to an apparatus for cryptographically con¬ verting a digital input block into a digital output block; said apparatus comprising first input means for obtaining said digital input block; second input means for obtaining a first key Kl ; cryptographic processing means for converting the digital input block into the digital output block; said conversion comprising merging a selected part Ml of said digital input block with said first key Kl and producing a data block BI which non-linearly depends on said selected part Ml and said first key Kl, and where a selected part of said digital output block is derived from said data block BI; and output means for outputting said digital output block. The Data Encryption Standard (DES) of the National Bureau of Standard [FIPS publication 46, 1977 January 15] describes a widely used algorithm for converting a digital input block into a digital output block. Such an algorithm is generally referred to as a block cipher. The DES algorithm is used for encrypting (enciphering) and decrypting (deciphering) binary coded information. Encrypting converts intelligible data, referred to as plaintext, into an unintelligible form, referred to as ciphertext. Decrypting the ciphertext converts the data back to its original form. In the so-called electronic code book mode, DES is used to encrypt blocks of 64 bits of plaintext into corresponding blocks of 64 bits of ciphertext. In this mode, the encryption uses keys which are derived from a 64 bit key, of which 56 bits may be freely selected. Figure 1 shows the overall structure of DES during encrypting. In the encrypting computation, the input (64 bit plaintext) is first permuted from 64 bits into 64 bits using a fixed permutation IP. The result is split into 32 left bits L^ and 32 right bits R Q . The right bits are transformed using a cipher function f(Ro,K,), where K, is a sub-key. The result f(Ro,K]) is added (bit-wise modulo 2) to the left bits, followed by interchanging the two resulting 32 bit blocks LQ Θ f(R o ,K,) and RQ. This procedure is continued iteratively for a total of 16 rounds. At the end of the last round the inverse permu¬ tation of the initial permutation IP is applied. In the calculation of f(R,,K 1+ 1 ) the 32 right bits R, are first expanded to 48 bits in the box E, as illustrated in figure 2. According to a given table this expansion is per- formed by taking some input bits twice as an output bit and others only once. Then, the expanded 48 bits are added (bit-wise modulo 2) to the 48 key bits K,. The resulting 48 bits are split into 8 groups of 6 bits each. Each of these groups is processed by an S box (S,), which reduces the 6 bits to 4 bits in a non-linear operation. The eight S, boxes are given in the form of a table. The total output is 32 bits, which is permuted in the box P. P is also given in the form of a table. Figure 3 illustrates the key schedule calculation. The key consists of 64 bits, of which only 56 are used in the algorithm. Those 56 bits should be chosen randomly. Eight complementing error detecting bits are used to make the parity of each byte of the key odd. The selection of the 56 bits is performed in box PCI, together with a permutation. The result is split into two 28 bit words Q and D 0 . To obtain the 48 key bits for each round, first the words C 0 and D 0 are left shifted once or twice. A selection and a permutation PC2 are then applied to the result. The output of PC2 is the 48 bit sub-key K, which is used in f(Ro,K,). The process of shifting, selecting and permutating is repeated to generate a sub-key for each round. A table specifies how many shifts must be performed to obtain the next 48 bits of the sub-key for the following round. The same algorithm and key can be used for decrypting a ciphertext. The initial permutation for the decrypting cancels the inverse permutation of the encrypting. Each round consists of a, so-called, Feistel cipher. It is well-known that for Feistel-ciphers the inverse operation consists of using the same rounds as used for encrypting but applying the sub-keys in inverse order. As such, the first decrypting round must be supplied with the same sub-key as used for the sixteenth encrypting round, the second decrypting round must be supplied with the same sub-key as used for the fifteenth encrypting round, etc. It is also well-known how the DES algorithm can be used in other encryption modes, such as the cipher feedback mode. In this mode, the DES algorithm is used to generate a stream of statistically random binary bits, which are combined with the plaintext, using, for instance, an exclusive-or logic operation. The DES algorithm, in essence, comprises an initial permutation, followed by sixteen key-dependent computations on part of the data and terminated with an inverse permutation. Each key dependent computation comprises adding (modulo 2) key- dependent bits to the data part, followed by a non-linear operation on sub-blocks of the data part, and terminated by a permutation (linear operation) of the data part. In general, DES is considered to be a good encryption/decryption tool. It is, however, an open question whether or not DES has remained secure over the past years, particularly in view of the recent very powerful differential cryptanalytic attacks. It is an object of the invention to provide a cryptographic method and apparatus of the kind set forth which is more robust against cryptanalytic attacks. To achieve this object, the cryptographic method according to the invention is characterised in that said merging step is performed by executing a non-linear function g for non-linearly merging said selected part Ml and said first key Kl in one, sequentially inseparable step. In the DES system, as shown in figure 2, in a first processing step the R data is bit-wise added to the key, followed by a second processing step of non- linearly processing the result (S-boxes). According to the invention, an algorithm is used which non-linearly merges data with a key in one step (i.e. one, sequentially inseparable step). As such, adding the key bits to the data is an integrated part of the non-linear operation, making the system more immune against modern attacks, such as differential cryptanalysis. In an embodiment of the method according to the invention as defined in the dependent claim 2, in each round both parts of the digital input block are processed, giving a better encryption result than for conventional Feistel ciphers, such as DES, where during each round only half of the digital input block is being processed. To ensure that the same system can be used for both encryption and decryption, one part of the data is pro¬ cessed using an operation g, whereas the other half is processed using the inverse operation g "1 . Using this scheme, decrypting is performed by using the same system but supplying the keys in reverse order to the rounds (during decryption the first non-linear step is supplied with the key which, during encryption, was supplied to the last non-linear step, etc ). Compared to a conventional implementation of a Feistel cipher with twice as many rounds, the system according to the invention is faster. The measure as defined in the dependent claim 3, wherein a relatively large data block and key, of for instance 64 bits, are split into smaller sub-blocks and sub- keys simplifies real-time non-linear processing. In an embodiment of the method according to the invention as defined in the dependent claim 5, a constant is used to enhance the quality of the encryption. Advan- tageously, the constant is predetermined per system, forming, for instance, a customer- specific constant. Alternatively, the constant is generated using a pseudo-random generator. The measure defined in dependent claim 6 provides a way for non-linearly merging the data sub-block and the sub-key in one step. Additionally, different inputs all result in different outputs. This increases the immunity of the system against cryptanalytic attacks, compared to DES where the non-linear operation reduces the 6-bit input sub-block to a 4-bit output sub-block, implying that the same output is produced for four different inputs. In an embodiment of the method according to the invention as defined in the dependent claim 7 a constant is used to enhance the quality of the encryption. Advan- tageously, the constant is predetermined per system, forming, for instance, a customer- specific constant. Alternatively, the constant is generated using a pseudo-random generator. The measure as defined in the dependent claim 8 increases the quality of the encryption even further. In an embodiment of the method according to the invention as defined in the dependent claim 10 individual sub-blocks corresponding to different parts of the digital input block are swapped to improve the quality of the encryption. Preferably, the sub-block π^ comprises eight data bits. This further improves the quality of the non-linear operation compared to DES, where the non-linear operation converts six to four bits. The measure as defined in the dependent claim 11 has the advantage of reducing the multiplication in GF(2 8 ) to operations in GF(2 4 ), making it possible to achieve a simpler or more cost-effective implementation. The measure defined in the dependent claim 12 gives an effective way of reducing the multiplication in GF(2 8 ) to operations in GF(2 4 ). An embodiment of the method according to the invention is characterised in that β is a root of an irreducible polynomial h(x) = x 4 + x 3 + x 2 + x + 1 over GF(2). This is a preferred choice for β, allowing the use of the so-called shifted polynomial base. An embodiment of the method according to the invention is characterised in that calculating the inverse of an element of GF(2 8 ) comprises performing a series of calculations in GF(2 4 ). By reducing the inverse operation in GF(2 8 ) to operations in GF(2 4 ) a simpler or more-cost effective implementation can be achieved. An embodiment of the method according to the invention is characterised in that calculating the inverse of said element b comprises calculating (a 0 2 -l-a 0 a 1 -t-a 1 2 |3)' 1 ((a 0 +a,)+a,D). This is an effective way of reducing the inverse operation in GF(2 8 ) to operations in GF(2 4 ). An embodiment of the method according to the invention is characterised in that said first key Kl comprises 64 data bits and wherein each of said sub-keys k, comprises eight data bits. By using a large key the quality of the encryption is increased. To achieve the object of the invention, the apparatus according to the invention is characterised in that said cryptographic processing means is arranged to perform said merging by executing a non-linear function g for non-linearly merging said selected part Ml and said first key Kl in one, sequentially inseparable step. These and other aspects of the invention will be apparent from and elucidated with reference to the embodiments shown in the drawings. Figure 1 shows the processing steps for the DES system, Figure 2 illustrates details of merging the data with the key and the non- linear operation in DES, Figure 3 illustrates details of the key calculation in DES, Figure 4 shows a block diagram of the cryptographic apparatus, Figure 5 illustrates separate processing of two parts of the digital input block, Figure 6 illustrates processing of a part of the digital input block in the form of sub-blocks, Figure 7 illustrates processing of two parts in the form of sub-blocks, and Figure 8 shows an overall encryption system. Figure 4 shows a block diagram of the cryptographic apparatus 400 according to the invention. For the purpose of explaining the invention, the system is described in the electronic code book mode. Persons skilled in the art will be able to use the system in other modes as well. The apparatus 400 comprises first input means 410 for obtaining a digital input block M. The digital input block M may be any suitable size. Preferably, M is sufficiently large, for instance 128 bits, to obtain a reasonably secure encryption result. The apparatus 400 further comprises cryptographic processing means 420 for converting the digital input block into a digital output block. Advantageously, the digital output block has substantially equal length as the digital input block. The apparatus 400 comprises output means 430 for outputting the digital output block. Basically, the cryptographic processing means 420 converts the digital input block M into the digital output block by merging a selected part Ml of the digital input block M with a first key Kl , pro¬ ducing a data block BI which non-linearly depends on Ml and Kl. The merging is per¬ formed in one, sequentially inseparable step. The digital output block is derived from BI and the remaining part of M, which is not part of Ml. To obtain the first key Kl, the cryptographic apparatus 400 comprises second input means 440. As will be described in more details below, a second part M2 of the digital input block may be non-linearly merged with a second key K2, preferably, using an operation inverse to the operation for merging Ml and Kl, producing a data block B2. In this case, the digital output block also depends on B2. To obtain the second key K2, the cryptographic apparatus 400 comprises third input means 450. It will be appreciated that the cryptographic apparatus 400 may be implemented using a conventional computer, such as a PC, or using a dedicated encryption/decryption device. The digital input block may be obtained in various ways, such as via a communication network, from a data storage medium, such as a harddisk or floppy disk, or directly being entered by a user. Similarly, the digital output block may be output in various ways, such as via a communication network, stored on a data storage medium, or displayed to a user. Preferably, secure means are used to this end. The cryptographic processing means 420 may be a conventional processor, such as for instance used in personal computers, but may also be a dedicated cryptographic processor. The cryptographic apparatus 400 may, in part or in whole, be implemented on a smart-card. In the remainder of the document details of the cryptographic conversion are given for encrypting blocks of 128 bits of plaintext into corresponding blocks of 128 bits of ciphertext. Persons skilled in the art will be able to use the system for other block sizes as well. Data sizes shown in the Figures are given for reasons of clarity and should be treated as examples only. The description focuses on the non-linear processing of the data and the merging of the key with the data as performed in one round. As such the invention can be applied in a system as shown in Figure 1 , comprising multiple rounds and also including a linear operation on the data block in each round. As shown in Figure 5, the message block M of 128 bits is divided into a first part Ml and a second part M2 (a left and a right block). Preferably, both parts are of equal size, 64 bits. It will be appreciated that Ml and M2 may also be derived from M using a more complicated selection process. Ml is processed using a non-linear function g. In principle, it is not required to process M2 during the same round. Advantageously, M2 is processed in the same round using the inverse function g "1 . Each of the functions g and g '1 non-linearly merges, Ml or, respectively, M2 with a key Kl or, respectively K2. Preferably, the data parts and the keys have the same size. Since it is difficult to implement a good non¬ linear operation on a large data block and non-linearly processing a large data block is time consuming, the data parts Ml and M2 are split into sub-blocks. Figure 6 illustrates this for Ml. Figure 7 illustrates the splitting of Ml and M2. Using 64-bit data parts Ml and M2, advantageously, the parts are each split into eight 8-bit elements, where Ml = (mo, m.ι,..., m 7 ) and M2 = (m g , m 9 ,... ,m 15 ). The two keys Kl and K2 may be derived from a larger key, for instance, by splitting a 128 bit key into two 64-bit keys Kl and K2. The two keys Kl and K2 may be split further. Using 64-bit keys, advantageously, each key is split into 8-bit sub-keys, giving a total of sixteen 8-bit sub-keys k,, j = 0..15. Each of the sub-keys k, is associated with the corresponding sub-block m r Each sub-block is processed separately. Preferably, the sub-blocks are processed in parallel. If preferred, the sub-blocks relating to one round may also be serially processed. The first group of sub-blocks, forming Ml, are each processed by a cipher function f. The second group of sub-blocks are each processed by the inverse function f '. For the cryptographic operations, an n-bit sub-block or sub-key is con¬ sidered to represent an element of GF(2 n ) (Galois Field). All operations are, therefore, in GF(2 n ). In its basic form, the cipher function f has two inputs m, and k, and one output t ; as also illustrated in figures 6 and 7, where t, = f(m,, k), for j = 0 to 7. In the basic form, the cipher function f involves one operation h(b,, k,) with an output of substan¬ tially equal size as b r The function h has a data sub-block b, and a sub-key k, as input, where b j = m, for the basic form of the cipher function f. The function f (in this embodiment the same as the function h) is defined as follows for j = 0..7: 1. h(b r k) = (b s . k,)-\ if b, ≠ 0, k, ≠ 0, and b j ≠ k. (k } ) \ if ^ = 0 (b)-\ if k^ O 0, if b, = k j Similarly, in its basic form the inverse cipher function f ' has two inputs m, and k j and one output t j as also illustrated in figures 6 and 7, where t, = f '(m,, k,), for j = 8 to 15. The inverse cipher function f 1 involves also one operation, h " '(b, . k,) with an output of substantially equal size as b r The function h "1 is the inverse of h. As before, b, = πi j in the basic form of the cipher function f 1 . The function f ' (in this embodiment the same as the functions h '1 ) is defined as follows for j = 8..15: 1. h-'(b j . k j )= (b j . le,) "1 , if b, ≠ 0, k, ≠ 0, and b, . k* ≠ 1 k J? if b j = 0 (b,)-*, if k j = 0 0, if b j . k j 2 = 1 In a further embodiment, the outputs t, of the cipher functions f (t, = f(m j , k j ), for j = 0 to 7) and the outputs of the inverse cipher function f ' (t, = f '(πv., k j ), for j = 8 to 15) are swapped in the following manner: t, < - > t 15 . j for j = 0 to 7. This is illustrated in Figure 7. In a further embodiment, a constant is added (bit-wise module 2) to each data sub-block m, before executing the function h. Preferably, eight independent constants p, (j = 0..7) are used, each being added to the corresponding data sub-block m,. The same function h is used as before, now operating on b j = m, Θ P j . The cipher function f is now defined as follows: 1. b j = πi j Θ p j 2. h(b j , k j ) = ^ . k j ) 1 , if ^ ≠ 0, (k j ) "2 , if b j = 0 (b j ) "2 , if k j = 0 0, if b j = k j Similarly, for the inverse cipher function f ' also a constant is added (bit- wise module 2) to each data sub-block m,. To allow the inverse function f ' to be used to decrypt text encrypted using the cipher function f, the constant is added after the function h. Preferably, the same eight independent constants p, (j = 0..7) are used as used for the cipher function f. Now, the constants p, are being added to the 15-j-th stream (j = 0..7). As a consequence, the inverse cipher function f 1 involves the following two operations (j = 8..15): 1. h '(b j . k j ) = (b j . k,) 1 , if b j ≠ 0, k j ≠ 0, and b j . k j 2 ≠ 1 k j , if ^ = 0 (b j )Λ if k j = 0 0, if b j . k, 2 = 1 Finally, t j and t 15-J are swapped (j = 0..7). In a further embodiment, a further constant is added (bit-wise module 2) to each data sub-block ni j after executing the function h. Preferably, eight independent constants d } Q = 0..7) are used, each being added to the corresponding data sub-block m r The same function h is used as before. The cipher function f is now defined as follows: 1. ^ = πi j θ Pj 2. h(b j , k j ) = (b j . k j ) '1 ' , if b j ≠ 0. (k/ 2 , if b j = 0 (b j ) "2 , if k j = 0 0, if b j = k j 3. ^ = h(b j , k j ) θ d j Similarly, for the inverse cipher function f ' also a constant is added (bit-wise module 2) to each data sub-block ni j . To allow the inverse function f 1 to be used to decrypt text encrypted using the cipher function f, the constant is added before executing the function h. Preferably, the same eight independent constants d, (j = 0..7) are used as used for the cipher function f. Now, the constants d j are being added to the 15-j-th stream (j = 0..7). The same function h "1 is used as before, now operating on b j = m, θ d 15 . r As a consequence, the inverse cipher function f 1 involves the following three operations (j = 8..15): 1. b j = m j θ d I5 ,. 2. h 1 ^ . k j ) = (^ . k j ) 1 , if b j ≠ 0, k, ≠ 0, and b j . k, 2 ≠ 1 k j , if b j = 0 (b j )-*, if k j = 0 0, if b j . k j 2 = 1 3. t j = h '(b j . k j ) θ p 15 . Finally, t, and t 15-j are swapped (j = 0..7). It will be appreciated that it is also possible to use the constants d, without using constants p r In a further embodiment, the cipher function f raises the outcome of die function h to a power of two. The same function h is used as before. The cipher function f is now defined as follows: 1. b j = ni, θ P j 2. h(b j , kj) = (b j . kj) 1 , if b j ≠ 0, (b j ) "2 , if k j = 0 0, if b j = k j 3. Sj = h(b j , k j ) 2n Similarly, the inverse cipher function f 1 also raises a data sub-block to a power of 2. To allow the inverse function f ' to be used to decrypt text encrypted using the cipher function f, the additional operation is performed before executing the function h. The same function h' 1 is used as before, now operating on b j = πi j Θ d l5 . j . As a consequence, the inverse cipher function f 1 involves the following four operations (j = 8..15): 1. q j = m. Θ d,5. j 2. b j = qj 2, «- 7 > 2. b 'φ j . k j ) = (b j . k j ) 1 , if b j ≠ 0, k j k j , if b j = 0 (b j )Λ if k j = 0 0, if b j . k j 2 = 1 3. t j = h '(b j . k,) θ p 15 . Finally, t j and t^ are swapped (j = 0..7). It will be appreciated that it is also possible to use the operation of raising to a power of 2 without using one or both of the constants d, and p r For decrypting the same algorithm is used as for encrypting, but the sub- keys are swapped: instead of k,, k 15 . j is used, j = 0 .. 15. The multiplication in GF(2 8 ) In principle, for the invention any multiplication in GF(2 8 ) may be used. An example of a VLSI implementation of multiplications in GF(2 m ) is given in [P. A. Scott, "A fast VLSI multiplier for GF(2 m )", IEEE Journal on selected areas in communications, Vol. SAC-4, No. 1, January 1986, pages 62-66]. Advantageously, the following mechanism is used to reduce the multiplication in GF(2 8 ) to a series of multiplications and additions in GF(2 4 ). Let in GF(2 4 ), β be the non-trivial root of β 5 = 1 (non-trivial means β ≠ 1, or, equally, β is the root of the irreducible polynomial h(x) = x 4 + x 5 + x 2 + x + 1 over GF(2), since: x 5 + 1 = (x + 1) (x 4 + x 3 + x 2 + x + 1) ). The normal base β, β 2 , β\ (3 8 is taken as the base in GF(2 4 ). Since according to the polynomial β* = |3 3 , this is the same as the so-called shifted polynomial base: β, β 2 , j3 3 , j3 4 . Let D be an element of GF(2 8 ), defined as a root of the irreducible polynomial k(x) = x 2 + x + β over GF(2 4 ). Every element of GF(2 8 ) can be represented as a n + a,.D, with a,, and a ! being elements of GF(2 4 ). In binary terminology, the number b of GF(2 8 ) can be represented using eight bits, arranged as a vector (a^ a,), with a,,, a, having four bits, representing numbers of GF(2 4 ). As such, the base in GF(2 8 ) is: β, β 2 , β\ β\ D/3, Oβ 2 , Oβ\ Oβ 4 . Two elements b and c of GF(2 8 ), represented as b = a 0 + a,.D and c = a 2 + a 3 .D, with a, € GF(2 4 ), can be multiplied as follows: b.c = (a n + a, .D).(a 2 + a 3 .D) = aoa 2 + (a,a 2 + aoa 3 ).D + a,a 3 .D 2 . Using the fact that D is a root of k(x), which implies that: D 2 = D + β, this gives the multiplication result: b.c = (ana 2 + a,a 3 /3) + (a,a 2 + a^ + a,a 3 ).D. This has reduced the multiplication of two elements of GF(2 8 ) to a series of multiplications and additions in GF(2 4 ). The inverse in GF(2 8 ) In principle any known method may be used to calculate the inverse of an element in GF(2 8 ). Advantageously, if the previous method has been used to reduce the multiplication in GF(2 8 ) to a multiplication in GF(2 4 ), then the following method is used to reduce the inverse operation in GF(2 8 ) to an inverse operation in GF(2 4 ). The inverse b "1 of an element b in GF(2 8 ), where b is represented as b = ao + a, .D, with a, E GF(2 4 ), is given by: b '1 = (ao 2 + a^, + a, 2 /?) "1 .^ + a, + a,D), since: b-'.b = (V + aoa, + a, 2 /?) "1 .^ + a, + a.D).(a„ + a,D) = (V + aoa, + a,WW + aoa, + a, 2 D + a, 2 D 2 ), and since D 2 + D = β, this gives: b '.b = 1. In this way the inverse operation in GF(2 8 ) is reduced to an inverse operation in GF(2 4 ) and a series of multiplications and additions in GF(2 4 ). Multiplication in GF(2 4 ) In principle, any multiplication in GF(2 4 ) may be used. Advantageously, as described before, the shifted polynomial base jS, β 2 , β 3 , β 4 is taken as the base in GF(2 4 ), where β is the root of the irreducible polynomial h(x) = x 4 -f x 3 + x 2 + x + 1 over GF(2), and β 5 = 1 in GF(2 4 ). Since β is a root of h, this implies: β 4 + jS 3 + β 2 + β = 1. Assuming that the base elements are named e,, e 2 , e 3 and e 4 , with e, = β', the base elements are multiplied in the following way, using the definition of β: e,.e, = β.β = β 2 = e 2 e,.e 2 = β.β 2 = β s = e 3 e, .e 3 = β.β 1 = β 4 = e 4 .e 4 = β.β 4 = β 5 = 1 = e, + e 2 + e 3 + e 4 e 2 .e 2 = β 2 .β 2 = β 4 = e 4 e 2 .e 3 = β 2 .β 3 = β 5 = 1 = e, + e 2 -I- e 3 + e 4 e 2 .e 4 = β 2 .β 4 = β 6 = β = e e 3 .e 3 = /3 3 ./? 3 = /3 6 = β = e e 3 .e 4 = 0 3 .0 4 = /3 7 = β 2 = e 2 e 4 .e 4 = /? 4 ./3 4 = /3 8 = /3 3 = e 3 This in principle defines the multiplication in GF(2 4 ). In binary terms the multiplication can be seen as follows. With respect to the base, each element b in GF(2 4 ) can be represented as b = b 0 e, + bjβj + b 2 e 3 + b 3 e 4 , with b ; G GF(2). As such, the element b can be represented by a 4-dimensional vector with binary components (b 0 , b 1 ( b 2 , b 3 ). On a micro-processor this can be represented using a nibble. In binary terms, the multiplication of two elements b and c in GF(2 4 ) can be seen as follows, assuming the two elements are represented by b = (b 0 , b,, b 2 , b 3 ) and c = (c 0 , c,, c 2 , c 3 ). Multiplying the two elements in the normal way gives: b.c = (boc 0 )0 2 + (boc, + b,c 0 )/3 3 + (boC, + b,c, + b 2 c 0 )0 4 + (b 0 C 3 + b,c 2 + b 2 c, + b 3 c 0 )0 5 + (b,c 3 + b^ + b 3 c,)/3 6 + (b 2 c 3 + b 3Cl )/3 7 + (b 3 c 3 )j8 8 Using the definition of β to replace β 5 by β 4 + β 3 + β 2 + β, β 6 by β, β η by β 2 , and β 8 by β 3 , gives the following four components: b.c = (b,c 3 + b 2 C 2 + b 3 c, + b 0 c 3 + b,^ + b 2 c, + b 3 c 0 )|3 + (b 0 c 0 + b 2 c 3 + b 3 c 2 + b 0 c 3 + biCj + b 2 c, + b 3 Co)jS 2 + (b 0 c, + b,c 0 + b 3 c 3 + b 0 C 3 + b^ + b 2 c, + b 3 Cn)0 3 + (b 0 C 2 + b,c, + b 2 c 0 + b 0 c 3 + b,C 2 + b 2 c, + b 3 Co)*3 4 The result of the multiplication, in binary terms, is, therefore, given by: b.c = ( b,C 3 -I- b 2 c 2 + b 3 c, 4- b 0 c 3 + b.Cj + b 2 c, + b 3 c 0 , b 0 c 0 + b 2 c 3 + b 3 C 2 + b 0 c 3 + b,C 2 + b 2 Cj -I- bjCn, b 0 c, + b,Co + b 3 c 3 + b 0 c 3 + b,^ + b 2 c, + b 3 Co, b 0 C 2 + b,c, + b 2 c 0 + b 0 c 3 + b^ + b 2 c, + b 3 Co ) Inverse operation in GF(2 4 ) Using the normal base β, β 2 , β 4 , β*, each element x of GF(2 4 ) can be written as b = a.β + b.β 2 + c.β 4 + d./3 8 , with a, b, c, d G GF(2). As such, each element can be represented by a 4-dimensional vector (a, b, c, d). In order to obtain the inverse of b (b 1 ): calculate the following intermediate results: ab, ab, ab, be, be, be , cd, cd, cd, da, da, da , where ab is the binary AND of a and b (a AND b) and a is the binary complement of a (NOT a). calculate the first bit of b 1 by using cd, cd, cd , ab, be , and da as follows: (cd) OR (7 AND cd) OR (cd AND 7b) OR (be AND " da) - calculate the second bit of b '1 by using da, da, da , be, cd , ab as follows: (da) OR ( " b AND d7) OR (la AND TJc) OR (cd AND 7b) calculate the third bit of b "1 by using ab, ab, ab, cd, da , be as follows: (ab) OR (c AND a¥) OR (7b AND cd) OR (d7 AND " be) calculate the fourth bit of b 1 by using be, be, be , da, ab , cd as follows: (be) OR ( " d AND be) OR (be AND la) OR (a " b AND cd) Besides being used in a DES-like system as shown in Figure 1 , a dedicated system can be built around the non-linear algorithm of the invention. Such a system is shown in figure 8. In this system, the blocks are processed using the non-linear operation NL of the invention and a linear operation LIN. The first step is the non-linear operation. This is followed by an iteration of the linear operation followed by the non-linear operation. It is expected that a sufficiently safe system is achieved by performing six non-linear operations (i.e. using five rounds), provided that the linear operation mixes the data bits thoroughly. Preferably, 15 rounds are used. Each of the linear operations is the same. Also, each of the non-linear operations is the same, but each non-linear operation uses a different key of 128 bits. Advantageously, keys are derived from one global key of, for instance, 256 bits, using a key schedule calculation. The same key is used for encryption as well as decryption. In most cases the key is provided using a smart-card. For the linear operation, advantageously, instead of a permutation a more complex matrix is used. As described before, in addition to the key, each non-linear operation may, optionally, use a constant C of 128 bits, which is split in the constants P j and d j . The constant may be the same for each operation. Advan¬ tageously, each non-linear operations is provided with a separate constant. The constants may be predetermined per system (e.g. a customer-specific constant). Alternatively, the constant is generated using a pseudo-random generator.

Claims: Claims 1. A method for cryptographically converting a digital input block into a digital output block; said conversion comprising the step of merging a selected part Ml of said digital input block with a first key Kl and producing a data block BI which non-linearly depends on said selected part Ml and said first key Kl, and where a selected part of said digital output block is derived from said data block BI, characterised in that said merging step is performed by executing a non-linear function g for non-linearly merging said selected part Ml and said first key Kl in one, sequentially insep¬ arable step. 2. A method as claimed in claim 1, wherein said method comprises the steps of: splitting said digital input block into said selected part Ml and a second part M2 before executing said merging step; executing a non-linear function g '1 to merge said second block M2 with a second key K2 in one, sequentially inseparable step, producing a data block B2 as output; said non-linear function g '1 being the inverse of said non-linear function g; and forming combined data from data in said data block BI and in said data block B2; said digital output block being derived from said combined data. 3. A method as claimed in claim 1, wherein said merging step comprises the steps of: splitting said selected part Ml in a first plurality n of sub-blocks m 0 ,..,m n . 1 of substantially equal length; splitting said first key Kl in said first plurality n of sub-keys ko,..,^,, substan- tially having equal length, the sub-key k, corresponding to the sub-block m,, for i = 0 to n-1; and separately processing each of said sub-blocks m, by executing for each of said sub-blocks m, a same non-linear function h for non-linearly merging a sub-block b, derived from said sub-block m, with said corresponding sub-key k, in one, sequentially inseparable step and producing said first plurality of output sub-blocks h(bj, k,); and combining sub-blocks t, derived from said first plurality of said output sub- blocks h(b„ kj) to form said data block BI . 4. A method as claimed in claim 2 and 3, wherein said step of executing said non-linear function g '1 comprises the steps of: splitting said second part M2 in said first plurality n of sub-blocks m n ,..,m 2n .,, substantially having equal length; splitting said key K2 in said first plurality n of sub-keys k n ,..,k 2n .,, substantially having equal length, the sub-key k, corresponding to the sub-block m,, for i = n to 2n-l; executing for each of said sub-blocks πij a same non-linear function h' 1 for non- linearly merging a sub-block b, derived from said sub-block m, with said corresponding sub- key k, and producing said first plurality of an output sub-block h ' ^b,, k,); said function h "1 being the inverse of said function h; and combining sub-blocks tj derived from said first plurality of output sub-blocks h ' ^b,, kj) to form said data block B2. 5. A method as claimed in claim 3, wherein said sub-block b, is derived from said sub-block m, by bit-wise adding a constant p, to said sub-block m„ said constant p, substantially having equal length as said sub-block m,. 6. A method as claimed in claim 3, characterised in that said function h(b„k,) is defined by: hφi.kj) = (Ivki)- 1 , if b, ≠ 0, k, ≠ 0, and b, ≠ kj h(b j ,k j ) = (q j )- 2 , if k j = 0 where the multiplication and inverse operations are predetermined Galois Field multiplication and inverse operations. 7. A method as claimed in claim 6, wherein deriving said sub-blocks t, from said output sub-blocks h(b,, k,) comprises bit-wise adding a constant d, to said output sub- block h(b„kj), said constant d, substantially having equal length as said sub-block m,. 8. A method as claimed in claim 7, wherein deriving said sub-blocks t, from said output sub-blocks h(b,, k,) further comprises raising h(b„k,) θ d, to a power 2', using said predetermined Galois Field multiplication. 9. A method as claimed in claim 6, wherein deriving said sub-blocks t, from said output sub-blocks h(b,, k,) comprises raising said output sub-block h(b„k,) to a power 2', using said predetermined Galois Field (GF) multiplication. 10. A method as claimed in claim 4, wherein said combined data is formed by: swapping the sub-blocks t, and t 2n .,.„ for i = 0 to n-1; and concatenating the swapped sub-blocks. 11. A method as claimed in claim 6, wherein said sub-block m, comprises eight data bits, and wherein said multiplying of two elements b and c of GF(2 8 ) comprises executing a series of multiplications and additions in GF(2 4 ). 12. A method as claimed in claim 11, wherein said multiplying of said two elements b and c comprises: - representing b as ao + a,.D and c as a 2 + a 3 .D, where ao, a,, a 2 and a 3 are elements of GF(2 4 ), and where D is an element of GF(2 8 ) defined as a root of an irreducible polynomial k(x) = x 2 + x + β over GF(2 4 ), where β is an element of GF(2 4 ); and calculating (a^ + a,a 3 0) + (aja 2 -I- a^ + aιa 3 ).D. 13. A method as claimed in claim 12, wherein β is a root of an irreducible polynomial h(x) = x 4 + x 3 + x 2 + x + 1 over GF(2). 14. A method as claimed in claim 6, wherein said sub-block m, comprises eight data bits, and wherein calculating the inverse of an element b of GF(2 8 ) comprises performing a series of calculations in GF(2 4 ). 15. A method as claimed in claim 14, wherein calculating the inverse of said element b comprises: representing b as ao 4- a,.D, where ao and a, are elements of GF(2 4 ), and where D is an element of GF(2 8 ) defined as a root of an irreducible polynomial k(x) = x 2 + x + β over GF(2 4 ), where β is an element of GF(2 4 ); and calculating (ao 2 4- a n a, + a 1 2 jS) "1 ((a 0 + a,) + a,D). 16. An apparatus for cryptographically converting a digital input block into a digital output block; said apparatus comprising: first input means for obtaining said digital input block; second input means for obtaining a first key Kl ; cryptographic processing means for converting the digital input block into the digital output block; said conversion comprising merging a selected part Ml of said digital input block with said first key Kl and producing a data block BI which non-linearly depends on said selected part Ml and said first key Kl, and where a selected part of said digital output block is derived from said data block BI; and output means for outputting said digital output block, characterised in that said cryptographic processing means is arranged to perform said merging by executing a non-linear function g for non-linearly merging said selected part Ml and said first key Kl in one, sequentially inseparable step. 17. An apparatus as claimed in claim 16, wherein said apparatus comprises third input means for obtaining a second key K2, and wherein said conversion comprises: splitting said digital input block into said selected part Ml and a second part M2 before performing said merging; executing a non-linear function g ~ ' to merge said second block M2 with said second key K2 in one, sequentially inseparable step, producing a data block B2 as output; said non-linear function g "1 being the inverse of said non-linear function g; and forming combined data from data in said data block BI and in said data block B2; said digital output block being derived from said combined data. 18. An apparatus as claimed in claim 16, wherein said merging step com- prises the steps of: splitting said selected part Ml in a first plurality n of sub-blocks m 0 ,..,m n . 1 of substantially equal length; splitting said first key Kl in said first plurality n of sub-keys k 0 ,. - ,k n ., ll substan¬ tially having equal length, the sub-key k ; corresponding to the sub-block irL, for i = 0 to n-1; and separately processing each of said sub-blocks m, by executing for each of said sub-blocks m, a same non-linear function h for non-linearly merging a sub-block b, derived from said sub-block m, with said corresponding sub-key k, in one, sequentially inseparable step and producing said first plurality of output sub-blocks h(b„ k,); and combining sub-blocks t, derived from said first plurality of said output sub- blocks h(b„ k,) to form said data block BI. 19. An apparatus as claimed in claim 18, characterised in that said function h(b„k.) is defined by: h(b„k,) = Ovk,) "1 , if b, ≠ 0, k, ≠ 0, and b, ≠ k, h(b„k,) = (k,)- 2 , if b, = 0 h(b„k.) = (b,)- 2 , if k, = 0 h(b„k,) = 0, if b, = k,, where the multiplication and inverse operations are predetermined Galois Field multiplication and inverse operations. 20. An apparatus as claimed in claim 19, wherein said sub-block m, comprises eight data bits, and wherein said multiplying of two elements b and c of GF(2 8 ) comprises: - representing b as ao + a,.D and c as a 2 4- a 3 .D, where ao, a,, a 2 and a 3 are elements of GF(2 4 ), and where D is an element of GF(2 8 ) defined as a root of an irreducible polynomial k(x) = x 2 4- x 4- β over GF(2 4 ), where β is an element of GF(2 4 ); and calculating (a,^ 4- a,a 3 (8) 4- (a^ 4- a^ 4- a,a 3 ).D; and wherein calculating the inverse of an element b of GF(2 8 ) comprises calculating (ao 2 4- aoa, 4- a, 2 /3) 1 ((a 0 4- a,) 4- a,D).

Inventors: DEN BOER HUIBERT, DEN BOER, HUIBERT
Applicants: PHILIPS ELECTRONICS NV, PHILIPS NORDEN AB, PHILIPS ELECTRONICS N.V.
Application year: 1997
Main classification: H04L9
IPC codes: G09C1, H04L9