New Time-Memory-Data Trade-Off Attack on the Estream Finalists and Modes of Operation of Block Ciphers

Similar documents
An Introduction to new Stream Cipher Designs

Stream Ciphers and Block Ciphers

Some Thoughts on Time-Memory-Data Tradeoffs

Treatment of the Initial Value in Time-Memory-Data Tradeoff Attacks on Stream Ciphers

Applying Time-Memory-Data Trade-Off to Meet-in-the-Middle Attack

Linear Cryptanalysis of Reduced Round Serpent

Stream Ciphers and Block Ciphers

Improved Truncated Differential Attacks on SAFER

A Methodology for Differential-Linear Cryptanalysis and Its Applications

A Brief Outlook at Block Ciphers

Winter 2011 Josh Benaloh Brian LaMacchia

Computer Security CS 526

The RAKAPOSHI Stream Cipher

An Overview of Cryptanalysis Research for the Advanced Encryption Standard

Comp527 status items. Crypto Protocols, part 2 Crypto primitives. Bart Preneel July Install the smart card software. Today

Stream Ciphers An Overview

Differential-Linear Cryptanalysis of Serpent

Weak Keys. References

EEC-484/584 Computer Networks

The Rectangle Attack

A Meet-in-the-Middle Attack on 8-Round AES

Block Ciphers and Stream Ciphers. Block Ciphers. Stream Ciphers. Block Ciphers

Computer and Data Security. Lecture 3 Block cipher and DES

New Cryptanalytic Results on IDEA

Improved Multi-Dimensional Meet-in-the-Middle Cryptanalysis of KATAN

The Salsa20 Family of Stream Ciphers

Data Encryption Standard (DES)

Related-key Attacks on Triple-DES and DESX Variants

Cache Timing Attacks on estream Finalists

ECE 646 Lecture 8. Modes of operation of block ciphers

Week 5: Advanced Encryption Standard. Click

AES Variants Secure Against Related-Key Differential and Boomerang Attacks

Cryptography Functions

New Cryptanalytic Results on IDEA

COZMO - A New Lightweight Stream Cipher

3 Symmetric Key Cryptography 3.1 Block Ciphers Symmetric key strength analysis Electronic Code Book Mode (ECB) Cipher Block Chaining Mode (CBC) Some

Improved Multi-Dimensional Meet-in-the-Middle Cryptanalysis of KATAN

Cryptography MIS

Private-Key Encryption

A Related Key Attack on the Feistel Type Block Ciphers

An Improved Cryptanalysis of Lightweight Stream Cipher Grain-v1

L3. An Introduction to Block Ciphers. Rocky K. C. Chang, 29 January 2015

A New Meet-in-the-Middle Attack on the IDEA Block Cipher

A New Attack on the LEX Stream Cipher

Cycle counts for authenticated encryption

Goals of Modern Cryptography

A New Attack on the LEX Stream Cipher

PAPER On Design of Robust Lightweight Stream Cipher with Short Internal State

Network Security Essentials Chapter 2

Outline. Data Encryption Standard. Symmetric-Key Algorithms. Lecture 4

A Related-Key Attack on TREYFER

Information Security CS526

Cryptanalytic Time-Memory-Data Tradeoffs for FX-Constructions with Applications to PRINCE and PRIDE

Improved Attack on Full-round Grain-128

Lecture 2: Secret Key Cryptography

Chapter 3 Block Ciphers and the Data Encryption Standard

Hardware Architectures

International Journal for Research in Applied Science & Engineering Technology (IJRASET) Performance Comparison of Cryptanalysis Techniques over DES

A Cache Timing Analysis of HC-256

Dierential-Linear Cryptanalysis of Serpent? Haifa 32000, Israel. Haifa 32000, Israel

Introduction to Modern Cryptography. Lecture 2. Symmetric Encryption: Stream & Block Ciphers

Homework 2. Out: 09/23/16 Due: 09/30/16 11:59pm UNIVERSITY OF MARYLAND DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING

Computer Security: Principles and Practice

Two Attacks Against the HBB Stream Cipher

Automatic Search for Related-Key Differential Characteristics in Byte-Oriented Block Ciphers

Stream Ciphers: A Practical Solution for Efficient Homomorphic-Ciphertext Compression

Cryptography Trends: A US-Based Perspective. Burt Kaliski, RSA Laboratories IPA/TAO Cryptography Symposium October 20, 2000

On the Security of Stream Cipher CryptMT v3

Syrvey on block ciphers

Computer Security. 08. Cryptography Part II. Paul Krzyzanowski. Rutgers University. Spring 2018

On Lightweight Stream Ciphers with Shorter Internal States

Presented by: Kevin Hieb May 2, 2005

CPSC 467b: Cryptography and Computer Security

Correlated Keystreams in Moustique

Data Encryption Standard

CPSC 467b: Cryptography and Computer Security

IDEA, RC5. Modes of operation of block ciphers

Permutation-based symmetric cryptography

Software implementation and performance comparison of popular block ciphers on 8-bit low-cost microcontroller

Analysis of Involutional Ciphers: Khazad and Anubis

CSE 127: Computer Security Cryptography. Kirill Levchenko

