In
cryptography
Cryptography, or cryptology (from grc, , translit=kryptós "hidden, secret"; and ''graphein'', "to write", or ''-logia'', "study", respectively), is the practice and study of techniques for secure communication in the presence of adve ...
, an interpolation attack is a type of
cryptanalytic attack
Cryptanalysis (from the Greek ''kryptós'', "hidden", and ''analýein'', "to analyze") refers to the process of analyzing information systems in order to understand hidden aspects of the systems. Cryptanalysis is used to breach cryptographic sec ...
against
block cipher
In cryptography, a block cipher is a deterministic algorithm operating on fixed-length groups of bits, called ''blocks''. Block ciphers are specified cryptographic primitive, elementary components in the design of many cryptographic protocols and ...
s.
After the two attacks,
differential cryptanalysis
Differential cryptanalysis is a general form of cryptanalysis applicable primarily to block ciphers, but also to stream ciphers and cryptographic hash functions. In the broadest sense, it is the study of how differences in information input can af ...
and
linear cryptanalysis
In cryptography, linear cryptanalysis is a general form of cryptanalysis based on finding affine approximations to the action of a cipher. Attacks have been developed for block ciphers and stream ciphers. Linear cryptanalysis is one of the two ...
, were presented on block ciphers, some new
block ciphers
In cryptography, a block cipher is a deterministic algorithm operating on fixed-length groups of bits, called ''blocks''. Block ciphers are specified elementary components in the design of many cryptographic protocols and are widely used to encry ...
were introduced, which were proven secure against differential and linear attacks. Among these there were some iterated block ciphers such as the
KN-Cipher
In cryptography, KN-Cipher is a block cipher created by Kaisa Nyberg and Lars Knudsen in 1995. One of the first ciphers designed to be provably secure against ordinary differential cryptanalysis, KN-Cipher was later broken using higher order diff ...
and the
SHARK
Sharks are a group of elasmobranch fish characterized by a cartilaginous skeleton, five to seven gill slits on the sides of the head, and pectoral fins that are not fused to the head. Modern sharks are classified within the clade Selachi ...
cipher. However, Thomas Jakobsen and Lars Knudsen showed in the late 1990s that these ciphers were easy to break by introducing a new attack called the interpolation attack.
In the attack, an algebraic function is used to represent an
S-box
In cryptography, an S-box (substitution-box) is a basic component of symmetric key algorithms which performs substitution. In block ciphers, they are typically used to obscure the relationship between the key and the ciphertext, thus ensuring Shan ...
. This may be a simple
quadratic
In mathematics, the term quadratic describes something that pertains to squares, to the operation of squaring, to terms of the second degree, or equations or formulas that involve such terms. ''Quadratus'' is Latin for ''square''.
Mathematics ...
, or a
polynomial
In mathematics, a polynomial is an expression consisting of indeterminates (also called variables) and coefficients, that involves only the operations of addition, subtraction, multiplication, and positive-integer powers of variables. An ex ...
or
rational function
In mathematics, a rational function is any function that can be defined by a rational fraction, which is an algebraic fraction such that both the numerator and the denominator are polynomials. The coefficients of the polynomials need not be ...
over a
Galois field
In mathematics, a finite field or Galois field (so-named in honor of Évariste Galois) is a field that contains a finite number of elements. As with any field, a finite field is a set on which the operations of multiplication, addition, subt ...
. Its coefficients can be determined by standard
Lagrange interpolation
In numerical analysis, the Lagrange interpolating polynomial is the unique polynomial of lowest degree that interpolates a given set of data.
Given a data set of coordinate pairs (x_j, y_j) with 0 \leq j \leq k, the x_j are called ''nodes'' an ...
techniques, using
known plaintexts as data points. Alternatively,
chosen plaintexts can be used to simplify the equations and optimize the attack.
In its simplest version an interpolation attack expresses the ciphertext as a polynomial of the plaintext. If the polynomial has a relative low number of unknown coefficients, then with a collection of plaintext/ciphertext (p/c) pairs, the polynomial can be reconstructed. With the polynomial reconstructed the attacker then has a representation of the encryption, without exact knowledge of the secret key.
The interpolation attack can also be used to recover the secret key.
It is easiest to describe the method with an example.
Example
Let an iterated cipher be given by
:
where
is the plaintext,
the output of the
round,
the secret
round key (derived from the secret key
by some
key schedule
In cryptography, the so-called product ciphers are a certain kind of cipher, where the (de-)ciphering of data is typically done as an iteration of ''rounds''. The setup for each round is generally the same, except for round-specific fixed val ...
), and for a
-round iterated cipher,
is the ciphertext.
Consider the 2-round cipher. Let
denote the message, and
denote the ciphertext.
Then the output of round 1 becomes
:
and the output of round 2 becomes
:
:
Expressing the ciphertext as a polynomial of the plaintext yields
:
where the
's are key dependent constants.
Using as many plaintext/ciphertext pairs as the number of unknown coefficients in the polynomial
, then we can construct the polynomial. This can for example be done by Lagrange Interpolation (see
Lagrange polynomial
In numerical analysis, the Lagrange interpolating polynomial is the unique polynomial of lowest degree that interpolates a given set of data.
Given a data set of coordinate pairs (x_j, y_j) with 0 \leq j \leq k, the x_j are called ''nodes'' an ...
). When the unknown coefficients have been determined, then we have a representation
of the encryption, without knowledge of the secret key
.
Existence
Considering an
-bit block cipher, then there are
possible plaintexts, and therefore
distinct
pairs. Let there be
unknown coefficients in
. Since we require as many
pairs as the number of unknown coefficients in the polynomial, then an interpolation attack exist only if
.
Time complexity
Assume that the time to construct the polynomial
using
pairs are small, in comparison to the time to encrypt the required plaintexts. Let there be
unknown coefficients in
. Then the time complexity for this attack is
, requiring
known distinct
pairs.
Interpolation attack by Meet-In-The-Middle
Often this method is more efficient. Here is how it is done.
Given an
round iterated cipher with block length
, let
be the output of the cipher after
rounds with