Tradeoff attacks on symmetric ciphers can be considered as the generalization of the exhaustive search. Their main objective is reducing the time complexity by exploiting the memory after preparing very large tables at a cost of exhaustively searching all the space during the precomputation phase. It is possible to utilize data (plaintext/ciphertext pairs) in some cases like the internal state recovery attacks for stream ciphers to speed up further both online and offline phases. However, how to take advantage of data in a tradeoff attack against block ciphers for single key recovery cases is still unknown. We briefly assess the state of art of tradeoff attacks on symmetric ciphers, introduce some open problems and discuss the security criterion on state sizes. We discuss the strict lower bound for the internal state size of keystream generators and propose more practical and fair bound along with our reasoning. The adoption of our new criterion can break a fresh ground in boosting the security analysis of small keystream generators and in designing ultra-lightweight stream ciphers with short internal states for their usage in specially low source devices such as IoT devices, wireless sensors or RFID tags.
- symmetric cipher
- block cipher
- stream cipher
- tradeoff attack
- keystream generator
- Hellman table
- rainbow table
- one-way function
In general, bulk encryption is performed through symmetric ciphers; that is, block ciphers or stream ciphers. Hash functions, message authentication codes and authenticated encryption schemes are also based on the quite similar design and security principles. All these cryptographic primitives are examples of one-way functions for which it must be computationally infeasible to find a preimage. Indeed, the only generic method to invert a given output is exhaustively searching for one of its inputs.1 This may be embodied as brute force attacks on block ciphers and stream ciphers, internal state recovery attacks on keystream generators, preimage attacks on hash functions or constructing valid messages to given tag values for message authentication codes.
The brute force attacks can be expedited significantly by utilizing very large tables that have been already prepared during the offline phase. This phase is called the precomputation phase also and is usually equivalent to exhaustive search. Nevertheless, once it is executed, the prepared tables can be used several times.
It may be possible to further improve a tradeoff attack by exploiting large amount of data (plaintext/ciphertext pairs). Biryukov-Shamir attack on keystream generators can be considered as a typical example of a tradeoff among time, memory and data . One of the internal states of a long keystream sequence is recovered. However, it is still unknown how to use data to improve the tradeoff attacks on block ciphers.
The state sizes of block ciphers are not of security concern against tradeoff attacks, enabling to design ultra-lightweight block ciphers. In fact, we encounter several such block cipher designs in the literature during the last decades [2, 3, 4, 5, 6, 7, 8, 9]. However, it seems to be almost impossible to design ultra-lightweight stream ciphers due to their strict security criterion on the lower bound of their internal state sizes to resist tradeoff attacks.
The tradeoff attacks can be quite effective against some real world cryptographic primitives. The tradeoff tables can be used in practical applications to break real life ciphers such as A5/1 for the GSM encryption [10, 11, 12] or to crack passwords by finding preimages to hash functions [13, 14, 15, 16, 17]. In this chapter, we introduce briefly how to use tradeoff tables to invert small sized one-way functions. Moreover, we evaluate the state of art of the applications, raise some open problems and come up with a discussion on the countermeasures against tradeoff attacks on keystream generators.
We argue that it is possible to loosen the lower bound for the state size without sacrificing the security against tradeoff attacks and this can enable designing ultra-lightweight stream ciphers. We claim that the lower bound for the internal state size can be diminished to bits from bits where is the key length. It is possible to design a keystream generator of size bits, which remains still secure against tradeoff attacks and which presents a great advantage in low cost applications. Indeed, such ciphers are in real world demand due to the confidentially issues of lightweight devices such as RFID tags, wireless sensors or IoT devices.
It is straightforward that resistance against tradeoff attacks is not sufficient for security. Unfortunately, the security of small stream ciphers has not been studied sufficiently so far. We still do not know how to design secure and small stream ciphers. This is due to fact that almost all the stream ciphers in the literature have internal state sizes at least twice as large as their key sizes. Hence, there is almost no example in the literature to analyze. The recent small keystream generators such as Sprout  or Plantlet  are analyzed intensively in a short while and several weaknesses are discovered [20, 21, 22, 23, 24, 25, 26].
The tradeoff attacks on block ciphers so far are limited to the tradeoff between only time and memory. It is an open problem how to construct a tradeoff curve between memory and data or among memory, data and time for a single key recovery attack. We phrase the problem of
The outline of the chapter is as follows. We briefly overview the tradeoff attacks on symmetric ciphers, give some recent applications of these attacks and evaluate them in Section 2. Then, we assess the tradeoff attacks on stream ciphers and keystream generators in Section 3. We also introduce the tradeoff attacks on block ciphers, discuss the differences from those on stream ciphers and state some open problems in Section 4. We assess the internal state recovery tradeoff attacks and make an argument about the internal state sizes of keystream generators in Section 5. Finally, we introduce our concluding remarks in Section 6.
2. Inverting a one-way function through tradeoff
Let be a one-way function of bit input and bit output. That is, it is easy to compute the output, , of a given input ; but computationally infeasible to find a preimage for a given output .
The phrase” computationally infeasible” is not a formal or a precise statement. Indeed, we mean that the fastest algorithm of finding a preimage must be exhaustively searching for , either online or offline. This definition is valid for random one-way functions which are generally not permutations. The one-way functions deduced from symmetric ciphers are examples and we consider them only throughout the chapter. The time complexity of recovering one preimage of a given value is about calls of the function (simply ) for a one-way function . There is almost no memory or data complexity. Hence this can be considered as one of the extreme cases where only the time complexity dominates.
The time complexity may be substituted by the memory complexity if we compute all the values in advance during the offline phase (which we call precomputation phase) and save them in a sorted table with respect to the second column, . Then, the time complexity of the precomputation phase is and the memory complexity is . On the other hand, the time complexity of finding a preimage for a given during the online phase is relatively negligible in comparison to the memory complexity. One needs to search for in the second column of the table and this search takes roughly steps since the table is sorted. This is also one of the extreme cases where only the memory complexity dominates.
In general, we can regard the tradeoff attacks as the attacks searching for a preimage of a one-way function by utilizing a significant memory prepared in the precomputation phase to reduce the time complexity from . A tradeoff curve between memory and time is introduced with possibly some restrictions. The time complexity is decreased by increasing the memory complexity or vice versa. But the ratio of increase/decrease depends on the tradeoff curve. In general, the optimum point on the curve is considered as the point where if the restrictions permit to choose this point. Let us remark that the precomputation phases of these attacks must be the whole exhaustive search to provide significantly high success rates. But, since this offline phase is run only once, its complexity can be ignored in some applications where one uses the tables several times to invert enormous number of outputs. The Hellman tables or the rainbow tables for the GSM encryption algorithm A5/1 are typical real world applications [10, 12].
It is possible to ease the problem of inverting a one-way function by introducing large number of data. Then the corresponding tradeoff attacks can be further improved by constructing better tradeoff curves with the addition of the amount of data used.
We can define the problem of
It is possible to address the problem of inverting one-way function with data in stream ciphers and mount some tradeoff attacks for single key setting. We introduce these attacks in Section 3. However, it is not known in the literature yet how to associate a single key recovery attack for a block cipher as a problem of inverting one-way function with data (see Section 4 for details of the tradeoff attacks in the case of block ciphers).
2.1 Hellman and rainbow tables
One very well known way of inverting a one-way function is using Hellman tables . Initially, Hellman introduced the tables only for recovering the DES keys in his original work in  but it can be used to invert any one-way function.
Let us assume that the input and the output sizes of a one-way function, , are equal. That is, . The general cases may easily be deduced by the reduction or enlargement techniques as Hellman applied for the DES encryption by reducing its block size to 56 bits. Let be an input. Then, compute and save the pair, .
If a given value is equal to for some then we can find a preimage for y easily: will be a preimage since . We can check if for some by checking the equality . Indeed we have
Therefore, it is highly probable that . It may be possible that even though since is not a permutation. This case is considered as a false alarm. The probability of the false alarms should be taken into account for the success rate of the attack. Gildas
Choosing different points and preparing a table of pairs sorted with respect to (which is called a Hellman table), it is possible to find a preimage of a given output if for some in these pairs by calling the function and checking if the result is among the second (sorted) values of the pairs at most times. Therefore, examining if is in the set with elements, costs calls of and the memory amount we need is since we save pairs for one table of elements. These pairs consist of the initial and the final columns of the table.
The most significant disadvantage of Hellman tables is the high propagation of the collisions throughout the rows. If for some and different starting points , then the collision is going to merge to the rest of the rows as . This restricts the capacity of a Hellman table. Indeed, we should choose the number of the rows and the columns and such that to optimize the probability of collisions according to the birthday paradox . Therefore, we need roughly tables since one table can contain at most different elements and each Hellman table must be prepared by using a different function deduced from a slight derivation of the -function so as to ensure the independence of the tables.
The time complexity is since examining through one table costs calls of the -function and we have tables. Similarly, we need memory to save tables. As a corollary, the tradeoff curve is deduced with . The optimum point on the curve is . The precomputation phase for preparing the tables is equivalent to the exhaustive search and hence its complexity is .
Oechslin introduces another kind of tables to invert one-way functions, which he calls rainbow tables . He proposes to use a different function for the computation of each column and hence each row is constituted as
instead of for a chosen starting point where s are derived from by slight modifications. Only the initial point and its final evaluation are saved as in the case of Hellman tables.
Rainbow tables have a significant advantage over Hellman tables: The collisions in different columns do not propagate in rainbow tables. So, it is possible to use only one rainbow table for covering majority of the space . The table contains columns and rows. However, tracing through a rainbow table costs much more. For a given output , check if it is in the last column. If not then check and then and then, and so on are in the last column one by one.
Both the Hellman tables and the rainbow tables have the same tradeoff curve. But, the time complexity is for a rainbow table which is roughly twice less than . This makes rainbow tables more popular in practical applications.
3. Tradeoff attacks on stream ciphers
The main building blocks of (synchronous) stream ciphers are keystream generators. The most general design principle of keystream generators make use of a state update function and an output function producing -bit output from each -bit internal state. An internal state is updated to the next internal state via . The initial internal state is called the seed and produced from a key and an initial vector through an initialization algorithm :
The objective of the attacks on stream ciphers is twofold in general. They aim at either recovering the key or an internal state. The same approach is adopted for tradeoff attacks. The state recovery attacks are conventional examples of the problem of inverting one-way function with data in a single key attack scenario. Indeed, it is enough to recover one of the internal states occurred during the encryption process.
Babbage  and Golić  independently introduce a natural way of recovering one of the internal states by using data. They define a one-way function by extending the output function which produces enough number of output bits by calling and certain number of times consecutively to identify the input state from its keystream piece uniquely. One can compute pairs of the states and their outputs during the precomputation phase and save them as sorted with respect to the outputs. Then, it is highly probable to recover one of the states which produce data when during the online phase. The optimum point on the tradeoff curve is . So, is supposed to be larger than the key length to ensure that the Babbage-Golić attack is slower than the exhaustive search. This imposes a well known and highly adopted security criterion on stream ciphers: The internal state size must be at least twice as large as the key size. It was one of the main security requirements for the stream ciphers in both the NESSIE project  and the eSTREAM project [35, 36].
Another tradeoff attack on keystream generators using data is introduced by Biryukov and Shamir . They propose to use Hellman tables to recover one of the internal states which produce data. It is nothing but finding a preimage for one of the data. The optimum online complexity is achieved when only one Hellman table is constructed. So, and with . Hence, we have the tradeoff curve given as with the restriction . The optimum point on the curve is achieved when and this gives . Again, if then the online phase of the Biryukov-Shamir attack will be slower than the exhaustive search, confirming the security criterion that the internal state size should be at least twice as large as the key size.
Both the Babbage-Golić attack and the Biryukov-Shamir attack aim at recovering one of the internal states. The online phases of these attacks are compared with the exhaustive search rather than the default tradeoff attacks. The attacks use multiple data since the one-way function they would like to invert has several outputs available. On the other hand, it is possible to define the one-way function as the function taking the -bit main key as input and producing the keystream of -bits for a chosen fixed . The internal state size has no significance for inverting this one-way function. So, we have the classical complexities . However, we can not exploit the multiple data for this function. Therefore the Babbage-Golić attack and the Biryukov-Shamir attack are superior when the internal state size is too short. The tradeoff attacks on the GSM encryption algorithm A5/1 with its 64 bit internal state are mostly the applications of the Biryukov-Shamir attack [10, 11, 12].
Armknecht and Mikhalev examine the keyed update functions and show that the keystream generators with keyed state update functions are secure against conventional tradeoff attacks no matter how small the internal state sizes are . They also introduce an example cipher they call Sprout . A keyed state update function takes the main key as the second parameter of the input to produce the next internal state from the current internal state.
The cipher Sprout is analyzed intensively in a short while and some weaknesses are discovered [20, 22]. More interestingly, special tradeoff attacks are mounted [21, 23]. Then, Armknecht and Mikhalev present another keystream generator with keyed state update. They call it Plantlet . This cipher also attains significant interests of cyrptanalysts and several results are published including correlation attacks [24, 25, 26, 37, 38], some of them are even faster than exhaustive search . It seems that it is indeed a challenging task for the crypto community to design keystream generators of small state sizes even if the tradeoff attacks are ignored in their security assessments.
4. Tradeoff attacks on block ciphers
Let be a block cipher of -bit key and -bit block size. and is a permutation for a fixed key . We can define a one-way function for a chosen fixed plaintext . Finding a preimage for a given ciphertext is nothing but finding a key candidate that encrypts the plaintext to the given ciphertext.
It is possible to invert by using tradeoff tables. Hellman initially mounted the tradeoff attack on the block cipher DES in his original work . The online time complexity is reduced to . But preparing the tables requires as many encryption calls as in the exhaustive search.
There is no known method of using multiple data to improve the tradeoff curve in the single key recovery setting for block ciphers yet. Choosing another plaintext will result in another one-way function to convert. So, using multiple data yields the following problem. Let be independent one-way functions of -bit inputs and -bit outputs. We call the problem of finding as the problem of the
and are given.
Choosing different plaintexts for a block cipher is an example of the problem of the mutual inverting of multiple one-way functions given as: , . Here is the key and we have chosen plaintexts encrypted with . Then, finding becomes a mutual inverting problem of multiple one-way functions.
The problem may further be generalized as inverting only one of the independent one-way functions. Let
be given for independent one-way functions . The goal is to find one of for .
The problem of mutual inverting multiple one-way functions can be applied to stream ciphers also. Several one-way functions may be defined by choosing several s. Each determines a one-way function taking the key as the input and producing -bit keystream. That is, each one-way function is defined as
where is an -bit key and is the first -bit keystream segment produced by the pair . The function can be inverted by the conventional Hellman tables or rainbow tables. Finding preimage for one specific can be considered as the default tradeoff attack on stream ciphers and its online complexity is given as .
It may be still possible to use any number of s. For the single key attack scenario, the keystream generator is initialized by several different s and the corresponding -bit keystream segments are produced. Then, the unknown inputs of the one-way functions will be mutual, namely the main key.
It seems that inverting only one specific one-way function once is not easier than the other two problems. One can use the algorithm of inverting a one-way function to invert one of one-way functions. So, an algorithm inverting a one-way function can be used to solve the problem of inverting at least one function among one-way functions. Similarly, any algorithm inverting one of one-way functions can straightforwardly be used to solve the mutual inverting problem.
It is not known yet if these three problems are of equal difficulty. It is an open problem if the mutual inverting problem is strictly easier than the problem of inverting one of the several one-way functions. It is also an open problem that inverting one of the several one-way functions is strictly easier than inverting only one one-way function. If there is an algorithm solving problem of mutual inverting problem but not solving the problem of inverting one-way function then the security levels and the key lengths for both block ciphers and stream ciphers must be assessed again. Because, the algorithms solving mutual inverting problems efficiently can be very powerful and serious attacks on symmetric ciphers.
5. Assessment of security criterion on state size
The online complexities of both the Babbage-Golić and the Biryukov-Shamir attacks are compared to the complexity of the exhaustive search and the security criterion on the state size of a stream cipher is imposed thereof. However, there is still a faster tradeoff attack even though the internal state size is larger than twice of the key size. It is possible to define a one-way function from a main key to its keystream piece of a stream cipher by choosing and fixing an . Then, one of the preimages of the keystream segment will be the main key. The attack complexity is derived from the key size rather than the internal state size. At the optimum point of the tradeoff curve, the online complexity is where is the key length. This is the default Hellman or Oechslin tradeoff attacks and valid for block ciphers also. Note that the complexity is much smaller than , the complexity of the exhaustive search.
Any tradeoff attack on symmetric ciphers should be compared with the default tradeoff attack with its complexity , instead of the exhaustive search. In this case, the strict criterion on the internal state size can be lightened, enabling to design ultra-lightweight stream ciphers. Indeed, a stream cipher of 128 bit key is required at least 256 bit internal state according to the conventional security criterion. If we assume one bit register is implemented by a flip flop of 6 GE (Gate Equivalent) area, we must allocate roughly 1.5 K GE only for the registers. This is why there is almost no stream cipher in the literature having a hardware implementation less than 1 K GE. However, there are several block cipher designs with hardware implementations less than 1 K GE such as Ktantan , PRINTCipher , SLIM  and LBlock .
Recall that we have the tradeoff curve for the Babbage-Golić attack with the optimum point where is the internal state size of a given stream cipher. The online time complexity is also equal to the data complexity. Then, we simply should consider the attack to be successful if . Therefore, the internal state size must be at least . An attacker may prefer to choose much larger on the curve . For example, preparing a memory of , we have for the case . However, it is possible to restrict the total number of the keystream bits produced per one key and force the users to change the key before completing encrypting the amount of data.
Similarly, the optimum point of the tradeoff curve for the Biryukov-Shamir attack is where . Then, the attack will be slower than the default key recovery tradeoff attack if again . Once more, we achieve the same security bound that the minimum size for the internal state must be . If the precomputation phase is required to be not faster than the exhaustive search, then the amount of data encrypted per one key can be bounded above by .
As a result, the tradeoff attacks aiming at the internal state recovery should be compared to the default tradeoff key recovery attack. Then, it is possible to loosen the restriction on the state size from to . This new criterion can enable novel designs of ultra-lightweight stream ciphers. However, stream ciphers with short internal states may prone to several other attacks. The attacks on Plantlet and Sprout are the examples [20, 21, 22, 23, 24, 25, 26, 37, 38]. Therefore, it seems to be a fruitful challenge for the cryptography community to design secure stream ciphers having quite short internal states. On the other hand, the real world applications such as IoT devices, RFID tags or wireless sensors require ultra-lightweight stream ciphers for confidentially.
We briefly introduce the tradeoff attacks on symmetric ciphers and initiate hopefully a fruitful discussion about how to assess the degree of precautions or countermeasure to be taken against these attacks.
The tradeoff attacks targeting at recovering one of the internal states producing a given keystream sequence are compared to the exhaustive search attack on the corresponding key used. However, a stream cipher key can be recovered much faster thorough the default tradeoff attack. Therefore, the internal state recovery tradeoff attacks should be compared to the default key recovery tradeoff attack. In this case, it is possible to loosen the bound for the countermeasure taken against state recovery tradeoff attacks.
The internal state size is supposed to be at least twice as large as the key size if the security threshold for tradeoff attacks is taken as the complexity of the exhaustive search. This is indeed a well known and worldwide adopted security criterion. We argue that it is indeed not necessary to allocate such large internal state just for the resistance against tradeoff attacks. The internal state size is enough to be at least -bits particularly for the lightweight applications where is the key length. Besides, there are several other cyrptanalytic techniques for internal state recovery that must be taken into account. It is an open problem how to design secure stream ciphers with short internal states. Such ciphers must be secure against other types of attacks such as divide-and-conquer attacks, guess and determine attacks or correlation attacks. It is interesting to study this generic problem.
We believe that it is a challenging task to design small stream ciphers and the industry requires such ciphers to use in lightweight applications such as IoT devices, wireless sensors or RFID tags.
We would like to thank Mehmet Sabır Kiraz, Ali Aydın Selçuk and Sırrı Erdem Ulusoy for their helpful comments. We also would like to thank IntechOpen LIMITED for the grant.
Conflict of interest
The authors declare no conflict of interest.
- Permutations as one-way functions are out of scope of this chapter.