Linear Analysis of Reduced-Round CubeHash

Similar documents
Linear Analysis of Reduced-Round CubeHash

Linear Cryptanalysis of Reduced-Round Speck

Low-weight Pseudo Collision Attack on Shabal and Preimage Attack on Reduced Shabal-512

Quantum Preimage and Collision Attacks on CubeHash

New attacks on Keccak-224 and Keccak-256

Differential-Linear Cryptanalysis of Serpent

The Usage of Counter Revisited: Second-Preimage Attack on New Russian Standardized Hash Function

Algebraic properties of SHA-3 and notable cryptanalysis results

Practical Complexity Cube Attacks on Round-Reduced Keccak Sponge Function

How to Improve Rebound Attacks. María Naya-Plasencia FHNW - Switzerland

Rebound Attack on Reduced-Round Versions of JH

Martin Cochran. August 24, 2008

A Five-Round Algebraic Property of the Advanced Encryption Standard

Preimage Attacks on Reduced Tiger and SHA-2

The Usage of Counter Revisited: Second-Preimage Attack on New Russian Standardized Hash Function

Further progress in hashing cryptanalysis

Weaknesses in the HAS-V Compression Function

Cryptanalysis of the 10-Round Hash and Full Compression Function of SHAvite-3-512

A New Distinguisher on Grain v1 for 106 rounds

Distinguishers for the Compression Function and Output Transformation of Hamsi-256

The Hash Function JH 1

Rotational Cryptanalysis of ARX Revisited

Collision Attack on Boole

Analysis of SHA-1 in Encryption Mode

New Attacks on the Concatenation and XOR Hash Combiners

Preimage and Pseudo-Collision Attacks on Step-Reduced SM3 Hash Function

Distinguishing Attacks on a Kind of Generalized Unbalanced Feistel Network

Attacks on Hash Functions based on Generalized Feistel Application to Reduced-Round Lesamnta and SHAvite-3 512

Cryptanalysis of EnRUPT

Chapter 1 - Linear cryptanalysis.

The SHA Family of Hash Functions: Recent Results

Inside the Hypercube

Provable Seconde Preimage Resistance Revisited

Second Preimages for Iterated Hash Functions and their Implications on MACs

Experiments on the Multiple Linear Cryptanalysis of Reduced Round Serpent

Complementing Feistel Ciphers

Chapter 2 - Differential cryptanalysis.

Beyond the MD5 Collisions

Differential Attack on Five Rounds of the SC2000 Block Cipher

Linear Approximations for 2-round Trivium

Improved Generic Attacks Against Hash-based MACs and HAIFA

Forgery and Partial Key-Recovery Attacks on HMAC and NMAC Using Hash Collisions

Higher-order differential properties of Keccak and Luffa

Lecture 4: DES and block ciphers

Rotational cryptanalysis of round-reduced Keccak

A (Second) Preimage Attack on the GOST Hash Function

Finding good differential patterns for attacks on SHA-1

Linear Cryptanalysis

Differential and Rectangle Attacks on Reduced-Round SHACAL-1

ON DISTINGUISHING ATTACK AGAINST THE REDUCED VERSION OF THE CIPHER NLSV2

SMASH - A Cryptographic Hash Function

Parallel Cube Tester Analysis of the CubeHash One-Way Hash Function

Collision Attacks on Up to 5 Rounds of SHA-3 Using Generalized Internal Differentials

On the pseudo-random generator ISAAC

The Security of Abreast-DM in the Ideal Cipher Model

Practical Near-Collisions and Collisions on Round-Reduced ECHO-256 Compression Function

Preimages for Step-Reduced SHA-2

SOBER Cryptanalysis. Daniel Bleichenbacher and Sarvar Patel Bell Laboratories Lucent Technologies

Improved characteristics for differential cryptanalysis of hash functions based on block ciphers

Cryptanalysis of 1-Round KECCAK

Impact of Rotations in SHA-1 and Related Hash Functions

Higher-order differential properties of Keccak and Luffa

Rebound Distinguishers: Results on the Full Whirlpool Compression Function

Analysis of cryptographic hash functions

Cryptanalysis on HMAC/NMAC-MD5 and MD5-MAC

Cube Test Analysis of the Statistical Behavior of CubeHash and Skein

Higher-order differential properties of Keccak and Luffa

Lecture 10 - MAC s continued, hash & MAC

Improved Collision Attacks on the Reduced-Round Grøstl Hash Function

Near-Collisions on the Reduced-Round Compression Functions of Skein and BLAKE

Distinguishing Attacks on MAC/HMAC Based on A New Dedicated Compression Function Framework

Lecture 14: Cryptographic Hash Functions

Practical Near-Collisions and Collisions on Round-Reduced ECHO-256 Compression Function

Distinguishers for the Compression Function and Output Transformation of Hamsi-256

SMASH - A Cryptographic Hash Function

Public-key Cryptography: Theory and Practice

Subspace Trail Cryptanalysis and its Applications to AES

Cryptanalysis of SP Networks with Partial Non-Linear Layers

Mixed-integer Programming based Differential and Linear Cryptanalysis

Linear Cryptanalysis of Reduced-Round PRESENT

Impossible Differential-Linear Cryptanalysis of Reduced-Round CLEFIA-128

Related-Key Rectangle Attack on 42-Round SHACAL-2

