Meet-in-the-middle Approach
   HOME

TheInfoList



OR:

The meet-in-the-middle attack (MITM), a known-plaintext attack, is a generic
space–time tradeoff space–time trade-off, also known as time–memory trade-off or the algorithmic space-time continuum in computer science is a case where an algorithm or program trades increased space usage with decreased time. Here, ''space'' refers to the d ...
cryptographic attack against encryption schemes that rely on performing multiple encryption operations in sequence. The MITM attack is the primary reason why Double DES is not used and why a
Triple DES In cryptography, Triple DES (3DES or TDES), officially the Triple Data Encryption Algorithm (TDEA or Triple DEA), is a symmetric-key block cipher, which applies the DES cipher algorithm three times to each data block. The 56-bit key of the Dat ...
key (168-bit) can be brute-forced by an attacker with 256 space and 2112 operations.


Description

When trying to improve the security of a block cipher, a tempting idea is to encrypt the data several times using multiple keys. One might think this doubles or even ''n''-tuples the security of the multiple-encryption scheme, depending on the number of times the data is encrypted, because an exhaustive search on all possible combinations of keys (simple brute force) would take 2''n''·''k'' attempts if the data is encrypted with ''k''-bit keys ''n'' times. The MITM attack is a generic attack which weakens the security benefits of using multiple encryptions by storing intermediate values from the encryptions or decryptions and using those to improve the time required to brute force the decryption keys. This makes a Meet-in-the-Middle attack (MITM) a generic space–time tradeoff
cryptographic Cryptography, or cryptology (from "hidden, secret"; and ''graphein'', "to write", or '' -logia'', "study", respectively), is the practice and study of techniques for secure communication in the presence of adversarial behavior. More gen ...
attack. The MITM attack attempts to find the keys by using both the range (ciphertext) and domain (plaintext) of the composition of several functions (or block ciphers) such that the forward mapping through the first functions is the same as the backward mapping (inverse image) through the last functions, quite literally ''meeting'' in the middle of the composed function. For example, although Double DES encrypts the data with two different 56-bit keys, Double DES can be broken with 257 encryption and decryption operations. The multidimensional MITM (MD-MITM) uses a combination of several simultaneous MITM attacks like described above, where the meeting happens in multiple positions in the composed function.


History

Diffie and Hellman first proposed the meet-in-the-middle attack on a hypothetical expansion of a
block cipher In cryptography, a block cipher is a deterministic algorithm that operates on fixed-length groups of bits, called ''blocks''. Block ciphers are the elementary building blocks of many cryptographic protocols. They are ubiquitous in the storage a ...
in 1977. Their attack used a
space–time tradeoff space–time trade-off, also known as time–memory trade-off or the algorithmic space-time continuum in computer science is a case where an algorithm or program trades increased space usage with decreased time. Here, ''space'' refers to the d ...
to break the double-encryption scheme in only twice the time needed to break the single-encryption scheme. In 2011, Bo Zhu and Guang Gong investigated the ''multidimensional meet-in-the-middle attack'' and presented new attacks on the block ciphers
GOST GOST () refers to a set of international technical standards maintained by the Euro-Asian Council for Standardization, Metrology and Certification (EASC), a regional standards organization operating under the auspices of the Commonwealth of I ...
, KTANTAN and Hummingbird-2.


Meet-in-the-middle (1D-MITM)

