Skip to content
— CH. 1 · INTRODUCTION —

SHARK

~3 min read · Ch. 1 of 4
4 sections
  • SHARK is a block cipher that sits quietly in the family tree of the most widely used encryption standard in the world. Before Rijndael became the Advanced Encryption Standard, its designers drew on earlier work, and SHARK is named as one of those direct predecessors. Most people who use encrypted software today have never heard of it. Yet the choices baked into SHARK, its mathematical structure, its approach to scrambling data, shaped the cipher that now secures internet traffic, financial systems, and government communications across the planet. What makes SHARK worth examining is not its fame but its architecture: a tightly constructed machine that combines ideas from error-correcting codes with deep algebraic operations. How did those ideas fit together, and where did SHARK fall short?

  • SHARK operates on data in 64-bit blocks, processing each block with a 128-bit key. Six rounds stand between plaintext and ciphertext. Each round follows the same pattern, alternating a key mixing stage with two distinct transformation layers, one linear and one nonlinear. That alternating rhythm is the defining feature of what cryptographers call an SP-network, where SP stands for substitution and permutation. The linear layer in SHARK draws on a mathematical object called an MDS matrix, which represents a Reed-Solomon error correcting code. Error-correcting codes were originally designed to protect data transmitted over noisy channels, ensuring that even garbled signals could be reconstructed. SHARK's designers repurposed that property to guarantee diffusion, meaning that a change in a single input bit ripples reliably across the entire output block.

  • Eight S-boxes handle the nonlinear transformation in each round of SHARK. Each S-box maps an 8-bit input to an 8-bit output, making them 8x8-bit components. The function underlying them is F(x) = x to the power of negative one, computed over the finite field GF(2 to the 8th power). A finite field is a number system with a fixed, finite count of elements where addition and multiplication follow specific rules. Taking the multiplicative inverse, the negative-one exponent, within that field is a powerful nonlinear operation because it creates a highly irregular, unpredictable mapping. That irregularity is the goal: a linear function is much easier for an attacker to analyze and reverse. The use of this algebraic structure in the S-boxes would later appear in Rijndael, carrying the design philosophy of SHARK forward into the encryption standard that followed.

  • Jakobsen and Knudsen demonstrated in 1997 that five rounds of a modified version of SHARK could be broken using an interpolation attack. An interpolation attack exploits the algebraic structure of a cipher, essentially treating the encryption function as a polynomial and solving for it with enough input-output pairs. The fact that SHARK's nonlinear layer relies on a clean algebraic function, precisely the inversion over a finite field, made it a natural target for this approach. The full six-round cipher was not broken by that result, but the attack on the modified five-round variant exposed a tension at the heart of the design: the same mathematical elegance that gave SHARK its provable diffusion properties also gave attackers a handle on its structure. That vulnerability in the modified version stood as a caution for the designers who would refine these ideas in the cipher that came next.

Common questions

What is SHARK cipher and what is it used for?

SHARK is a block cipher in cryptography, identified as one of the direct predecessors of Rijndael, which became the Advanced Encryption Standard. It uses a 64-bit block size and a 128-bit key, and its design influenced the construction of the cipher that now secures much of the world's encrypted communications.

What block size and key size does SHARK use?

SHARK uses a 64-bit block size and a 128-bit key size. It processes data through six rounds in a structure known as an SP-network.

How is SHARK cipher related to Rijndael and the AES?

SHARK is named as one of the predecessors of Rijndael, the algorithm selected as the Advanced Encryption Standard. Structural elements of SHARK, including its use of algebraic S-boxes based on finite field inversion, carried forward into Rijndael's design.

What is the interpolation attack on SHARK cipher?

Jakobsen and Knudsen showed in 1997 that five rounds of a modified version of SHARK could be broken using an interpolation attack. This attack exploits the algebraic structure of the cipher by treating the encryption function as a polynomial solvable with enough input-output pairs.

What S-boxes does SHARK cipher use?

SHARK uses eight 8x8-bit S-boxes in its nonlinear transformation layer. Each is based on the function F(x) = x to the negative one, computed over the finite field GF(2 to the 8th power).

What is the role of the MDS matrix in SHARK cipher?

SHARK's linear transformation layer uses an MDS matrix representing a Reed-Solomon error correcting code. This choice guarantees strong diffusion, ensuring that a change in any single input bit propagates widely across the output.