On the Security of NOEKEON against Side Channel Cube Attacks

Breaking Symmetric Cryptosystems Using Quantum Algorithms

Towards Provable Security of Substitution-Permutation Encryption Networks

Preimage Attacks on 3, 4, and 5-Pass HAVAL

EME : extending EME to handle arbitrary-length messages with associated data

Fault Analysis of the KATAN Family of Block Ciphers

CPSC 467: Cryptography and Computer Security

Improved Impossible Differential Cryptanalysis of Rijndael and Crypton

New Combined Attacks on Block Ciphers

The Impact of Carries on the Complexity of Collision Attacks on SHA-1

Structural Evaluation of AES and Chosen-Key Distinguisher of 9-round AES-128

Structural Cryptanalysis of SASAS

Extended Criterion for Absence of Fixed Points

Improving the Time Complexity of Matsui s Linear Cryptanalysis

New Preimage Attack on MDC-4

Week 12: Hash Functions and MAC

Cryptanalysis of Tweaked Versions of SMASH and Reparation

Revisiting the Wrong-Key-Randomization Hypothesis

Transcription:

Linear Analysis of Reduced-Round CubeHash Tomer Ashur and Orr Dunkelman, Faculty of Mathematics and Computer Science Weizmann Institute of Science P.O. Box, Rehovot 00, Israel tomerashur@gmail.com Computer Science Department University of Haifa Haifa 0, Israel orrd@cs.haifa.ac.il Abstract. Recent developments in the field of cryptanalysis of hash functions has inspired NIST to announce a competition for selecting a new cryptographic hash function to join the SHA family of standards. One of the second-round candidates was CubeHash designed by Daniel J. Bernstein. CubeHash is a unique hash function in the sense that it does not iterate a common compression function, and offers a structure which resembles a sponge function, even though it is not exactly a sponge function. In this paper we analyze reduced-round variants of CubeHash where the adversary controls the full 0-bit input to reduced-round CubeHash and can observe its full output. We show that linear approximations with high biases exist in reduced-round variants. For example, we present an -round linear approximation with bias of, which allows distinguishing - round CubeHash using about 0 queries. We also discuss the extension of this distinguisher to rounds using message modification techniques. Finally, we present a linear distinguisher for -round CubeHash which uses about queries. Key words: CubeHash SHA- competition, Linear cryptanalysis. Introduction Recent developments in the field of hash function cryptanalysis [, 0] along with new results targeted against commonly used hash functions [,,, ] has urged the National Institute of Standards and Technology to announce a competition for the development of a new hash standard, SHA- []. The National Institute of Standards and Technology has received hash function proposals for the competition, out of which met the submission criteria and were accepted to the first round of the competition. Following the first round of analysis, in which the security and performance claims of the submitters were challenged, candidates were selected to the second round of the SHA- competition. One of these candidates was CubeHash designed by Daniel J. Bernstein []. Although CubeHash did not pass to the third round of the SHA- competition, it is still of interest to challenge its security. CubeHash is a family of cryptographic hash functions, parameterized by the performance and security required. CubeHash has an internal state of 0 bits, which are processed by calling a transformation named T, a tweakable number of times r, between introductions of new b-byte message blocks (b is also a tunable parameter). At the end, after a final permutation, namely, T repeated 0r times,

h bits of the state are used as an output. By selecting different values of h, b, and r, different security/performance tradeoffs are provided. Currently, several sets of parameters are suggested, where the normal security values are r =, b = (for h {,,, }) []. In this paper we analyze the security of several variants of CubeHash against linear cryptanalysis. Our analysis found a linear approximation for -round Cube- Hash with bias of =. We limited the analysis to biases of no less than, as we felt that a hash function offering a -bit security (in its strongest variant), should not be assessed with attacks taking more than queries. One can also extend the -round linear approximation into a -round distinguisher using simple message modification techniques [] (or a chosen-plaintext linear cryptanalysis []). We note that when removing this restriction, one can find -round linear approximations with bias of 0. Exploiting this approximation requires querying T about times, which is outside the security model. At the same time, if T or CubeHash are ever used in different settings, this may provide some indication concerning its security. This paper is organized as follows: In Section we describe CubeHash s compression function. In Section we describe the linear approximations found for CubeHash. In Section we describe how bit fixing can be used to distinguish more rounds than in the approximation. In Section we quickly cover a possible application of our results. Finally, Section concludes this paper. A Brief Description of CubeHash As mentioned before, CubeHash is a tweakable hash function, where the shared part of all its variants is the internal state (of 0 bits), and the use of the same round function T. To initialize the hash function, h (the digest size), r the number of times T is iterated between message blocks, and b the size of the message blocks (in bytes), are loaded into the state. Then, the state is updated using 0r applications of T. At this point, the following procedure is repeated with any new message block: the b-byte block is XORed into the -byte state, and the state is updated by applying T r (r times applying T ) to the state. After processing the padded message, the state is XORed with the constant, and is processed by applying T 0r. The output is composed of the first h/ bytes of the state. The 0 bits of the internal state are viewed as a sequence of -byte words x 00000, x 0000,..., x each of which is interpreted in a little-endian form as a - bit unsigned integer. The round function T of CubeHash is based on the following ten operations:. Add (modulo ) x 0jklm into x jklm, for all (j, k, l, m).. Rotate x 0jklm left by bits, for all (j, k, l, m).. Swap x 00klm with x 0klm, for all (k, l, m).. XOR x jklm into x 0jklm, for all (j, k, l, m). We note that there is a formal variant of CubeHash for which r =, b = and h {, }. We note that CubeHash is a full hash function which is not easily defined in the common settings. Hence, -round CubeHash stands for iterating times the transformation T. We remind the reader that our analysis usually assumes the adversary can choose the full 0-bit input to T and observe the full 0-bit output from T.