Cryptography for Resource Constrained Devices: A Survey

Meet-in-the-Middle Attack on 8 Rounds of the AES Block Cipher under 192 Key Bits

Attack on DES. Jing Li

Introduction to Modern Symmetric-Key Ciphers

A comparison of time-memory trade-off attacks on stream ciphers

Key Recovery from State Information of Sprout: Application to Cryptanalysis and Fault Attack

Data Encryption Standard

AN INTEGRATED BLOCK AND STREAM CIPHER APPROACH FOR KEY ENHANCEMENT

6 Block Ciphers. 6.1 Block Ciphers CA642: CRYPTOGRAPHY AND NUMBER THEORY 1

Block Ciphers Introduction

Preimage attacks on the round-reduced Keccak with the aid of differential cryptanalysis

EEC-682/782 Computer Networks I

Jaap van Ginkel Security of Systems and Networks

Content of this part

Cryptanalysis of Block Ciphers: A Survey

Fundamentals of Cryptography

Block Ciphers. Lucifer, DES, RC5, AES. CS 470 Introduction to Applied Cryptography. Ali Aydın Selçuk. CS470, A.A.Selçuk Block Ciphers 1

DSP-128: Stream Cipher Based On Discrete Log Problem And Polynomial Arithmetic

Differential Cryptanalysis of the Stream Ciphers Py, Py6 and Pypy

Transcription:

New Time-Memory-Data Trade-Off Attack on the Estream Finalists and Modes of Operation of Block Ciphers Khoongming Khoo DSO National Laboratories, 20 Science Park Drive, S118230, Singapore. kkhoongm@dso.org.sg Chik How Tan Temasek Laboratories, National University of Singapore. tsltch@nus.edu.sg Abstract In this paper, we introduce a new time-memory-data tradeoff attack which can perform better than existing ones by Biryukov-Shamir (BS-TMD), Hong-Sarkar (HS-TMD) and Dunkelman-Keller (DK-TMD). Current Estream ciphers are resistant to these attacks because the state size is too big for the BS-TMD attack, while the pre-processing is at least as expensive as exhaustive search for the HS-TMD and DK- TMD attacks. In contrast, our attack can break the Estream finalists: Grain-v1, Rabbit, Salsa20, SOSEMANUK and MICKEY with pre-processing and online attack complexity faster than exhaustive search. Moreover, our attack can break the AES finalists: Rijndael, Serpent, Twofish, RC6, MARS in CBC, CFB, OFB and counter modes of operation, with pre-processing and online complexity faster than exhaustive search, while existing TMD attacks cannot. We give an analysis of when our attack works on a generic cipher with IV re-sync, and give recommendations on the choice of IV length for adequate security. Keywords Stream Ciphers, Block Ciphers, Time-Memory- Data Trade-Off Attack. 1. Introduction Time-memory trade-off (TMTO) attack was first introduced by Hellman in [14], which is used to invert one-way functions y = f(x). Some applications of TMTO attacks include finding the pre-image of a hash function or finding the secret key/secret state of a stream cipher. In this method, the attacker does a pre-computation that covers the whole search space N through multiple arrays, called Hellman Tables. But he only stores part of this pre-computation, the start and end points of the Hellman tables in a memory of size M. In the online attack, he computes the pre-image x of a target y by making use of the Hellman tables with complexity T = N 2 /M 2. If a memory of M = N 2/3 is used, then the online attack has complexity T = N 2/3. However one limitation of the Hellman attack is that the pre-processing complexity P = N is equivalent to exhaustive search. Thus, it is only useful for ciphers which are marginally breakable, i.e. where it is only feasible to spend a lot of resources to do a one-time pre-computation, after which, the cipher can be broken easily with much less effort. Biryukov and Shamir [6] overcame this limitation for stream ciphers by proposing a time-memory-data trade-off attack on D keystream bits. By taking windows of n bits where n is the state size, the attacker just need to invert any one of the D keystream blocks to find the secret state, from which he can deduce all subsequent keystream. The precomputation complexity is then P = N/D and online attack complexity is T = N 2 /(M 2 D 2 ), but subject to the condition T D 2. For example, if both the internal state and the key has the same size N, then (P, D, M, T ) = (2 3n/4, 2 n/4, 2 n/2, 2 n/2 ) is an admissible attack. Now both pre-computation and online attack complexity can be less than exhaustive search. Because of this attack, subsequent stream cipher designs usually have the state size to be 1.5 to 2 times of the key size and the Biryukov-Shamir attack can be thwarted. In [15], Hong and Sarkar noticed that although the state size is now twice the key size, the IV size is sometimes very short. So they proposed a new time-memory-data trade-off attack that instead of mapping the state to the keystream, now maps a (Key,IV)-tuple to the keystream. The attack has the same trade-off curve as the Biryukov Shamir attack except that the search space N is now KV where K is the key space and V is the IV space. They applied their attack on the initial Estream recommendation of 80-bit key-size and 32-bit IVsize for stream ciphers; and on the GSM cipher A5/3, which has key size 64-bit and IV size 22-bit. They showed that both were insecure and can be attacked with pre-computation and online attack complexity less than exhaustive search. [Copyright notice will appear here once preprint option is removed.] 1 2011/12/6

