Stuck at another cryptography problem


Cryptography 2018-08-28

I launched my attack on the problem set on chapter 3 of A Graduate Course in Applied Cryptography, just found myself to be stuck at the very first problem1. I am légume! (That was a pun. If you translate it into Chinese it means “I am not smart”.) The problem was kind of interesting, so I wish to post it here.

Background

To understand the problem, readers should be familiar with the concept of Semantic Security.

The first problem

Suppose you had a cipher which is semantically secure for random messages. That is, any adversary in the following game has negligible advantage.

This security is apparently weaker than security in ordinary models where messages are chosen by the adversaries. However, part (a) asks you to construct a cipher that is semantically secure in the ordinary sense, from the cipher . The new cipher should be defined over where and . Part (b) asks the reader to construct a cipher that is secure for random messages but not secure in the ordinary sense.

Solution to (a)

Part (b) can be easily shown by using a construction I made in the past problem set and is left to the blog readers. I stucked on part (a) for most of the time. I believe my first intuition was the correct construction, but I abandoned it before checking its vaildity and moved on to complicated constructions that won’t work. But after struggling a while I still cannot prove the security of it.

The construction ( spoiler alert )
The construction is very similar to ciphers using nonces. For each encryption query, let be a randomly generated message (as a bit-string), then define and . It is definitely a well-defined cipher with the required domains.

I wanted to show that it is sematically secure in the ordinary sense, suppose the contrary. Then we had an adversary attacking this cipher with non-negligible advantage SSAdv. We construct the following adversary .

Then,
.

If we can show that is correct then we are done because the first term is at least for some non-negligible . But I do not think this can be proven in any way. The core problem seems to be the fact that we did not tight with the corresponding in the ciphertext in a way that is satisfying. Or maybe is the construction just plain wrong?

Updated (But incorrect argument)
It suddenly appeared to me that the above construction was indeed correct! Look at the last equality. The probability that gets the correct guess is exactly for the second term because the ciphertext sent to A, which is , as seen from the perspective of is just two random strings. So it gives no information about and thus the probability is exactly .

Using this fact, the advantage of B turns out to be which is non-negligible, that completes the proof.

Correct construction

The above argument was wrong because you cannot simply jump to the conclusion that “So it gives no information about and thus the probability is exactly ”. Indeed, adversary may be able to distinguish ciphertexts random input () from ciphertexts of a fixed input ().

The original reduction was nearly correct. We only need to modify such that it flips a coin to decide which to append to the ciphertext before giving to .

Let be the probability that given a ciphertext of a random message, outputs 0.

Then we have
The equality is due to the fact that when , we are essentially giving a random ciphertext to .

So has non-negligible advantage.

Reference