. Swap x jk0m with x jkm, for all (j, k, m).. Add (modulo ) x 0jklm into x jklm, for all (j, k, l, m).. Rotate x 0jklm left by bits, for all (j, k, l, m).. Swap x 0j0lm with x 0jlm, for all (j, l, m).. XOR x jklm into x 0jklm, for all (j, k, l, m). 0. Swap x jkl0 with x jkl, for all (j, k, l). The structure is represented in a little endian form, i.e., x 00000 is composed of the four least significant bytes of the state and x is composed of the most significant four. We note that the only nonlinear operations with respect to GF() are the modular additions.. Previous Results on CubeHash Following its simple structure, CubeHash has received a lot of cryptanalytic attention. Some of the attacks, such as the ones of [, ], can be applied to CubeHash, independent of the actual T (as long as it is invertible). These attacks target the preimage resistance of CubeHash, and exploit the fact that as all components are invertible, and as the adversary can control b bytes of the internal state directly, it is possible to find a preimage in about b CubeHash computations. The second type of results, tried to analyze reduced-round variants of CubeHash for collisions. In [], a collision for CubeHash/0- is given. Collisions for Cube- Hash/ and / are given in [], and for CubeHash/ and CubeHash/ are produced by [, 0]. A more general methodology to obtain such collisions is described in [], where variants up to CubeHash/ are successfully analyzed. A third type of attacks/observations concerning CubeHash deal with the symmetric structure of T. For example, if at the input to T all x 0jklm words are equal, and all x jklm words are equal (not necessarily equal to the value of the x 0jklm ), then the same property holds in the output as well. The first analysis of this type of properties is given in the original submission document []. In [], several additional classes of symmetric states are observed, and their use is analyzed. Recently, these classes were expanded to include a larger number of states (and structures) in []. Despite all the above-mentioned work, CubeHash is still considered secure, as no attack comes close to offer complexity which is significantly better than generic attacks. To the best of our knowledge this work is the first one that succeeds to offer some non-trivial property of more than 0 rounds of T. Linear Approximation of CubeHash Linear cryptanalysis [] is a useful cryptanalytic tool in the world of block cipher cryptanalysis. When using linear cryptanalysis, the adversary tries to find a linear expression that approximates a non-linear function with probability different than. Once a good approximation is found for the relation between the plaintext, the ciphertext and the key (by an expression that holds with some bias) the adversary gains information concerning the key, by observing sufficient number of plaintext/ciphertext pairs until finding enough of them that satisfies the approximation. We note that while the preimage attacks of [, ] may offer a small speed-up with respect to generic attacks, their memoryless variants are not much faster than exhaustive search. Moreover, as the submission document lists this as a known issue, this flaw is not considered too harmful by many.

Since a good cryptosystem is expected to behave as a random function the linear approximation is satisfied with probability regardles of the approximation correctness. Therefore, the bias induced by the approximation is of the form + ɛ. As we expect two rounds of a good hash function to be independent of each other we can use the piling up lemma that states that the overall bias for two approximations with biases + ɛ and + ɛ is + ɛ ɛ making the total number of queries required to satisfy the approximation ɛɛ. In the context of hash functions, linear cryptanalysis has received very little attention, unlike differential cryptanalysis. The reason for that seems that while differential cryptanalysis can be directly used to offer collisions or preimages, linear cryptanalysis seems to be restricted to very rare cases (i.e., where the bias is extremely high). At the same time, the use of linear approximation to assess the security of a hash function can shed some light on whether the underlying components offer the required security. Even though hash functions are unkeyed cryptosystems, the use of linear cryptanalysis supplies some information about the the uniformity of the output distributions. Moreover, linear approximations of the compression function might be useful when discussing MACs built on top of the hash function (suggesting a detectable linear bias in the output).. Linear Approximation of Addition Modulo CubeHash uses a mixture of XORs, rotations, and additions. While the first two can be easily handled in the linear cryptanalysis framework, the approximation of the modular addition possess several problems, mostly due to the carry chains. One of the papers studying the cryptographic properties of modular addition is [] which studies the carry effects on linear approximations. In the paper, Cho and Pieperzyk show that approximating two consecutive bits can overcome some of the inherent problems of carry chains. Namely, if λ is a mask of two consecutive bits (in any position) then: λ (x + y) = λ(x y) with probability / (i.e., a bias of /). We analyzed several cases where λ contains pairs of consecutive bits, e.g., two pairs of consecutive pairs, and even when these pairs appear immediately after each other (i.e., λ is composed of four consecutive bits set to ). Our analysis shows that with respect to linear cryptanalysis, these pairs can be treated as two separate independent instances. For example, the probability that λ (x + y) = λ(x y) for λ whose four most significant bits are, while the rest are 0, is 0/ (suggesting the expected bias of (/) = /).. The Linear Approximation of the Round Function of CubeHash Our first attempt in understanding the security of CubeHash against linear cryptanalysis was a very simple experiment. We looked at all possible masks which had only one pair of two consecutive bits active, and tried to extend this mask as many rounds as possible in the forward direction. At some point, the resulting mask had a divided pair of bits, i.e., a pair of bits that due to the rotations used in CubeHash were sent one to the LSB of a word, and one to the MSB of the same word. Such a mask does no longer fall under the type of masks considered in [], and our experiments show that such a mask has a very low bias when considering addition. After performing the search in the forward direction, we repeated the experiment, this time running the light mask in the backward direction (i.e., through T )