In [12], Dunkelman and Keller proposed an alternative time-memory-data trade-off attack where D represents the number of IV resyncs. They essentially get the same tradeoff curve as the Biryukov-Shamir attack, but with the condition T D 2 replaced by the condition T D and V D where V is the IV space. With this attack, they manage to lower the pre-processing complexity when attacking modern stream ciphers, but it is still at least as slow as exhaustive search on the secret key space. 1.1 Our Contribution In this paper, we introduce a new time-memory-data tradeoff attack in which both the pre-processing and online attack complexity of modern stream ciphers can be faster than that of exhaustive search. The idea is to break up the available online data complexity into two parts: D IV to be the number of IV re-syncs, and D single to be the number of keystream bits available for each IV. We essentially get the same tradeoff curve as the Biryukov-Shamir attack: P = N/D where D = D IV D single and N = KV ; and online attack complexity T = D + T single where T single = N 2 /(M 2 D 2 ). The attack is subjected to the conditions V D IV, and T single Dsingle 2. We apply this new time-memory-data trade-off attack to various Estream finalists and block ciphers in modes of operations; and also study the relationship of the key length and IV length in practical attacks. We describe these in detail as follows: In Section 4.1, we apply our attack to the Estream finalist Grain-v1 [13] with 80-bit key and break it with 2 76 pre-processing and 2 68 online attack complexity. In comparison, the current known attacks on Grain-v1 cannot break it with both pre-processing and online attack complexity faster than exhaustive search. For example, the conditional differential cryptanalysis of [16] only breaks 104 out of 160 initialization rounds of Grain-v1. It can also be verified that the time-memory-data trade-off attacks of Biryukov-Shamir, Hong-Sarkar and Dunkelman-Keller [6, 12, 15] all have pre-computation complexity worse than exhaustive search. Bjorstad [8] tried to improve the Biryukov-Shamir timememory-data trade-off attack on Grain-v1, by using a guessand-determine attack to decrease the sampling resistance by R = 2 18 which results in lower pre-computation complexity. However, the pre-computation complexity is still between 2 103 and 2 110, which is worse than exhaustive search. In Section 4.2, we also apply our attack to the stream cipher Grain-128 [13] with 128-bit key and break it with 2 120 pre-processing and 2 104 online attack complexity. In comparison, the current known attacks on Grain-128 cannot break it with both pre-processing and online attack complexity faster than exhaustive search. For example, the conditional differential cryptanalysis of [16] only breaks 213 out of 256 initialization rounds of Grain-128, while the dynamic cube attack [11] breaks it for a subset of 2 10 of the possible keys, and not the full key space. It can also be verified that the time-memory-data trade-off attacks of Biryukov-Shamir, Hong-Sarkar and Dunkelman-Keller [6, 12, 15] all have precomputation complexity worse than exhaustive search. Based on the framework presented in [15, Section 4 and Table 1], block cipher in modes of operation like CBC, CFB, OFB and counter modes can be analyzed by TMD attacks. In [15], AES-192 and AES-256 are attacked with online complexities of 2 160 and 2 192 respectively. However, their attack did not take pre-computation time into account. If taken into consideration, they are P = 2 240 and 2 288 respectively for AES-192 and AES-256, which is worse than exhaustive search. In Section 5, we attack AES-192 with pre-computation 2 176 and online complexity 2 144 ; and AES-256 with pre-computation 2 224 and online complexity 2 160. We also showed that the chaining structure of block cipher in modes of operation allows us flexibility in choosing the number of resyncs D IV and amount of keystream per resync D single for our attack. In Section 6.1, we proved that our attack has both preprocessing and online complexity faster than exhaustive search if and only if the IV length is less than the key length. As an application, we prove that besides Grainv1, the other Estream Finalists such as Rabbit, Salsa20, SOSEMANUK and MICKEY[2 4, 7] can also be attacked. When applying to block ciphers in CBC, CFB, OFB and counter modes of operation, the AES finalists Rijndael, Serpent, Twofish, RC6, MARS [1, 5, 10, 20, 21], as well as standard ciphers like KASUMI, IDEA and SAFER SK-128 [17 19] can all be attacked by our method. In comparison, we prove that if the IV length is at least half the key length, then the Hong-Sarkar attack cannot have both pre-processing and online attack complexity faster than exhaustive search. While the pre-processing complexity for the Dunkelman-Keller attack is always worse than exhaustive search. Thus, our attack has better overall complexity as compared to previous time-memory-data trade-off attacks on ciphers with IV resyncs. Therefore to prevent our time-memory-data trade-off attack where pre-processing is faster than exhaustive search, the IV length has to be at least as long as the key length. In Section 6.2, we also propose a more practical application scenario where the IV is allowed to be shorter than the key length as long as both the pre-processing and online attack are less than an impractically high complexity. If 2 s is considered an impractical attack complexity to launch, then the IV only need to be at least (2s k)-bit long when the key is k-bit long. For example, if the secret key is 256- bit and we consider 2 160 to be impractical, then the IV can be 64-bit long. 2 2011/12/6

