In cryptography, an interpolation attack is a type of cryptanalytic attack against block ciphers.
After the two attacks, differential cryptanalysis and linear cryptanalysis, were presented on block ciphers, some new block ciphers were introduced, which were proven secure against differential and linear attacks. Among these there were some iterated block ciphers such as the KN-Cipher and the SHARK 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. This may be a simple quadratic, or a polynomial or rational function over a Galois field. Its coefficients can be determined by standard Lagrange interpolation 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.
Let an iterated cipher be given by
ci=(ci-1 ⊕
3, | |
k | |
i) |
c0
ci
ith
ki
ith
K
r
cr
Consider the 2-round cipher. Let
x
c
Then the output of round 1 becomes
c1=(x+
3=(x | |
k | |
1) |
2+
2)(x | |
k | |
1 |
+
3+ | |
k | |
1)=x |
2x+ | |
k | |
1 |
2k | |
x | |
1+ |
3, | |
k | |
1 |
c2=c=(c1+
3=(x | |
k | |
2) |
3+
2x+ | |
k | |
1 |
2k | |
x | |
1+ |
3+ | |
k | |
1 |
3 | |
k | |
2) |
=x9+
8k | |
x | |
1+ |
6k | |
x | |
2+ |
2k | |
x | |
2+ |
2+ | |
x | |
2 |
2(k | |
x | |
1k |
4k | |
2) + |
8)+ | |
x(k | |
1 |
2+ | |
k | |
2 |
9+ | |
k | |
1 |
3, | |
k | |
2 |
9+ | |
p(x)=a | |
1x |
8+ | |
a | |
2x |
6+ | |
a | |
3x |
4+ | |
a | |
4x |
3+ | |
a | |
5x |
2+ | |
a | |
6x |
a7x+a8,
ai
Using as many plaintext/ciphertext pairs as the number of unknown coefficients in the polynomial
p(x)
p(x)
K
Considering an
m
2m
2m
p/c
n
p(x)
p/c
n\leq2m
Assume that the time to construct the polynomial
p(x)
p/c
n
p(x)
n
n
p/c
Often this method is more efficient. Here is how it is done.
Given an
r
m
z
s
s<r
z
x
c
g(x)\inGF(2m)[x]
z
x
h(c)\inGF(2m)[c]
z
c
g(x)
s
h(c)
r
s+1
So it should hold that
g(x)=h(c),
g
h
Assume that
g(x)
p
h(c)
q
p+q
p/c
p+q-2
p/c
p+q-2
p+q-2
p/c
By the Meet-In-The-Middle approach the total number of coefficients is usually smaller than using the normal method. This makes the method more efficient, since less
p/c
We can also use the interpolation attack to recover the secret key
K
If we remove the last round of an
r
m
\tilde{y}=cr-1
kr
\tilde{y}
By the normal method we express the output
\tilde{y}
x
p(x)\inGF(2m)[x]
p(x)
n
n
p/c
p/c
p(x)=\tilde{y}.
By the Meet-In-The-Middle method we express the output
z
s<r
x
\tilde{y}
g(x)
h(\tilde{y})
p
q
q+p-2
p/c
p/c
g(x)=h(\tilde{y}).
Once we have found the correct last round key, then we can continue in a similar fashion on the remaining round keys.
With a secret round key of length
m
2m
1/2m
1/2 ⋅ 2m
Hence, the normal method have average time complexity
2m-1(n+1)
n+1
c/p
2m-1(p+q-1)
p+q-1
c/p
The Meet-in-the-middle attack can be used in a variant to attack S-boxes, which uses the inverse function, because with an
m
S:f(x)=x-1
2m-2 | |
=x |
GF(2m)
The block cipher SHARK uses SP-network with S-box
S:f(x)=x-1
(n,m,r)
nm
n
m
r
(8,8,4)
221
(8,16,7)
261
Also Thomas Jakobsen introduced a probabilistic version of the interpolation attack using Madhu Sudan's algorithm for improved decoding of Reed-Solomon codes. This attack can work even when an algebraic relationship between plaintexts and ciphertexts holds for only a fraction of values.