as many rounds as possible. The results obtained in these experiments are shown in Tables and, which present the number of possible linear approximations of that form in the forward and the backward directions (along with the associated bias). The longest of which covers 0 rounds in any direction. Following the surprisingly long approximations, we decided to explore pairs of pairs (i.e., four active bits in the starting mask), repeating the process of analyzing the forward direction as well as the backward direction. These results are summarized in Tables and. We also combined the forward and the backward approximations to form a series of approximations for as many rounds as could, using the combination of this type of approximations. In Table we offer input/output masks of the best approximations we found. Following the fact that CubeHash aims to offer at most a security, we decided to concentrate at approximations of bias up to (as detecting smaller biases requires more than queries). The longest possible approximation which adheres to this restriction is of rounds and has a bias of which is fully described in Table. For those interested in assessing the full security that might be offered by the 0-bit transformation T, we note that there also exists a -round linear approximation with a bias of 0. We outline the full -round approximation in Tables and. Message Modification Techniques A Chosen-Plaintext Linear Approximations Linear cryptanalysis relies on collecting a large number of input/output pairs, and verifying whether they satisfy the approximation or not. In [] Knudsen and Mathiassen show that there are cases in which one can help the linear approximation to be satisfied by properly selecting the inputs. In the case of modular addition, the linear approximation which we use is satisfied whenever one of the LSBs of the approximated bits is 0. This allows preselecting inputs for which the approximation holds with probability. This technique can be used either to increase the bias of our -round approximation or to extend it to a -round approximation. In order to fix the bits entering the first layer of addition in CubeHash it is enough to fix the LSB of each pair of approximated bits. However, fixing the bits for the next layer is a bit more tricky, as it requires to fix some internal state bit (after an XOR or addition) to 0. This task is a bit harder due to carry issues. More precisely, to fix bit i of x jklm after the first five operations of T, it is required that bit i of x jklm is 0 after the first operation of T. This specific bit depends on the corresponding carry chain. A simple solution would be to fix one of the words x 0jklm or x jklm to zero, ensuring no carrys are produced during the addition x jklm x 0jklm + x jklm. By additionally fixing bit i of both x 0jklm and x jklm to zero, we can guarantee that the bit that enters the second layer of additions is indeed zero. As the above approach sets many bits to zero we offer a more efficient approach. One can fix only bits i, i in x 0jklm and i, i in x jklm to zero. Even if there is a carry entering bit i, it does not produce carry that affects the i th bit, and we are assured that bit i after the addition is indeed 0. Consider our -round approximation suggested in table. To increase its bias we can fix the bits masked by x 000 = 000 00 x, x 00 = 000 00 x, x 00 =

Table. Number of Linear Approximations Following the Consecutive Masks Approach (Starting from a Mask with One Consecutive Pair in the Forward Direction) Rounds Bias Number of Approximations 0 0 = 0 = = 0 = = = = = = 0 = = 0 = = = = = = = 0 = = = = 0 = = 0 = = = 0 = 0 0 = = 0 = = = = = = 0 = 0 = = = = 0 = = 0 = = = = = 0 = 00 00 x, x 0 = 00 00 x to 0 to ensure that our approximation holds for the first layer of addition with probability. To ensure the approximation holds for the second layer of the first round as well we fix the bits masked by

Table. Number of Linear Approximations Following the Consecutive Masks Approach (Starting from a Mask with One Consecutive Pair in the Backward Direction) Rounds Bias Number of Approximations 0 = = 0 = = = = = 0 = = 0 = = = = 0 = 0 = = = = 0 = 00 0 = 0 0 = 0 = = = 0 = = = = 00 = = = = 0 = 0 0 = 0 0 = 0 = 0 = 0 0 = = 0 = 000c 0ccc x in x 000, x 00, x 00 and x 0, the bits masked by 000 00 x in x 00000, x 0000, x 0000 and x 000 and the bits masked by 0 000 x in x 000, x 000, x 000 and x 00 to 0. Fixing these bits ensures that the first round of the approximation holds with probability hence increasing the bias by a factor of making the total bias 0. When considering an extension of the linear approximation shown in Table by calculating it one round backward as described in Table, we can fix 0 input bits to zero, thus ensuring that the approximation holds for the first layer of additions with probability. These 0 bits are the ones masked by x 000 = 000 0 x, x 00 = 000 0 x, x 00 = 00 00 x, x 0 = 00 00 x and the whole words x 0

