Threefish Explained

Threefish
Designers:Bruce Schneier, Niels Ferguson, Stefan Lucks, Doug Whiting, Mihir Bellare, Tadayoshi Kohno, Jon Callas, Jesse Walker
Publish Date:2008
Related To:Blowfish, Twofish
Key Size:256, 512 or 1024 bits
(key size is equal to block size)
Block Size:256, 512 or 1024 bits
Rounds:72 (80 for 1024-bit block size)
Speed:6.1 cpb on Core 2.
Cryptanalysis:In October 2010, an attack that combines rotational cryptanalysis with the rebound attack was published. The attack mounts a known-key distinguisher against 53 of 72 rounds in Threefish-256, and 57 of 72 rounds in Threefish-512. It also affects the Skein hash function.

Threefish is a symmetric-key tweakable block cipher designed as part of the Skein hash function, an entry in the NIST hash function competition. Threefish uses no S-boxes or other table lookups in order to avoid cache timing attacks;[1] its nonlinearity comes from alternating additions with exclusive ORs. In that respect, it is similar to Salsa20, TEA, and the SHA-3 candidates CubeHash and BLAKE.

Threefish and the Skein hash function were designed by Bruce Schneier, Niels Ferguson, Stefan Lucks, Doug Whiting, Mihir Bellare, Tadayoshi Kohno, Jon Callas, and Jesse Walker.

Description of the cipher

Threefish works on words of 64 bits (unsigned Little endian integers).

w\in\{4,8,16\}

is the number of plaintext words and also of key words. The tweak consists of two words. All additions and subtractions are defined modulo

264

.

Key schedule

Threefish encrypts in

r

rounds and uses
r
4

+1

different round keys. After every four rounds, and before the first,

w

round key words are added to the

w

data words. To calculate the round keys an additional key word

kw

is appended to the original key words

k0,k1,...,kw

. Also, an additional tweak word

t2

is appended to the tweak words

t0,t1

.

kw=Ck0k1...kw;C=0x1BD11BDAA9FC1A22

t2=t0t1

The purpose of the seemingly arbitrary constant

C

is to frustrate some attacks that take advantage of the relationship between

kw

and the other keywords.

The round key words

ks,

are now defined like this:

ks,= \begin{cases} k(s+i)&i=0,...,w-4\\ k(s+i)+ts&i=w-3\\ k(s+i)+t(s&i=w-2\\ k(s+i)+s&i=w-1 \end{cases}

Here

s=0,1,...,r/4

, where

4s

is the number of the round in which the round key word

ks,i

is used.

Mix function

The mix function takes a tuple of words

(x0,x1)

and returns another tuple of words

(y0,y1)

. The function is defined like this:

y0=(x0+x1)\bmod264

y1=(x1\lllR(d)y0

Rd,

is a fixed set of rotation constants chosen to achieve quick diffusion.

Permute

The permutation step swaps the positions of the words according to a constant pattern.Bit-level permutation is not achieved in this step, but this is not necessary since the MIX functionsprovides bit-level permutations in the form of bitwise rotations. The Permute step and rotation constantsin the MIX functions are chosen in such a way that the overall effect is complete diffusion of all the bitsin a data block.

Because this permutation is fixed and independent of the key, the time needed to compute it does not provide information about the key or plaintext. This is important because on most modern microprocessors performance optimisations can make the time taken to compute an array operation dependent on where the data is stored in memory.In ciphers where array lookup depends on either the key or plaintext (as is the case for the substitution step in AES),it can make the cipher vulnerable to timing attacks by examining the time requiredfor encryption. The permutation is therefore deliberately designed to ensure that it should execute in the same fashionindependent of the key being used or the data encrypted.

A full Threefish round

d\bmod 4=0

the round key

kd/4,i

is added to word

i

Rd

depend on round number

d

and word pair

j\in\{0,,w/2-1\}

Threefish256 and Threefish512 apply this round

r=72

times (

d=0,1,...,71

). Threefish1024 applies it 80 times (

d=0,1,...,79

).

Final operations

After all rounds are applied, the last round key words

kr/4,i

are added to the words and the words are converted back to a string of bytes.

Security

In October 2010, an attack that combines rotational cryptanalysis with the rebound attack was published. The attack mounts a known-key distinguisher against 53 of 72 rounds in Threefish-256, and 57 of 72 rounds in Threefish-512. It also affects the Skein hash function.[2] This is a follow-up to the earlier attack published in February, which breaks 39 and 42 rounds respectively.[3] In response to this attack, the Skein team tweaked the rotation constants used in Threefish and thereby the key schedule constants for round 3 of the NIST hash function competition.

In 2009, a related key boomerang attack against a reduced round Threefish version was published. For the 32-round version, the time complexity is

2226

and the memory complexity is

212

; for the 33-round version, the time complexity is

2352.17

with a negligible memory usage. The attacks also work against the tweaked version of Threefish: for the 32-round version, the time complexity is

2222

and the memory complexity is

212

; for the 33-round version, the time complexity is

2355.5

with a negligible memory usage.[4]

See also

Notes and References

  1. The paper in which Threefish was introduced.
  2. Khovratovich . Dmitry . Nikolic . Ivica . Rechberger . Christian . 10.1007/S00145-013-9150-0 . 3 . Journal of Cryptology . 452–479 . Rotational Rebound Attacks on Reduced Skein . 27 . 2014.
  3. Khovratovich . Dmitry . Nikolic . Ivica . Hong . Seokhie . Iwata . Tetsu . Rotational Cryptanalysis of ARX . https://scholar.archive.org/work/mq7kxdfdmvh53numspafm2of6a . 10.1007/978-3-642-13858-4_19 . 333–346 . Springer . Lecture Notes in Computer Science . Fast Software Encryption, 17th International Workshop, FSE 2010, Seoul, Korea, February 7–10, 2010, Revised Selected Papers . 6147 . 2010.
  4. Chen . Jiazhe . Jia . Keting . Kwak . Jin . Deng . Robert H. . Won . Yoojae . Wang . Guilin . Improved Related-Key Boomerang Attacks on Round-Reduced Threefish-512 . https://eprint.iacr.org/2009/526 . 10.1007/978-3-642-12827-1_1 . 1–18 . Springer . Lecture Notes in Computer Science . Information Security, Practice and Experience, 6th International Conference, ISPEC 2010, Seoul, Korea, May 12–13, 2010. Proceedings . 6047 . 2010.