Assume someone wants to attack an encryption scheme with the following characteristics for a given plaintext ''P'' and ciphertext ''C'': :\begin C &= \mathit_(\mathit_(P)) \\ P &= \mathit_(\mathit_(C)) \\ \end where ''ENC'' is the encryption function, ''DEC'' the decryption function defined as ''ENC''−1 (inverse mapping) and ''k''1 and ''k''2 are two keys. The naive approach at brute-forcing this encryption scheme is to decrypt the ciphertext with every possible ''k''2, and decrypt each of the intermediate outputs with every possible ''k''1, for a total of 2, ''k''1, × 2, ''k''2, (or 2, ''k''1, +, ''k''2, ) operations. The meet-in-the-middle attack uses a more efficient approach. By decrypting ''C'' with ''k2'', one obtains the following equivalence: :\begin C &= \mathit_(\mathit_(P)) \\ \mathit_(C) &= \mathit_(\mathit_ mathit_(P) \\ \mathit_(C) &= \mathit_(P) \\ \end The attacker can compute ''ENC''''k''1(''P'') for all values of ''k''1 and ''DEC''''k''2(''C'') for all possible values of ''k''2, for a total of 2, ''k''1, + 2, ''k''2, (or 2, ''k''1, +1, if ''k''1 and ''k''2 have the same size) operations. If the result from any of the ''ENC''''k''1(''P'') operations matches a result from the ''DEC''''k''2(''C'') operations, the pair of ''k''1 and ''k''2 is possibly the correct key. This potentially-correct key is called a ''candidate key''. The attacker can determine which candidate key is correct by testing it with a second test-set of plaintext and ciphertext. The MITM attack is one of the reasons why
Data Encryption Standard The Data Encryption Standard (DES ) is a symmetric-key algorithm for the encryption of digital data. Although its short key length of 56 bits makes it too insecure for modern applications, it has been highly influential in the advancement of cryp ...
(DES) was replaced with
Triple DES In cryptography, Triple DES (3DES or TDES), officially the Triple Data Encryption Algorithm (TDEA or Triple DEA), is a symmetric-key block cipher, which applies the DES cipher algorithm three times to each data block. The 56-bit key of the Dat ...
and not Double DES. An attacker can use a MITM attack to bruteforce Double DES with 257 operations and 256 space, making it only a small improvement over DES. Triple DES uses a "triple length" (168-bit) key and is also vulnerable to a meet-in-the-middle attack in 256 space and 2112 operations, but is considered secure due to the size of its keyspace.


MITM algorithm

Compute the following: *\mathit_1=\mathit_(k_,P),\; \forall k_ \in K : *: and save each \mathit_ together with corresponding k_ in a set A *\mathit_1=\mathit_(k_,C),\; \forall k_ \in K : *: and compare each new \mathit_1 with the set A When a match is found, keep k_,k_ as candidate key-pair in a table ''T''. Test pairs in ''T'' on a new pair of to confirm validity. If the key-pair does not work on this new pair, do MITM again on a new pair of .


MITM complexity

If the keysize is ''k'', this attack uses only 2''k''+1 encryptions (and decryptions) and ''O''(2''k'') memory to store the results of the forward computations in a
lookup table In computer science, a lookup table (LUT) is an array data structure, array that replaces runtime (program lifecycle phase), runtime computation of a mathematical function (mathematics), function with a simpler array indexing operation, in a proc ...
, in contrast to the naive attack, which needs 22·''k'' encryptions but ''O''(1) space.


Multidimensional MITM (MD-MITM)

While 1D-MITM can be efficient, a more sophisticated attack has been developed: multidimensional meet-in-the-middle attack, also abbreviated MD-MITM. This is preferred when the data has been encrypted using more than 2 encryptions with different keys. Instead of meeting in the middle (one place in the sequence), the MD-MITM attack attempts to reach several specific intermediate states using the forward and backward computations at several positions in the cipher. Assume that the attack has to be mounted on a block cipher, where the encryption and decryption is defined as before: : C=\mathit_(\mathit_(...(\mathit_(P))...))
: P=\mathit_(\mathit_(...(\mathit_(C))...)) that is a plaintext P is encrypted multiple times using a repetition of the same block cipher The MD-MITM has been used for cryptanalysis of, among many, the GOST block cipher, where it has been shown that a 3D-MITM has significantly reduced the time complexity for an attack on it.


MD-MITM algorithm

Compute the following: :; \mathit_1=\mathit_(k_,P)\qquad\forall k_ \in K :: and save each \mathit_1 together with corresponding k_ in a set H_1. :; \mathit_=\mathit_(k_,C) \qquad\forall k_ \in K :: and save each \mathit_ together with corresponding k_ in a set H_. For each possible guess on the intermediate state s_1 compute the following: :; \mathit_1=\mathit_(k_,s_1) \qquad\forall k_ \in K :: and for each match between this \mathit_1 and the set H_1 , save k_ and k_ in a new set T_1 . :; \mathit_2=\mathit_(k_,s_1) \qquad\forall k_ \in K :: and save each \mathit_2 together with corresponding k_ in a set H_2. : For each possible guess on an intermediate state s_2 compute the following: :* \mathit_2=\mathit_(k_,s_2) \qquad\forall k_ \in K :*: and for each match between this \mathit_2 and the set H_2 , check also whether :*: it matches with T_1 and then save the combination of sub-keys together in a new set T_2 . :* For each possible guess on an intermediate state s_n compute the following: Use the found combination of sub-keys (k_,k_,k_,k_, ... ,k_,k_) on another pair of plaintext/ciphertext to verify the correctness of the key. Note the nested element in the algorithm. The guess on every possible value on ''sj'' is done for each guess on the previous ''s''''j''-1. This make up an element of exponential complexity to overall time complexity of this MD-MITM attack.


MD-MITM complexity

Time complexity of this attack without brute force, is 2^+2^+2^(2^+2^+2^(2^+2^+\cdots)) Regarding the memory complexity, it is easy to see that T_2,T_3,... ,T_n are much smaller than the first built table of candidate values: T_1 as i increases, the candidate values contained in T_i must satisfy more conditions thereby fewer candidates will pass on to the end destination T_n. An upper bound of the memory complexity of MD-MITM is then : 2^+2^+2^\cdots where denotes the length of the whole key (combined). The data complexity depends on the probability that a wrong key may pass (obtain a false positive), which is 1/2^, where is the intermediate state in the first MITM phase. The size of the intermediate state and the block size is often the same! Considering also how many keys that are left for testing after the first MITM-phase, it is 2^/2^. Therefore, after the first MITM phase, there are 2^ \cdot 2^ = 2^, where , b, is the block size. For each time the final candidate value of the keys are tested on a new plaintext/ciphertext-pair, the number of keys that will pass will be multiplied by the probability that a key may pass which is 1/2^. The part of brute force testing (testing the candidate key on new -pairs, have time complexity 2^+2^+2^+2^\cdots , clearly for increasing multiples of b in the exponent, number tends to zero. The conclusion on data complexity is by similar reasoning restricted by that around \lceil, k, /n\rceil -pairs. Below is a specific example of how a 2D-MITM is mounted:


A general example of 2D-MITM

This is a general description of how 2D-MITM is mounted on a block cipher encryption. In two-dimensional MITM (2D-MITM) the method is to reach 2 intermediate states inside the multiple encryption of the plaintext. See below figure:


2D-MITM algorithm

Compute the following: :; \mathit_1=\mathit_(k_,P) \qquad \forall k_ \in K :: and save each \mathit_1 together with corresponding k_ in a set A :; \mathit_2=\mathit_(k_,C) \qquad \forall k_ \in K :: and save each \mathit_2 together with corresponding k_ in a set B. For each possible guess on an intermediate state ''s'' between \mathit_1 and \mathit_2 compute the following: * \mathit_1=\mathit_(k_,s) \qquad \forall k_ \in K *: and for each match between this \mathit_1 and the set A, save k_ and k_ in a new set T. * \mathit_2=\mathit_(k_,s) \qquad \forall k_ \in K *: and for each match between this \mathit_2 and the set B, check also whether it matches with T for *: if this is the case then: Use the found combination of sub-keys (k_,k_,k_,k_) on another pair of plaintext/ciphertext to verify the correctness of the key.


2D-MITM complexity

Time complexity of this attack without brute force, is : 2^ + 2^ + 2^ \cdot \left(2^ + 2^\right) where , ⋅, denotes the length. Main memory consumption is restricted by the construction of the sets ''A'' and ''B'' where ''T'' is much smaller than the others. For data complexity see subsection on complexity for MD-MITM.


See also

*
Birthday attack A birthday attack is a bruteforce collision attack that exploits the mathematics behind the birthday problem in probability theory. This attack can be used to abuse communication between two or more parties. The attack depends on the higher likeli ...
*
Wireless security Wireless security is the prevention of unauthorized access or damage to computers or data using wireless networks, which include Wi-Fi networks. The term may also refer to the protection of the wireless network itself from adversaries seeking to ...
*
Cryptography Cryptography, or cryptology (from "hidden, secret"; and ''graphein'', "to write", or ''-logy, -logia'', "study", respectively), is the practice and study of techniques for secure communication in the presence of Adversary (cryptography), ...
* 3-subset meet-in-the-middle attack * Partial-matching meet-in-the-middle attack


References

{{cryptography navbox, block Cryptographic attacks