Table. Number of Approximations with a Given Bias Starting from a Pair of Pair of Active Bits (Forward Direction) Rounds Bias Number of Approximations 0 0 0 0 = to = to = to = to = to = to = to = to = to = = = = = 0 = = 00 = 0 = = = = = 0 = 0 = = 0 = = = 0 = = = = = 0 = 0 = = = = 0 = 0 = 0 = = = = = = = = 0 = = = = = = = and x. We note that one can pick other sets of bits (where any fixed bit from x 0jklm can be exchanged for a bit in x jklm ). To ensure that all the appropriate bits in x jklm are zero one needs to set the mask bits masked by 000c 0ccc x of x 0000, x 000, x 000, and x 00, the bits masked

Table. Number of Approximations with a Given Bias Starting from a Pair of Pair of Active Bits (Backward Direction) Rounds Bias Number of Approximations 0 0 = to = to = to 0 = to = to = to = 0 to = to 0 = = 0 = = 00 = = 00 = = 0 = = = 0 = = = = = 0 = = = 0 0 = = = 0 = = = = = = = = = 0 = 0 = 0 = = = = = = = 0 = = = 0 = = by c00c 000 x of x 000, x 00, x 00, and x 0, and those masked by 0c0c cc00 in x 0000, x 000, x 000, x 00, x 000, x 00, x 00, and x 0 to zero. Fixing these bits (0 of which are shared with the previous 0), assures that all the additions in the first round of the -round approximation follow the approximation, i.e., saving their contribution to the bias, and resulting in a bias of =. We note that the number of bits set to 0 is, leaving bits to be randomly selected. This is sufficient to generate the 0 possible inputs to T, needed for

Table. A trade-off of biases and rounds. Each line shows the best bias in this setting Rounds Input mask Output mask Bias x 0000 = 000 0,x 000 = 000 0, x 00000 = 00 00,x 0000 = 00 00, x 000 = 00c0 00, x 00 = 00c0 00, x 00 = 0000 000,x 0 = 0000 000, x 000 = 000c 00,x 00 = 000c 00, x 000 = 00 00,x 00 = 00 00, x 000 = 0000 000,x 00 = 0000 000, x 00 = c0c0 000,x 0 = c0c0 000, x 00 = 000c 00,x 0 = 000c 00 x 0 = 00 00,x = 00 00 = x 00000 = 000 0,x 0000 = 000 0, x 00000 = 00 00,x 0000 = 00 00, = x 00 = 0 000,x 0 = 0 000, x 00 = 0000 000,x 0 = 0000 000, x 000 = 000 0,x 00 = 000 0, x 000 = 00 00,x 00 = 00 00, x 00 = 00c0 c00,x 0 = 00c0 c00, x 00 = c0c0 000,x 0 = c0c0 000, x 0 = 00 00,x = 00 00 x 0 = 00 00,x = 00 00 x 0000 = 00,x 000 = 00, x 00000 = 00 00,x 0000 = 00 00, = x 000 = c0cc c000,x 00 = c0cc c000, x 00 = 0000 000,x 0 = 0000 000, x 000 = 0c0c cc00,x 00 = 0c0c cc00, x 000 = 00 00,x 00 = 00 00, x 000 = 00c0 c00,x 00 = 00c0 c00, x 00 = c0c0 000,x 0 = c0c0 000, x 00 = 0c0c cc00,x 0 = 0c0c cc00 x 0 = 00 00,x = 00 00 0 x 0000 = 00,x 000 = 00, x 0000 = 00 00,x 000 = 00 00, = x 000 = c0cc c000,x 00 = c0cc c000, x 000 = c00 000,x 00 = c00 000, x 000 = 0c0c cc00,x 00 = 0c0c cc00, x 000 = 0c0 000,x 00 = 0c0 000, x 000 = 00c0 c00,x 00 = 00c0 c00 x 000 = 000 0,x 00 = 000 0, x 00 = 0c0c cc00,x 0 = 0c0c cc00 x 00 = 0c0 000,x 0 = 0c0 000 x 0000 = 00,x 000 = 00, x 00000 = 00,x 0000 = 00, = x 000 = c0cc c000,x 00 = c0cc c000, x 00 = 000,x 0 = 000, x 000 = 0c0c cc00,x 00 = 0c0c cc00, x 000 = 00,x 00 = 00, x 000 = 00c0 c00,x 00 = 00c0 c00, x 00 = 000 0,x 0 = 000 0, x 00 = 0c0c cc00,x 0 = 0c0c cc00 x 0 = 00,x = 00 x 00000 = 00,x 0000 = 00, x 00000 = 0 0,x 0000 = 0 0, = x 00 = e f,x 0 = e f, x 00 = 00 0,x 0 = 00 0, x 000 = 00,x 00 = 00, x 000 = 0 0,x 00 = 0 0, x 00 = 000 0,x 0 = 000 0, x 00 = 0 000,x 0 = 0 000, x 0 = 0 0,x = 0 0 x 0 = 00,x = 00 x 00000 = 0 000,x 0000 = 0 000, x 0000 = 000 0,x 000 = 000 0, = x 00 = e e0,x 0 = e e0, x 000 = 00 00,x 00 = 00 00, x 000 = 0 000,x 00 = 0 000, x 000 = 000 0,x 00 = 000 0, x 00 = 00c0 ccc0,x 0 = 00c0 ccc0, x 000 = 0cf f,x 00 = 0cf f, x 0 = 0 000,x = 0 000 x 00 = 000 0,x 0 = 000 0 x 0000 = ccc fc0f,x 000 = ccc fc0f, x 0000 = 0 000,x 000 = 0 000, = 0 x 000 = e0 e,x 00 = e0 e, x 000 = 0 0,x 00 = 0 0, x 000 = e 0e,x 00 = e 0e, x 000 = 00,x 00 = 00, x 000 = 0 000,x 00 = 0 000, x 000 = f e,x 00 = f e, x 00 = e 0e,x 0 = e 0e x 00 = 00,x 0 = 00 using this chosen-plaintext linear approximation successfully, in a distinguishing attack on -round CubeHash. Distinguishing Reduced-Round Variants of the Compression Function of CubeHash Given the linear approximations presented in the previous sections, it is possible to distinguish a black box which contains up to -round CubeHash from a random permutation. Of course, for any unkeyed primitive this distinguishing can be done by just comparing the input/output of a few queries to the black box with the input/output produced by the publicly available algorithm. If we want to offer some cryptographic settings in which distinguishing attacks make sense, we either need

