# Using rainbow tables to find encryption keys of block ciphers?

Hi I have a question in mind.

Let's consider a block cipher whose key length is 36 bits. The bit-length of the plaintext is 256 bits, but there are only 16 possible plaintexts $m_0, m_1, . . . , m_{15}$. The encryptions are carried out in ECB mode and thus no IV is involved. We want to build a rainbow table such that, on input a ciphertext, we can readily find the key and the plaintexts.

How do we go about constructing a rainbow table for this purpose?

## 1 Answer

Define a function that takes the 4-bit plaintext identifier and the 36-bit key as input. For the purpose of the rainbow table you can treat it as an opaque 40-bit value.

The output of this function is the ciphertext you get when you encrypt the plaintext corresponding to the identifier with the specified key.

One you have this function, you can proceed with the rainbow table creation like you'd do for any other function.

• Hi, my plaintext is 256 bits, not 4 bits... – freak_warrior Nov 14 '16 at 9:23
• @freak_warrior I said "plaintext identifier". You only need 4-bits to determine which of the 16 possible plaintexts you want. – CodesInChaos Nov 14 '16 at 9:25
• Ok... so what reduction function should i use? – freak_warrior Nov 14 '16 at 9:47
• @freak_warrior If you only need one reduction function, truncation should be enough. Otherwise you could expand the output using a stream cipher. – CodesInChaos Nov 16 '16 at 8:02