2. Existing Time-Memory-Data Trade-Off (TMD) Attacks on Stream Ciphers 2.1 Biryukov-Shamir (BS-TMD) Attack [6] Let N = 2 n be the stream cipher state space, M be memory used to store the pre-computed data, D be total number of data points (keystream blocks) available in an online attack, P be the pre-computation complexity and T be the online attack complexity. In the pre-computation phase, choose m, t such that mt 2 = N. Form t/d Hellman tables of size m t as follows: Randomly choose m starting points corresponding to n-bit states of the stream cipher. For each start point, form a chain of length t by iteratively applying the stream cipher f( ) and using the n-bit keystream as the state for the next point. Then, mt t/d = N/D of the state space is covered by all the tables. After forming each table, only the start and end points are stored in memory, the rest of the data are discarded. In total, M = m t/d memory is used. During an online attack, the attacker collects D target keystream blocks. For each target keystream y, he checks if y = f i (end point) for an end point of each Hellman table. If there is a match, then f t i 1 (start point) of the corresponding start point will be the correct state which gives this keystream. Pre-processing: P = N D Online Attack: T = D t D t = t2 = N 2 M 2 D 2, where N = mt 2, M = mt/d. Note that the attack is valid only when there is at least one table, i.e. t/d 1 or T D 2. Remark 1. When D = 1, then the above attack reduces to Hellman s TMTO attack which has complexities P = N and T = N 2 /M 2. 2.2 Hong-Sarkar (HS-TMD) Attack [15] Let K be the key space, V be IV space of a stream cipher. The Hong-Sarkar TMD attack is essentially the BS-TMD attack, except that the search space is {Key Space} {IV Space} with size N = K V. We treat both the secret key and IV as unknown in the pre-computation phase. The rest of the attack is similar to the BS-TMD attack, except that each point in the Hellman tables corresponds to a particular (Key, IV )-tuple. These points are used to initialize the stream cipher f( ) where a (k + v)-bit keystream block is used as the next (Key, IV )-tuple. Finally, N/D of the (Key, IV ) search space is covered by all the tables. The trade-off curve for this attack is the same as the BS- TMD attack using N = K V. The only difference is that the target is now the key and IV space. Hong and Sarkar used this idea to attack the GSM A5/3 cipher [15, Section 3.3], where the 128-bit state size is twice the 64-bit secret key, so that the BS-TMD attack on the state will not have good complexity. Due to small IV size of 22 bits, it allows for the HS-TMD attack to have online and pre-processing complexity smaller than 2 64. 2.3 Dunkelman-Keller (DK-TMD) Attack [12] Dunkelman and Keller proposed an alternative TMD attack which exploits the fact that the IV is known during an online attack. They consider a scenario where only one keystream block corresponding to each of D IV s needs to be known to the adversary. First, the adversary performs the TMTO pre-computation individually for each fixed IV. The memory and pre-computation complexity for a single IV are M single and K; and the total memory and pre-computation for all V/D IV s are M = V/D M single and P = V/D K respectively. In an online attack, the attacker waits for an IV to occur which matches one of his pre-computed IV. Since the probability of a matching IV is (V/D)/V = 1/D, this is expected to occur after D IV-resyncs. Then he proceeds to do a TMTO attack for that IV, with complexity K 2 /M 2 single to find the secret key. Pre-processing: P = K V/D = N/D, Online Attack: T = D + K2 M 2 single = D + K2 V 2 M 2 D 2, because M single = M D V = D + N 2 M 2 D 2 So we essentially get the same trade-off curve as the BS- TMD and HS-TMD attacks, but with the condition T D 2 replaced by the conditions V D and T D. 2.4 Limitation of the Biryukov-Shamir, Hong-Sarkar and Dunkelman-Keller TMD Attacks In attacking symmetric ciphers, the usual definition of a successful attack is one where the complexity is faster than exhaustive search. Sometimes when the key length is short, the current literature for time-memory-data trade-off attack allows the pre-computation to be worse than exhaustive search, while the subsequent online attack is more efficient than exhaustive search. For example, Bjorstad applied the BS-TMD attack on the Estream finalist Grain-v1 (80-bit key, 64-bit IV, 160-bit state) [8] where the online attack complexity is between 2 64 and 2 78 but the corresponding pre-computation complexity is between 2 110 and 2 103 respectively. However, when we apply the known TMD attacks on a stream cipher of larger key size, e.g. key size of 128, 192 or 256 bits, the pre-processing complexity becomes infeasible. As an example, let us consider the Grain-128 stream cipher with 128-bit key, 96-bit IV and 256-bit state. 3 2011/12/6