Table. The -round linear approximation with bias = Round Mask Bias Hamming (before the round) Weight Input x 0000 = 00, x 000 = 00 = x 000 = c0cc c000, x 00 = c0cc c000, x 000 = 0c0c cc00, x 00 = 0c0c cc00, x 000 = 00c0 c00, x 00 = 00c0 c00, x 00 = 0c0c cc00, x 0 = 0c0c cc00 x 00000 = 000 0, x 0000 = 000 0, = x 00 = 0 000, x 0 = 0 000, x 000 = 000 0, x 00 = 000 0, x 00 = 00c0 c00, x 0 = 00c0 c00, x 0 = 00 00, x = 00 00 x 0000 = 000 0, x 000 = 000 0, = x 000 = 00c0 00, x 00 = 00c0 00, x 000 = 000c 00, x 00 = 000c 00, x 000 = 0000 000, x 00 = 0000 000, x 00 = 000c 00, x 0 = 000c 00 x 00000 = 000 000, x 0000 = 000 000, = x 00 = 0 00, x 0 = 0 00, x 000 = 000 000, x 00 = 000 000, x 00 = 0000 000, x 0 = 0000 000, x 0 = 0000 00, x = 0000 00 x 0000 = 000 000, x 000 = 000 000, x 000 = 0c00 0000, x 00 = 0c00 0000, x 000 = 00c0 0000, x 00 = 00c0 0000, x 00 = 00c0 0000, x 0 = 00c0 0000 x 00 = 0000 000, x 0 = 0000 000 x 000 = 0000 000, x 00 = 0000 000 = = = x 00000 = 00 0000, x 0000 = 00 0000, = x 000 = 00 0000, x 00 = 00 0000, x 00 = 0000 000, x 0 = 0000 000, x 0 = 000 000, x = 000 000 x 0000 = 00 0000, x 000 = 00 0000, x 000 = c000 0000, x 00 = c000 0000, x 000 = 0c00 0000, x 00 = 0c00 0000, x 000 = c0c0 000, x 00 = c0c0 000, x 00 = 0c00 0000, x 0 = 0c00 0000 = x 00000 = 00 00, x 0000 = 00 00, = x 00 = 0000 000, x 0 = 0000 000, x 000 = 00 00, x 00 = 00 00, x 00 = c0c0 000, x 0 = c0c0 000, x 0 = 00 00, x = 00 00 0 x 0000 = 00 00, x 000 = 00 00, = x 000 = c00 000, x 00 = c00 000, x 000 = 0c0 000, x 00 = 0c0 000, x 000 = 000 0, x 00 = 000 0, x 00 = 0c0 000, x 0 = 0c0 000 x 00000 = 00, x 0000 = 00, x 00 = 000, x 0 = 000, x 000 = 00, x 00 = 00, x 00 = 000 0, x 0 = 000 0, x 0 = 00, x = 00 to consider keyed variants (either of the round function T or of the hash function, e.g., in MACs) or to discuss known-key distinguishers []. Such possible application is an a Even-Mansour [] variant of -round T (or any other number of rounds), i.e., EM-Tk,k (P ) = T (P k ) k. If -round T is indeed good as a source of nonlinearity (for a linear T, the entire security

Table. The -round linear approximation with bias 0 = 0 rounds - Round Mask Bias Hamming (before the round) Weight input x 0000 = ccc fc0f, x 000 = ccc fc0f, x 000 = e0 e, x 00 = e0 e, x 000 = e 0e, x 00 = e 0e, x 000 = 0 000, x 00 = 0 000, x 00 = e 0e, x 0 = e 0e x 00000 = 000 0, x 0000 = 000 0, x 00 = f0c f, x 0 = f0c f, x 000 = 000 0, x 00 = 000 0, x 00 = 0 000, x 0 = 0 000, x 0 = 000 0, x = 000 0 x 0000 = 000 0, x 000 = 000 0, x 000 = 00, x 00 = 00, x 000 = 0 0, x 00 = 0 0, x 000 = 0 00, x 00 = 0 00, x 00 = 0 0, x 0 = 0 0 x 00000 = c0c0 000, x 0000 = c0c0 000, x 00 = 0ccc 000c, x 0 = 0ccc 000c, x 000 = c0c0 000, x 00 = c0c0 000, x 00 = 0 00, x 0 = 0 00, x 0 = 0c0c 000, x = 0c0c 000 x 0000 = c0c0 000, x 000 = c0c0 000, x 000 = 00 00, x 00 = 00 00, x 000 = 00 00, x 00 = 00 00, x 000 = 0000 000, x 00 = 0000 000, x 00 = 00 00, x 0 = 00 00 0 = 0 = 00 = 0 = = 0 x 00000 = 0000 000, x 0000 = 0000 000, = x 00 = 0c0 000, x 0 = 0c0 000, x 000 = 0000 000, x 00 = 0000 000, x 00 = 0000 000, x 0 = 0000 000, x 0 = 0000 000, x = 0000 000 x 0000 = 0000 000, x 000 = 0000 000, x 000 = 00 0000, x 00 = 00 0000, x 000 = 00 0000, x 00 = 00 0000, x 00 = 00 0000, x 0 = 00 0000 x 00 = c000 0000, x 0 = c000 0000 x 000 = 0000 000, x 00 = 0000 000 x 00000 = 000 0000, x 0000 = 000 0000, x 000 = 000 0000, x 00 = 000 0000, x 00 = 0000 000, x 0 = 0000 000, x 0 = 0000 000, x = 0000 000 = = = = of CubeHash collapses), then XORing an unknown key before and after these rounds, should result in a good pseudo-random permutation. Using our linear approximations, one can distinguish this construction from a random permutation. We emphasize that as our results are linear in nature, they require that the adversary has access both to the input to the nonlinear function as well as its output. To the best of our knowledge, there is no way to use this directly in a hash function setting. Conclusions In this paper we presented a series of approximations for the SHA- former candidate CubeHash. The analysis challenges the strength of CubeHash s round function, T, and shows that (from linear cryptanalysis point of view), offers adequate security. At

