Revision 8336621 of "Meet-in-the-middle attack" on simplewiki{{complex|date=April 2012}}
The '''Meet-in-the-middle attack''' is a [[cryptography|cryptographic]] attack which, like the [[birthday attack]], makes use of a [[space-time tradeoff]]. While the birthday attack attempts to find two values in the domain of a function that map to the same value in its range, the meet-in-the-middle attack attempts to find a value in each of the ranges and domains of the composition of two functions such that the forward mapping of one through the first function is the same as the inverse image of the other through the second function—quite literally meeting in the middle of the composed function.
It was first developed as an attack on an attempted expansion of a [[block cipher]] by [[Whitfield Diffie|Diffie]] and [[Martin Hellman|Hellman]] in 1977. When trying to improve the security of a block cipher, one might get the idea to simply use two independent [[Key (cryptography)|keys]] to encrypt the data twice and think that this would square the security of the double-encryption scheme. Certainly, an exhaustive search of all possible combination of keys would take <math>2^{2n}</math> attempts if each key is n bits long, compared to the <math>2^n</math> attempts required for a single key. However, Diffie and Hellman, discovered a time-memory tradeoff that could break the scheme in only double the time to break the single-encryption scheme.<ref>{{cite journal
| author=W. Diffie and M. E. Hellman
| date=June 1977
| title=Exhaustive Cryptanalysis of the NBS Data Encryption Standard
| journal=Computer
| volume=10
| issue=6
| pages=74–84
| doi=10.1109/C-M.1977.217750
| s2cid=2412454
}}</ref> The attack works by encrypting from one end and decrypting from the other end, thus meeting in the middle.
Assume the attacker knows a set of [[plaintext]] and [[ciphertext]]: ''P'' and ''C''. That is,
: <math>
C=E_{K_2}(E_{K_1}(P))
</math>,
where E is the encryption function (cipher), and ''K''<sub>1</sub> and ''K''<sub>2</sub> are the two keys.
The attacker can then compute ''E<sub>K</sub>''(''P'') for all possible keys ''K'' and store the results in memory. Afterwards he can decrypt the ciphertext by computing ''D<sub>K</sub>''(''C'') for each ''K''. Any matches between these two resulting sets are likely to reveal the correct keys. (To speed up the comparison, the ''E<sub>K</sub>''(''P'') set is stored in an in-memory [[lookup table]], then each ''D<sub>K</sub>''(''C'') can be matched against the values in the lookup table to find the candidate keys.)
Once the matches are discovered, they can be verified with a second test-set of plaintext and ciphertext. If the keysize is ''n'', this attack uses only <math>2^{n+1}</math> encryptions (and <math>O(2^n)</math> space) in contrast to the naive attack, which needs <math>2^{2n}</math> encryptions (but only <math>O(1)</math> space).
==Related pages==
*[[Birthday attack]]
==References==
<references/>
{{Math-stub}}
[[Category:Cryptography]]All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://simple.wikipedia.org/w/index.php?oldid=8336621.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|