For the BS-TMD attack, T < 2 128 implies D T < 2 64. Then the pre-processing complexity will be P = N/D > 2 256 64 = 2 192 which is infeasible. For the HS-TMD attack, T < 2 128 implies D T < 2 64. Then the pre-processing complexity will be P = N/D = KV/D > 2 128+96 64 = 2 160 which is infeasible. For the DK-TMD attack, preprocessing complexity is P = N/D = KV/D. But D being the number of IV s is at most V, therefore P K = 2 128, which is a high complexity. In this case, the attacker only do one IV precomputation, thus he needs the sender to cycle through all 2 96 IV resync s before he hits the right IV. 3. A New Improved Time-Memory-Data Trade-Off Attack on Stream Ciphers In this section, we propose an improved TMD attack on stream ciphers with IV-resync which performs better than the BS-TMD, HS-TMD and DK-TMD attack. More specifically, our attack can achieve both pre-processing and online complexity faster than exhaustive search for scenarios where the previous attacks cannot. We describe our attack as follows. Let N = K V. We assume a known plaintext attack where each ciphertext bit corresponds to a keystream bit. 1. The attacker fixes two parameters: (a) D IV : The number of IV re-syncs in an online attack. (b) D Single : The amount of ciphertext bits (equivalently keystream bits) transmitted for each IV. The total number of online data is D = D IV D single. 2. He chooses V/D IV IV s randomly. For each fixed IV, he goes through the pre-processing phase of a BS- TMD attack with pre-processing complexity K/D single and memory M single. The total pre-processing time is V/D IV K/D single = N/D. The total memory used is M = V/D IV M single. 3. In an online attack, the attacker waits for an IV to occur which matches one of his pre-computed IV. Since the probability of a matching IV is (V/D IV )/V = 1/D IV, this is expected to occur after D IV IV-resyncs. Because D single bits are transmitted per IV, the total waiting time for a matching IV is D = D IV D single. 4. After the attacker observes a matching IV, he proceeds to do a TMD attack with complexity: K 2 T single = Msingle 2, D2 single to find the secret key. The online complexity, which adds D (time to wait for a pre-processed IV) and T single (attack complexity on a single IV), is: T = D + T single K 2 = D + Msingle 2 D2 single K 2 V 2 = D + M 2 DIV 2, D2 single because M single = M D IV V = D + N 2 M 2 D 2, because N = KV, D = D IV D single. We essentially get the same complexity as the BS-TMD, HS- TMD and DK-TMD attacks. However, we have a different set of conditions on the data D = D IV D single, where D IV V and Dsingle 2 T single. In the next two sections, we shall see how this method enables us to break Grain and AES modes of operation with pre-processing and online attack complexity faster than exhaustive search, while the previous three methods cannot. 4. Attack on Grain-v1 and Grain-128 with Pre-Processing and Online Complexity Faster than Exhaustive Search Grain-v1 is an Estream finalist with key size 80-bit, IV size 64-bit and state size 160-bit [13]. There is a variant of Grain called Grain-128 which has 128-bit key, 96-bit IV and 256- bit state [13]. 4.1 Attack on Grain-v1 Consider the HS-TMD attack on Grain-v1 with key size 80- bit and IV size 64-bit. To get online attack complexity T < 2 80, we need D T < 2 40. However, that means preprocessing complexity P = KV/D = 2 80+64 40 > 2 104, which is worse than exhaustive search. When we apply the BS-TMD attack on the 160-bit state space of Grain-v1, we again need D < 2 40 to have T < 2 80 and thus P = N/D > 2 160 40 = 2 120. Bjorstad [8] used a guess and determine attack on the state space to decrease the sampling resistance to R = 2 18 so that the condition D 2 < T is relaxed to (RD) 2 < T. This allows for a lower pre-processing complexity of 2 103. However, it is still worse than exhaustive search. Finally, as noted in Section 2.4, the DK-TMD attack has pre-processing P > 2 80. We will apply the attack of Section 3 on Grain-v1 to get both pre-processing and online attack complexity < 2 80. We have K = 2 80, V = 2 64 and N = K V = 2 144. Choose D single = 2 20 and D IV = 2 48, thus D IV V. Then the total online data needed for the attack is: D = D IV D single = 2 68. 4 2011/12/6