Table. The -round linear approximation with bias 0 = 0 rounds 0- Round Mask Bias Hamming (before the round) Weight 0 x 0000 = 000 0000, x 000 = 000 0000, = x 000 = 00 0000, x 00 = 00 0000, x 000 = 00 0000, x 00 = 00 0000, x 000 = 000, x 00 = 000, x 00 = 00 0000, x 0 = 00 0000 x 00000 = c00 00c0, x 0000 = c00 00c0, = x 00 = 0000 000c, x 0 = 0000 000c, x 000 = c00 00c0, x 00 = c00 00c0, x 00 = 000, x 0 = 000, x 0 = 0c00 00c, x = 0c00 00c x 0000 = c00 00c0, x 000 = c00 00c0, = x 000 = 0 000, x 00 = 0 000, x 000 = 00 00, x 00 = 00 00, x 000 = 000 0, x 00 = 000 0, x 00 = 00 00, x 0 = 00 00 x 00000 = 0 000, x 0000 = 0 000, = 0 x 00 = 00 000c, x 0 = 00 000c, x 000 = 0 000, x 00 = 0 000, x 00 = 000 0, x 0 = 000 0, x 0 = 00 00, x = 00 00 x 0000 = 0 000, x 000 = 0 000, 00 x 000 = 0 0, x 00 = 0 0, x 000 = 00, x 00 = 00, x 000 = f e, x 00 = f e, x 00 = 00, x 0 = 00 Table. The round that extends the -round approximation to rounds (and the bits to fix Round Input mask Input bits fixed to 0 - x 00000 = 00, x 0000 = 00 x 000 = 000 0 x, x 00 = 000 0 x x 00 = e f, x 0 = e f x 00 = 00 00 x, x 0 = 00 00 x x 000 = 00, x 00 = 00 x 0 = ffff ffff x, x = ffff ffff x x 00 = 00 00, x 0 = 00 00 x 0 = 00, x = 00-0. x 000 = f0c 000 x, x 00 = f0c 000 x x 0000 = 000c 0ccc x, x 000 = 000c 0ccc x x 0000 = 0c0c cc00 x, x 000 = 0c0c cc00 x x 000 = 00 000 x, x 00 = 00 000 x x 000 = 0c0c cc00 x, x 00 = 0c0c cc00 x x 0000 = 00 00 x, x 000 = 00 00 x x 00 = 00 x, x 0 = 00 x x 000 = 00 00 x, x 00 = 00 00 x x 000 = 00 x, x 00 = 00 x x 000 = 000c 0ccc x, x 00 = 000c 0ccc x x 00 = c00c 000 x, x 0 = c00c 000 x x 00 = 00 000 x, x 0 = 00 000 x x 000 = 0c0c cc00 x, x 00 = 0c0c cc00 x x 00 = 00 00 x, x 0 = 00 00 x x 00 = 0c0c cc00 x, x 0 = 0c0c cc00 x x 000 = 000 0 x, x 00 = 000 0 x 0 x 0000 = 00, x 000 = 00 x 000 = c0cc c000, x 00 = c0cc c000 x 000 = 0c0c cc00, x 00 = 0c0c cc00 x 000 = 00c0 c00, x 00 = 00c0 c00 x 00 = 0c0c cc00, x 0 = 0c0c cc00 0. stands for the mask that enters the second addition of the additional round. the same time, the security margins offered by iterations of T seems to be on the smaller side, as future works on CubeHash may find better linear approximations.

Acknowledgement The authors wish to thank Prof. Adi Shamir for his guidance and assistance analyzing CubeHash, Nathan Keller for providing core ideas in this paper, Daniel J. Bernstein for his insightful and mind-provoking comments on previous versions of this article. Finally, we wish to thank Michael Klots for his technical assistance, which was crucial for finding our results. References. Andreeva, E., Bouillaguet, C., Fouque, P.A., Hoch, J.J., Kelsey, J., Shamir, A., Zimmer, S.: Second Preimage Attacks on Dithered Hash Functions. In Smart, N.P., ed.: EUROCRYPT. Volume of Lecture Notes in Computer Science., Springer (00) 0. Aumasson, J.P.: Collision for CubeHash/0-. NIST mailing list (00) Available online at http://ehash.iaik.tugraz.at/uploads/a/a/cubehash.txt.. Aumasson, J.P., Brier, E., Meier, W., Naya-Plasencia, M., Peyrin, T.: Inside the Hypercube. In Boyd, C., Nieto, J.M.G., eds.: ACISP. Volume of Lecture Notes in Computer Science., Springer (00) 0. Bernstein, D.J.: CubeHash specification (.B.). Submission to NIST (00). Bernstein, D.J.: CubeHash specification (.B.). Submission to NIST (00). Biham, E., Chen, R.: Near-Collisions of SHA-0. [] 0 0. Bloom, B., Kaminsky, A.: Single Block Attacks and Statistical Tests on CubeHash. IACR eprint Archive, Report 00/0 (00). Brier, E., Khazaei, S., Meier, W., Peyrin, T.: Linearization framework for collision attacks: Application to cubehash and md. In Matsui, M., ed.: ASIACRYPT. Volume of Lecture Notes in Computer Science., Springer (00) 0. Brier, E., Khazaei, S., Meier, W., Peyrin, T.: Real Collisions for CubeHash-/. NIST mailing list (00) Available online at http://ehash.iaik.tugraz.at/uploads///bkmp ch.txt. 0. Brier, E., Khazaei, S., Meier, W., Peyrin, T.: Real Collisions for CubeHash-/. NIST mailing list (00) Available online at http://ehash.iaik.tugraz.at/uploads//0/bkmp ch.txt.. Cannière, C.D., Rechberger, C.: Finding SHA- Characteristics: General Results and Applications. In Lai, X., Chen, K., eds.: ASIACRYPT. Volume of Lecture Notes in Computer Science., Springer (00) 0. Cho, J.Y., Pieprzyk, J.: Multiple Modular Additions and Crossword Puzzle Attack on NLSv. In Garay, J.A., Lenstra, A.K., Mambo, M., Peralta, R., eds.: ISC. Volume of Lecture Notes in Computer Science., Springer (00) 0. Cramer, R., ed.: Advances in Cryptology - EUROCRYPT 00, th Annual International Conference on the Theory and Applications of Cryptographic Techniques, Aarhus, Denmark, May -, 00, Proceedings. In Cramer, R., ed.: EUROCRYPT. Volume of Lecture Notes in Computer Science., Springer (00). Dai, W.: Collisions for CubeHash/ and CubeHash/ (00) Available online at http://www.cryptopp.com/sha/cubehash.pdf.. Even, S., Mansour, Y.: A Construction of a Cipher from a Single Pseudorandom Permutation. J. Cryptology 0() (). Ferguson, N., Lucks, S., McKay, K.A.: Symmetric States and their Structure: Improved Analysis of CubeHash. IACR eprint Archive, Report 00/ (00) Presented at the SHA- second workshop, Santa Barbara, USA, August -, 00.. Franklin, M.K., ed.: Advances in Cryptology - CRYPTO 00, th Annual International CryptologyConference, Santa Barbara, California, USA, August -, 00, Proceedings. In Franklin, M.K., ed.: CRYPTO. Volume of Lecture Notes in Computer Science., Springer (00)

. Joux, A.: Multicollisions in Iterated Hash Functions. Application to Cascaded Constructions. [] 0. Kelsey, J., Kohno, T.: Herding Hash Functions and the Nostradamus Attack. In Vaudenay, S., ed.: EUROCRYPT. Volume 00 of Lecture Notes in Computer Science., Springer (00) 00 0. Kelsey, J., Schneier, B.: Second Preimages on n-bit Hash Functions for Much Less than n Work. [] 0. Khovratovich, D., Nikolic, I., Weinmann, R.P.: Preimage attack on CubeHash-r/ and CubeHash-r/ (00) Available online at http://ehash.iaik.tugraz.at/uploads//c/cubehash.pdf.. Knudsen, L.R., Mathiassen, J.E.: A Chosen-Plaintext Linear Attack on DES. In Schneier, B., ed.: FSE. Volume of Lecture Notes in Computer Science., Springer (000). Knudsen, L.R., Rijmen, V.: Known-Key Distinguishers for Some Block Ciphers. In Kurosawa, K., ed.: ASIACRYPT. Volume of Lecture Notes in Computer Science., Springer (00). Matsui, M.: Linear Cryptoanalysis Method for DES Cipher. In: EUROCRYPT. (). National Institute of Standards and Technology: Cryptographic Hash Algorithm Competition. http://www.nist.gov/hash-competition (00). Stevens, M., Lenstra, A.K., de Weger, B.: Chosen-Prefix Collisions for MD and Colliding X.0 Certificates for Different Identities. In Naor, M., ed.: EUROCRYPT. Volume of Lecture Notes in Computer Science., Springer (00). Wang, X., Yu, H.: How to Break MD and Other Hash Functions. []