Ex Symm
Ex Symm
Cryptology
FME (UPC) 2022
Jorge L. Villar
Feistel Networks
5. Show that at least three iterations in a Feistel Network are necessary to achieve the diffusion property.
To do that, assuming that each iteration can be written as (L, R) 7→ (R, L ⊕ Fi (Ki , R)), where Fi () and
Ki are the round function and the round key, show that for two iterations flipping a single bit of the
L-part of the the plaintext results in flipping only the one bit in the L-part of the resulting ciphertext,
and it is located at the same position.
Modes of Operation
6. In CBC and CFB modes the ciphertext block ci is computed from the corresponding message block
mi and the previous ciphertext block ci−1 using XOR and the block cipher Ek . Show why the similar
combination ci = Ek (mi ) ⊕ ci−1 is not more secure than the basic ECB mode.
7. Show that no padding is necessary when using CFB, OFB or CTR modes of operation, because you
can instead discard the unnecessary bits when masking the last incomplete message block. Why this
trick cannot be applied to CBC or ECB modes?
8. Assuming that the probability that at least two of k independently chosen random values from a set of n
values are equal (Birthday paradox) is about k 2 /(2n), give an estimation of the amount of information
that can be encrypted with AES in CBC mode under the same key, such that the previous collision
probability remains below 2−80 . What happens if AES is replaced by DES?
1
Plaintext Padding
A particular padding scheme is defined as Pad(m) = (m, p, l), where p = 10...0 has exactly a 1-bit followed by
zero or more 0-bits, and l is a 64-bit string containing the binary representation of the length of m (in bits).
The string p has the minimal possible length so that the resulting length of Pad(m) is an exact multiple of
the block length (say 128 bits). We assume that the length of m is less than 264 bits.
CBC-MAC
12. Find a more general forgery against CBC-MAC for messages of arbitrary length, using the ideas in
Proposition 6. Namely, given two valid message/tag pairs (m, t) and (m0 , t0 ), forge a new valid pair
(m00 , t00 ) where m00 is almost the concatenation of m and m0 (you might have to change the first block
of m0 ) and t00 = t0 .
13. One can try to define a CTR-mode based MAC (say CTR-MAC) by encrypting a message (m1 , ..., mn )
using a block cipher Ek operating in CTR mode with a fixed IV (say IV=0), and then XORing all
the ciphertext blocks to obtain the tag, t = c1 ⊕ ... ⊕ cn . Explain why it is insecure by showing a tag
forgery for a two-block message.
Merkle-Damgård Construction
14. If H is a hash function using Merkle-Damgård construction using the length padding described in
section 3.2.1, then show that given H(m) and the length of m (but not m itself) an attacker can find
some nonempty string x such that he can compute H(m, x).
Hint: From the length of m you can know the bits appended to m by the padding function. Then,
you can append some extra blocks to Pad(m) and use H(m) to compute H(m, x) iterating only for
the new blocks.
Merkle Trees
15. How can the Merkle Tree construction be generalized to ternary trees? How many hash values have to
be provided in a proof that an object belongs to the collection? Give an explicit construction for a set
of 7 objects (documents), and a proof for the 4-th object.
Key reusing
16. Show the insecurity of using the same key k for encryption in CBC mode and for authentication with
CBC-MAC. To do that, from a given pair message/ciphertext (m, c), show how to find a valid fresh
message/tag pair m0 , t0 where m0 6= m for CBC-MAC without using the key k. Observe that CBC-MAC
always uses IV = 0 in the CBC chain, while the value of IV used in the pair (m, c) will be nonzero.