The pre-processing complexity is: P = N D = 2144 68 = 2 76. Choose a memory size of M = 2 56, then the online attack complexity for a single IV is: T single = N 2 M 2 D 2 = 2 2(144 56 68) = 2 40 Dsingle. 2 The online complexity satisfies: T = D + T single = 2 68 + 2 40 2 68. 4.2 Attack on Grain-128 As explained in Section 2.4, the BS-TMD, HS-TMD and DK-TMD attacks on Grain-128 all have pre-processing complexity > 2 128 which is infeasible. We will apply the attack of Section 3 on Grain-128 to get both pre-processing and online attack complexity < 2 128. We have K = 2 128, V = 2 96 and N = K V = 2 224. Choose D single = 2 32 and D IV = 2 72, thus D IV V. Then the total online data needed for the attack is: D = D IV D single = 2 104. The pre-processing complexity is: P = N D = 2224 104 = 2 120. Choose a memory size of M = 2 88, then the online attack complexity for a single IV is: T single = N 2 M 2 D 2 = 2 2(224 88 104) = 2 64 Dsingle. 2 The online complexity satisfies: T = D + T single = 2 104 + 2 64 2 104. 5. Attack on AES in Modes of Operation with Pre-Processing and Online Complexity Faster than Exhaustive Search Attacking block ciphers in the OFB and counter modes of operation are straightforward adaptation of TMD attacks on the keystream, which can be deduced from known plaintexts. In [15], Hong and Sarkar showed that block ciphers in CBC and CFB modes of operation can also be attacked, but in a chosen plaintext setting. The plaintext is chosen to be repetitions of a fixed message block m, so that each (Key,IV) would generate keystream blocks (c 1, c 2, c 3, ). Remark 2. Moreover, in all four modes of operation, if the adversary can obtain D + w keystream blocks for a window of size w, he just needs any of the keystream block c i for i = 1,..., w to match one of his pre-computed IV in our attack. This is because c i can be regarded as the IV to generate the keystream (c i+1, c i+2, c i+3,...) under the key K. 5.1 Attack on AES-192 The key space is K = 2 192 and IV space is V = 2 128, which implies N = KV = 2 320. In [15], the authors applied the HS-TMD attack with M = 2 160 and D = 2 80 to get T = 2 2(320 160 80) = 2 160 D 2. However, the pre-processing complexity is P = N/D = 2 320 80 = 2 240 which is worse than exhaustive search. Our Attack: Choose D single = 2 48, D IV = 2 96 < 2 128, then the total online data is D = D IV D single = 2 144 and pre-processing complexity is P = N/D = 2 320 144 = 2 176. Let the total memory used be M = 2 128. Then, the attack complexity of a single IV satisfies T single = 2 2(320 128 144) = 2 96 Dsingle 2, and the total online attack time is T = D + T single = 2 144. Because of Remark 2, the attacker may not need to wait for D IV = 2 96 resyncs with 2 48 data per resync. He could wait for e.g., 2 76 resyncs and collect 2 68 data per resync. If any of the ciphertext block in the initial 2 20 data matches a pre-computed IV, he will take a window of 2 48 data to do the TMD attack for that IV. Thus the chaining structure for the mode of operation allows us to have flexibility when choosing D single and D IV. 5.2 Attack on AES-256 The key space is K = 2 256 and IV space is V = 2 128, which implies N = KV = 2 384. In [15], the authors applied the HS-TMD attack with M = 2 192 and D = 2 96 to get T = 2 2(384 192 96) = 2 192 D 2. However, the pre-processing complexity is P = N/D = 2 384 96 = 2 288 which is worse than exhaustive search. Our Attack: Choose D single = 2 64, D IV = 2 96 < 2 128, then total online data is D = D IV D single = 2 160 and pre-processing complexity is P = N/D = 2 384 160 = 2 224. Let the total memory used be M = 2 160. Then, the attack complexity of a single IV satisfies T single = 2 2(384 160 160) = 2 128 Dsingle 2, and the total online attack time is T = D + T single = 2 160. Similar to the previous attack, the adversary has flexibility in choosing D single and D IV because of the chaining structure of modes of operation as explained in Remark 2. 5 2011/12/6

6. Some Practical Considerations 6.1 Choice of Key-IV Length for Protection or Against Our TMD Attack In this section, we study the condition of the attack of Section 3 having pre-processing and online attack complexity faster than exhaustive search. From it, we deduce what the IV length should be to defend against this attack. Theorem 1. Consider a stream cipher with Key Space K = 2 k and IV space V = 2 v. 1. If v k and we require the online attack complexity to satisfy T < K for the attack in Section 3, then the preprocessing complexity satisfies P > K. 2. If v < k, then the pre-processing and online complexity of the attack in Section 3 can both be faster than exhaustive search, i.e. P, T < K. Proof. 1. For the online complexity T = D + T single to be less than K, this implies D < K. Then the preprocessing complexity is as follows: P = N D = KV D K2, by assumption, V K D > K, as D < K. 2. Choose M single = 2 k/2 and D single = 2 k/4. Then the online attack complexity for a single IV is: T single = Choose D IV such that: K 2 M 2 single D2 single = 2 2(k k/2 k/4) = 2 k/2 D 2 single. 2 v k/4 < D IV < min(2 v, 2 3k/4 ). Such a D IV can be chosen because v < k implies v k/4 < min(v, 3k/4). Also, if v < k/4 in the lower bound, it means we can take any value of D IV 1. Multiplying the above inequality by D single = 2 k/4, we get: 2 v < D = D single D IV < min(2 v+k/4, 2 k ) 2 k. The pre-processing complexity satisfies: P = N D = KV D < 2k+v v = 2 k = K. The online complexity satisfies: T = D + T single < 2 k + 2 k/2 2 k = K. From Theorem 1, we have the following corollary: Corollary 1. In a stream cipher, the pre-processing and online complexity of the attack of Section 3 cannot both be faster than exhaustive search if and only if the IV length is at least as long as the key length. For the sake of comparison, we prove the following proposition which is taken from [22] with a new proof. From here, we see that our attack, which allows for faster preprocessing, is more effective than the HS-TMD and DK- TMD attacks. It also imposes a more stringent constraint on the length of the IV for adequate security. Proposition 1. 1. In the BS-TMD attack [6] on a stream cipher, if the state size is at least 3/2 times the key length, then the pre-processing and online attack complexity cannot both be faster than exhaustive search. 2. In the HS-TMD attack [15] on a stream cipher, if the IV length v is at least half the key length k, then the preprocessing and online attack complexity cannot both be faster than exhaustive search. 3. In the DK-TMD attack [12] on a stream cipher, the preprocessing complexity is at least the exhaustive search complexity irrespective of the IV length. Proof. 1. For the BS-TMD online attack complexity to be less than exhaustive search, we need T < K. Because D 2 T, this implies D < K 1/2. Then N K 3/2 implies P = N/D > (K 3/2 )/K 1/2 = K. 2. The assumption v 1 2 k implies V K1/2. For the HS- TMD online attack complexity to be less than exhaustive search, we need T < K. Because D 2 T, this implies D < K 1/2. Then P = KV/D > (K K 1/2 )/K 1/2 = K. 3. Since D IV is the number of IV s, we have D IV V, which implies the pre-processing of the DK-TMD attack satisfies P = KV/D IV K. Remark 3. Although the authors of [15] recommended the IV to be at least as long as the key, that is because they allow the precomputation time to be worse than exhaustive search in their estimation. 6.1.1 Applications to Estream Finalists. Besides the cipher Grain-v1 and Grain-128 [13] which we attacked in Sections 4.1 and 4.2, the other Estream finalists Rabbit, Salsa20, SOSEMANUK and MICKEY [2 4, 7] are also susceptible to our attack by Theorem 6.1, because the IV size is smaller than the key size as shown in Table 1. The attack does not apply to HC-128 and Trivium [9, 23] because the key size is equal to the IV size. In comparison, the BS-TMD, HS-TMD and DK-TMD Attacks [6, 12, 15] on these stream ciphers are not faster than exhaustive search by Proposition 1. 6 2011/12/6

