Threefish
This article relies too much on references to primary sources. (November 2008) (Learn how and when to remove this template message)

General  

Designers  Bruce Schneier, Niels Ferguson, Stefan Lucks, Doug Whiting, Mihir Bellare, Tadayoshi Kohno, Jon Callas, Jesse Walker 
First published  2008 
Related to  Blowfish, Twofish 
Cipher detail  
Key sizes 
256, 512 or 1024 bits (key size is equal to block size) 
Block sizes  256, 512 or 1024 bits 
Rounds  72 (80 for 1024bit block size) 
Speed  6.1 cpb on Core 2.^{[1]} 
Threefish is a symmetrickey tweakable block cipher designed as part of the Skein hash function, an entry in the NIST hash function competition. Threefish uses no Sboxes 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 SHA3 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.
Contents
Description of the cipher^{[1]}
Threefish works on words of 64 bits (unsigned Little endian integers). is the number of plaintext words and also of key words. The tweak consists of two words. All additions and subtractions are defined modulo .
Key schedule
Threefish uses different round keys (: Number of rounds). To calculate these keys an additional key word is appended to the original key words . An additional tweak word is also appended to the tweak words .
The purpose of the seemingly arbitrary constant is to frustrate some attacks that take advantage of the relationship between and the other keywords.
The round key words are now defined like this:
Here , and is the number of the round in which the round key is used.
Mix function
The mix function takes a tuple of words and returns another tuple of words . The function is defined like this:
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. Bitlevel permutation is not achieved in this step, but this is not necessary since the MIX functions provides bitlevel permutations in the form of bitwise rotations.^{[citation needed]} The Permute step and rotation constants in the MIX functions are chosen in such a way that the overall effect is complete diffusion of all the bits in a data block.^{[citation needed]}
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 required for encryption. The permutation is therefore deliberately designed to ensure that it should execute in the same fashion independent of the key being used or the data encrypted.^{[citation needed]}
A full Threefish round
 if the round key is added to word
 the mix function is applied to consecutive words, the rotation widths depend on and the word number
 the words are permutated using a permutation independent from the round number
Threefish256 and Threefish512 apply this round 72 times (). Threefish1024 applies it 80 times ().
Final operations
After all rounds are applied, the last round key is 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 knownkey distinguisher against 53 of 72 rounds in Threefish256, and 57 of 72 rounds in Threefish512. It also affects the Skein hash function.^{[2]} This is a followup 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.^{[1]}
In 2009, a related key boomerang attack against a reduced round Threefish version was published. For the 32round version, the time complexity is and the memory complexity is ; for the 33round version, the time complexity is with a negligible memory usage. The attacks also work against the tweaked version of Threefish: for the 32round version, the time complexity is and the memory complexity is ; for the 33round version, the time complexity is with a negligible memory usage.^{[4]}
See also
References
 ^ ^{a} ^{b} ^{c} ^{d} Ferguson; et al. (20101001). "The Skein Hash Function Family" (PDF). The paper in which Threefish was introduced.
 ^ Dmitry Khovratovich; Ivica Nikolic; Christian Rechberger (20101020). "Rotational Rebound Attacks on Reduced Skein".
 ^ Dmitry Khovratovich & Ivica Nikolić (2010). "Rotational Cryptanalysis of ARX" (PDF). University of Luxembourg.
 ^ Jiazhe Chen; Keting Jia (20091101). "Improved Relatedkey Boomerang Attacks on RoundReduced Threefish512".
External links
 "The Skein Hash Function Family" Homepage of the Skein Hash Function Family.