ArticleslgStudy

science

Threefish

Threefish is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Threefish rather than just read about it. In short: 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; its nonlinearity comes from alternating additions with exclusive ORs.

Threefish — main illustration
Threefish — illustration

Key takeaways

  • Threefish belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Threefish to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Threefish from memory before moving on to harder problems.

Reference excerpt

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; 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. "Threefish is unpatented, and the source code is uncopyrighted and license-free; it is free for all uses."

Description of the cipher Threefish works on words of 64 bits (unsigned Little endian integers). w∈{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 r4+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−1. Also, an additional tweak word t2 is appended to the tweak words t0,t1.

kw=C⊕k0⊕k1⊕⋯⊕kw−1;C=0x1BD11BDAA9FC1A22 t2=t0⊕t1 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,i are now defined like this: ks,i={k(s+i)mod(w+1)i=0,…,w−4k(s+i)mod(w+1)+tsmod3i=w−3k(s+i)mod(w+1)+t(s+1)mod3i=w−2k(s+i)mod(w+1)+si=w−1 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)mod264 y1=(x1⋘R(dmod8),j)⊕y0 Rd,j 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 functions provides bit-level permutations in the form of bitwise rotations. 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. 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.

A full Threefish round if dmod4=0 the round key kd/4,i is added to word i the mix function is applied to pairs of words, the rotation widths Rdmod8,j depend on round number d and word pair j∈{0,⋯,w/2−1} the words are permutated using a permutation independent from the round number 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. This is a follow-up to the earlier attack published in February, which breaks 39 and 42 rounds respectively. 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.

See also Twofish Blowfish (cipher)

References

Illustrations

Threefish illustration
Threefish: Threefish Mix Function
Threefish Mix Function

Worked examples

Example 1 — a first encounter with Threefish

Start with the simplest possible case. Write down what Threefish claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Threefish before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Threefish ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Threefish

In research
Threefish appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Threefish in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Threefish is common in secondary-school and first-year university syllabi. It links to neighbouring topics Block ciphers, Free ciphers, so understanding it makes those chapters shorter.
In everyday life
Look for Threefish outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Threefish” →

How to study Threefish in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Threefish means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Threefish out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Threefish in simple terms?

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; its nonlinearity comes from alternating additions with exclusive…

Why does Threefish matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Threefish?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Threefish.

Tags

  • Block ciphers
  • Free ciphers

Keep exploring