Table 1. Comparison of TMD Attacks on Estream Finalists Cipher Key IV State Our Attack Existing Size (Section 3) Attacks HC-128 128 128 32778 No No Rabbit 128 64 513 Yes No Salsa20 128 64 512 Yes No SOSEMANUK 128 64 384 Yes No Grain-v1 80 64 160 Yes No MICKEY-v2 80 64 200 Yes No TRIVIUM 80 80 288 No No Note : The existing attacks refers to BS-TMD, HS-TMD and DK- TMD attack. Table 2. Comparison of TMD Attacks on Block Ciphers Cipher Key IV Our Attack HS-TMD (Section 3) and DK-TMD Rijndael 192,256 128 Yes No Serpent 192,256 128 Yes No Twofish 192,256 128 Yes No RC6 192,256 128 Yes No MARS 192,256 128 Yes No IDEA 128 64 Yes No SAFER 128 64 Yes No KASUMI 128 64 Yes No SMS4 128 128 No No AES-128 128 128 No No 6.1.2 Applications to Block Ciphers Many of today s block ciphers has block size 128-bit (also IV size) and key sizes 128, 192 or 256-bit as specified by the NIST Advanced Encryption Standard competition. This includes the five finalists Rijndael, Serpent, Twofish, RC6 and MARS [1, 5, 10, 20, 21]. When they are used in modes of operation like CBC, CFB, OFB and counter mode, the versions with 192-bit and 256-bit keys are susceptible to our attack as shown in the computations of Section 5 and by Theorem 1. Also, well-known ciphers like IDEA, SAFER SK-128 and KASUMI [17 19], has 64-bit block (IV) and 128-bit key, so again by Theorem 1, they can be broken by our attack. In contrast, The attack does not apply to SMS4 and AES-128 because the 128-bit key size is equal to the IV size. In comparison, the HS-TMD and DK-TMD Attacks on these block ciphers are not faster than exhaustive search by Proposition 1. For reference, we lists the key and IV sizes of the block ciphers we considered in Table 2. 6.2 Usage of short IVs In practice, IV resync information is frequently sent. So to save bandwidth, it might be advantageous to use shorter IV for better performance. But as pointed out by Hong and Sarkar in [15, Section 3.3] on the original Estream call for ciphers and [15, Section 3.4] on the GSM A5/3 ciphers, short IV s will lead to attacks with low complexity. However, if the secret key is long, e.g. 256-bit, then the pre-computation and online attack complexity, though faster than exhaustive search, might still be impractical to launch. Let us formalize this notion in the following proposition. Proposition 2. Consider a stream cipher with key space K = 2 k and IV space V = 2 v. Let K secure = 2 s be an attack complexity that is impractical to launch in practice. If the IV length is at least 2s k, then the pre-processing and online complexity of the attack of Section 3 cannot both be faster than K secure. Proof. For the online attack complexity to be faster than K secure = 2 s, we need T = D + T single < 2 s which implies D < 2 s. However, the pre-processing complexity is: P = KV D > 2k+(2s k) s = 2 s = K secure. Example 1. Consider a stream cipher with 192-bit key and suppose 2 160 to be an impractical complexity to attack, then we just need an IV of length 2 160 192 = 128 bits. Example 2. Consider a stream cipher with 256-bit key and suppose 2 160 to be an impractical complexity to attack, then we just need an IV of length 2 160 256 = 64 bits. 7. Conclusion We have proposed a new time-memory-data trade-off attack that performs better than existing ones. It has a similar tradeoff curve as existing attacks but a new set of necessary conditions on the online data D IV and D single, which allows us to attack previously unbroken ciphers. We prove that we can have both pre-processing and online attack complexity faster than exhaustive search whenever the IV length is less than the key length. We applied our attack to break the Estream ciphers such as Grain-v1, Rabbit, Salsa20, SOSEMANUK and MICKEY [2 4, 7, 13]; and also the block ciphers such as Rijndael, Serpent, Twofish, RC6, MARS, IDEA, SAFER SK-128 and KASUMI [1, 5, 10, 17 21] in CBC, CFB, OFB and counter modes of operation. We have not explored other areas where TMD attack can be applied. Some of the areas suggested in [15] includes attacking block ciphers in a multi-user setting, inverting cryptographic hash functions, breaking Message Authentication Codes (MACs) and attacking public key cryptography like NTRUEncrypt and generic signature schemes. We will leave these as open problems and future work. References [1] R. Anderson, E. Biham, and L. Knudsen, Serpent: A Proposal for the Advanced Encryption Standard, AES algorithm submission, June 1998, available at 7 2011/12/6

