2201 COL759 Lecture04
2201 COL759 Lecture04
1 Last Lecture
In the last lecture, we discussed that any encryption scheme (Enc, Dec) with key space K and
message space M that satisfies perfect correctness and perfect secrecy (as per Definition 02.04
in Lecture 02) must have |K| ≥ |M|.
Next, we discussed that a reasonable relaxation of the security definition is to require security
against efficient adversaries, instead of requiring security against ALL adversaries. To define
security against efficient adversaries, we introduce a security parameter — an integer n that
indicates how secure the system will be. We introduced a special key generation algorithm
KeyGen that takes the security parameter as input, and outputs the secret key. All algorithms
(KeyGen, Enc and Dec) as well as the adversary, must have running time bounded by poly(n).
We then formulated security in terms of a security game between a challenger and an adver-
sary. Security games in general, capture two things:
No-Query-Semantic-Security
that depends on x and r. In this course, all security games will involve prob. algorithms. Therefore, in the
analysis, we should also take the algorithm’s randomness into consideration.
In this security game (and most security games that we’ll see from now on) the adversary can
‘guess’ the key used by the challenger, and this guess is correct with some non-zero probability.
The crucial issue here is that the adversary must somehow ‘check’ whether its guess is correct
or not (in order to decide whether to go with the decryption, or to output a random bit). This
checking makes the analysis a bit complicated. In our case, the adversary, in order to check if
the guessed key is the same as the one chosen by the challenger, tries to decrypt the challenge
ciphertext. If the decryption outputs neither m0 nor m1 , then the adversary concludes that its
guessed key is not same as the challenger’s key, and it outputs a random bit. If the decryption
was either m0 or m1 , the adversary concludes that its guess is correct, and outputs 0 or 1
accordingly. Note that this conclusion may be wrong – maybe the challenge ciphertext was an
encryption of m0 using key k0 (chosen by the challenger), but the adversary chose a key k1 such
that the challenge ciphertext is also an encryption of m1 under k1 . In this case, the adversary
will (wrongly) conclude that its guessed key is the correct key. However, we will see below that
the adversary still wins the game with probability strictly greater than 1/2 (albeit only slightly
greater than 1/2).
1
Claim 04.01. The success probability of the above described adversary is at least 2 + Ω( 21n ).
Proof. We present our analysis only for the case ℓ > 3n. The analysis for the general case is left
as an exercise.
Recall m0 = 0n . Fix the challenger’s key k. We will prove that for any choice of key k,
h i
Pr A wins the No-Query-Semantic-Security game ≥ 1/2 + Ω(1/2n )
where, the probability is taken over the random choices of: message m1 (chosen by A), bit b
(chosen by the challenger), key k ′ (chosen by A), and bit b′ (chosen by A). If the above inequality
holds for all keys k, it will hold even if k was chosen at random.
h i h i h i
Pr A wins ∧ ¬BadEventk = Pr A wins |¬BadEventk · Pr ¬BadEventk (1)
h i h i
Let us focus on Pr A wins | ¬BadEventk , since Pr ¬BadEventk is close to 1. If the bad
event does not happen, and the adversary’s key k ′ is not equal to k, then the decryption cannot
output m1 . This observation is used to simplify the probability of A winning, conditioned on
¬BadEventk .
h i h i h i
Pr A wins | ¬BadEventk = Pr A wins | k = k ′ ∧ ¬BadEventk · Pr k = k ′ | ¬BadEventk
h i h i
+ Pr A wins | k ̸= k ′ ∧ ¬BadEventk · Pr k ̸= k ′ | ¬BadEventk
h i
(∗) Pr A wins | k = k ′ ∧ ¬BadEventk = 1 (A definitely wins if k = k ′ )
h i
(∗) Pr A wins | k ̸= k ′ ∧ ¬BadEventk ≥ 1/2 (A sends random guess b′ )
h i
(∗) Pr k = k ′ | ¬BadEventk = 1/2n (k ′ and m1 are independently chosen)
h i
Therefore, Pr A wins | ¬BadEventk ≥ 1/2n + 1/2(1 − 1/2n ) = 1/2 + 1/2n+1 .
Therefore, for an encryption scheme to be secure, for any probabilistic polynomial time
adversary, the probability of winning the security game must be at most 1/2 + f (n), where f (n)
is eventually smaller than any inverse polynomial function. We call such functions negligible
functions.
Definition 04.01. A function µ : N → [0, 1] is said to be negligible if, for any polynomial p(·),
there exists n0 ∈ N such that for all n > n0 , µ(n) < 1/p(n).
Definition 04.02. An encryption scheme (KeyGen, Enc, Dec) is said to satisfy no-query-
semantic-security if, for any probabilistic polynomial time adversary A, there exists a negligible
function µ(·) such that for all n,
h i
Pr A wins the No-Query-Semantic-Security game ≤ 1/2 + µ(n)
5 Security proofs
Armed with the above security definition, we are ready to see our first security proof. Suppose
you are given an encryption scheme E = (KeyGen, Enc, Dec) with M = C = {0, 1}ℓ that satisfies
Definition 04.02. Consider the following modified encryption scheme E ′ = (KeyGen′ , Enc′ , Dec′ ):
• KeyGen′ = KeyGen
• Enc′ (m, k) = reverse Enc(reverse(m), k)
• Dec′ (ct, k) = reverse Dec(reverse(ct), k)
We will show that E ′ also satisfies Definition 04.02, assuming E does. We will prove this
statement by taking the contrapositive. Suppose, there exists a prob. poly. time adversary A
that breaks security of E ′ . Then we will show a prob. poly. time adversary B (that using A)
breaks the security of E.
More formally, suppose there exists a non-negligible function ϵA (·) such that for infinitely
many n,
h i
Pr A wins the No-Query-Semantic-Security game against E ′ ≥ 1/2 + ϵA (n).
Note: the probability is over the choice of bit b and key k chosen by the challenger, as well as any
randomness that the adversary might use. Also, in the probability event, we specify the security
game (No-Query-Semantic-Security), as well as the encryption scheme E ′ .
We will use A and the non-negl. function ϵA to break the security of E as follows:
2A common template for defining security via security games (in this course) is to first define a security game,
and then identify the trivial winning strategy in this game. A construction is secure (w.r.t. this security game)
if no prob. poly. time adversary can win the game with probability significantly larger than the trivial winning
probability.
• build a prob. poly. time adversary B that uses A as a black-box.
• propose a non-negligible function ϵB that depends on ϵA
h i
• show that Pr B wins the No-Query-Semantic-Security game against E ≥ 1/2 + ϵB (n)
Reductions will be the bread-and-butter of this course, so please make sure you
understand all the details here.
Note that B, together with the adversary A, act as an adversary that wants to break the
security of E. From the viewpoint of the challenger for E, it is interacting with an adversary that
wants to win the game against E.
Before proceeding with the formal proof, think about the following questions:
• what happens if B sets m0 = m′0 , m1 = m′1 (instead of reversing the messages m′0 , m′1 )?
Claim 04.02.
h i
Pr B wins the No-Query-Semantic-Security game against E
h = i
Pr A wins the No-Query-Semantic-Security game against E ′ .
This probability is over the choice of bit b, key k by the challenger, and the randomness of A.
Expanding the above probability, we get the following:
m′0 , m′1
A chooses
′
Pr ct = reverse Enc(reverse(mb ), k)
b←{0,1},k←K
rand. of A A, on receiving ct′ outputs b
Now, note that this is identical to
and this is the probability that A wins the No-Query-Semantic-Security security game against
E ′.
6 Exercises
You are strongly advised to attempt the following problems before the next class.
Question 04.02. Let E = (KeyGen, Enc, Dec) be an encryption scheme that satisfies Definition
04.02. Consider the following modified encryption scheme (KeyGen′ , Enc′ , Dec′ ):
• KeyGen′ = Run KeyGen twice, and let k1 , k2 be the two output keys. Output k = (k1 , k2 )
as the key.
• Enc′ (m, k = (k1 , k2 )) = (Enc(m, k1 ), Enc(m, k2 ))
• Dec′ (ct = (ct1 , ct2 ), k = (k1 , k2 )) = Dec(ct1 , k1 )
Show that E ′ satisfies Definition 04.02, assuming E does.
Question 04.03. Security proofs can also be used for studying the relationship between various
security definitions. Let E = (KeyGen, Enc, Dec) be an encryption scheme with message space
M.
1. Propose a security game (and a security definition) to capture the following ‘intuitive
definition’: an encryption scheme is secure against message recovery attacks if no adver-
sary can recover the message, given the encryption of a uniformly random message using
a uniformly random key.
Hint: there exist prob. poly. time adveraries that can win the above game with probability
1/|M|.
2. Show that if an encryption scheme E satisfies No-Query-Semantic-Security, then it also
satisfies security against message recovery attacks.
Question 04.04 (*). Can you modify the above definition to allow the adversary to choose a
message distribution that it wants to attack? Would the same reduction work?
• Security proofs via reductions are useful for proving security of a cryptographic construc-
tion, assuming the security of the underlying building blocks. They can also be used to
compare security definitions (that is, whether one definition is stronger/weaker than the
other).
Relevant sections from textbook [Boneh-Shoup]: 2.3.1, 2.3.2, 2.3.3.1 (this subsection discusses
Question 04.03), 2.4.