[2] S. Babbage and M. Dodd, The MICKEY Stream Ciphers, LNCS 4986, New Stream Cipher Designs: The Estream Finalists, pp. 191-209, LNCS 4986, Springer, 2008. [3] C. Berbain, O. Billet, A. Canteaut, N. Courtois, H. Gilbert, L. Goubin, A. Gouget, L. Granboulan, C. Lauradoux, M. Minier, T. Pornin and H. Sibert, SOSEMANUK, a Fast software- Oriented Stream Cipher, LNCS 4986, New Stream Cipher Designs: The Estream Finalists, pp. 98-118, LNCS 4986, Springer, 2008. [4] D. Bernstein, The Salsa20 Family of Stream Ciphers, LNCS 4986, New Stream Cipher Designs: The Estream Finalists, pp. 84-97, LNCS 4986, Springer, 2008. [5] C. Burwick, et al., MARS A Candidate Cipher for AES, AES algorithm submission, August 20, 1999, available at [6] A. Biryukov and A. Shamir, Cryptanalytic Time/Memory/Data Tradeoffs for Stream Ciphers, LNCS 1976, Asiacrypt 2000, pp. 1-13, Springer, 2000. [7] M. Boesgaard, C. Mcdonald, M. Paddon, G. Rose, M. Vries, The Rabbit Stream Cipher, LNCS 4986, New Stream Cipher Designs: The Estream Finalists, pp. 69-83, LNCS 4986, Springer, 2008. [8] Tor E. Bjorstad, Cryptanalysis of Grain using Time/Memory/Date Tradeoffs, on Estream Phase 3 Archive, http://www.ecrypt.eu.org/stream/papersdir/2008/012.pdf [9] C. Canniere and B. Preneel, TRIVIUM, LNCS 4986, New Stream Cipher Designs: The Estream Finalists, pp. 244-266, LNCS 4986, Springer, 2008. [10] J. Daemen and V. Rijmen, AES Proposal: Rijndael, AES algorithm submission, September 3, 1999, available at [11] I. Dinur and A. Shamir, Breaking Grain-128 with Dynamic Cube Attacks, LNCS 6733, FSE 2011, pp. 167-187, Springer, 2011. [12] O. Dunkelman and N. Keller, Treatment of the initial value in Time-Memory-Data Tradeoff attacks on stream ciphers, Inf. Process. Lett., vol. 107 no. 5, pp. 133-137, 2008. [13] M. Hell, T. Johansson, A. Maximov and W. Meier, The Grain Family of Stream Ciphers, LNCS 4986, New Stream Cipher Designs: The Estream Finalists, pp. 179-190, LNCS 4986, Springer, 2008. [14] M. Hellman, A Cryptanalytic Time-Memory Trade-Off, IEEE Trans. on Information Theory, vol. 26, pp. 401-406, 1980. [15] J. Hong and P. Sarkar, New Applications of Time Memory Data Tradeoffs, LNCS 3788, Asiacrypt 2005, pp. 353-372, Springer, 2005. [16] S. Knellwolf, W. Meier and M. Naya-Plasencia, Conditional Differential Cryptanalysis of NLFSR-Based Cryptosystems, LNCS 6477, Asiacrypt 2010, pp. 130-145, Springer, 2011. [17] Xuejia Lai and James L. Massey, A Proposal for a New Block Encryption Standard, LNCS 473, Eurocrypt 1990, pp. 389404, Springer, 1991. [18] J.L. Massey, Announcement of a Strengthened Key Schedule for the Cipher SAFER, September 9, 1995. [19] Matsui, Mitsuru; Tokita, Toshio (Dec. 2000). MISTY, KA- SUMI and Camellia Cipher Algorithm Development. Mitsibishi Electric Advance (Mitsibishi Electric corp.) 100: 28. ISSN 1345-3041. [20] R. Rivest, et al., The RC6 Block Cipher, AES algorithm submission, June 1998, available at [21] B. Schneier, et al., Twofish: A 128-Bit Block Cipher, AES algorithm submission, June 15, 1998, available at [22] C. H. Tan and K. Khoo, Revisit guideline of stream ciphers based on Time-Memory-Data tradeoff attacks, submitted to journal. [23] H. Wu, The Stream Cipher HC-128, LNCS 4986, New Stream Cipher Designs: The Estream Finalists, pp. 39-47, LNCS 4986, Springer, 2008. 8 2011/12/6