





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






University of Illinois, Urbana Champaign CS/ECE 498AC3/4 Applied Cryptography
Instructor: Dakshita Khurana Scribe: Kyo Kim, Tzu-Bin Yan Date: September 24, 2020
Public-Key Encryption 2
In this lecture, we will move on to learn about how hard problems, like the discrete logarithm introduced in the last lecture, can in fact be employed to construct what is called public-key encryption systems, which, contrary to what we have seen so far, does not require a shared private key among communicating parties. In the following text, we will first look into the definition and security of the public-key encryption scheme. We will then move on to see two examples for such a scheme, with each relying on hard problems stated as assumptions for their respective security. Due to the relief of requiring shared secret key among communicating parties, public- key encryption has been widely employed in various real-world scenarios such as in both TLS, SSH, and the Pretty Good Privacy (PGP) protocol, which thus renders it essential for students to understand what public-key encryption is and more importantly, why they are secure from a formal perspective, to work our way toward provable security via cryptography.
As we left off with a high-level introduction to public-key encryption last lecture, let’s start this lecture with a brief review of what public-key encryption is. Public-key encryption intuitively consists of three components: a key generation algorithm G to generate a public and private key pair (pk, sk) based on randomness, an encryption algorithm E taking the public-key pk, a plaintext message m and some randomness to generate a ciphertext c, and a decryption algorithm D taking the private key sk and a ciphertext c to recover the plaintext message m. We now introduce the formal definition of public-key encryption:
Definition 10.1. A public-key encryption system ε = (G, E, D) is a set of three efficient algorithms:
that satisfies the correctness property, where ∀(pk, sk) generated by G
(∀m ∈ M ) D(sk, E(pk, m)) = m
where a randomized algorithm indicates that the algorithm employs some randomness during operation, and M , C denotes the message (plaintext) space and ciphertext space for ε, respectively.
Now given that we have defined the public-key encryption scheme, let’s look back to the key exchange problem last lecture, which we partially solved by introducing the Diffie- Hellman protocol. Observe that public-key encryption can also be utilized to solve the same problem by the following process: suppose there are two parties: Alice and Bob, who would like to establish a shared secret. Alice has already generated a public-private key pair (pk, sk) with pk being publicly known. For Alice and Bob to come up with a shared secret, it would be sufficient for Bob to pick some random secret x and then encrypt the random secret with Alice’s public-key pk, getting E(pk, x), before sending the encrypted secret onto the public communication channel to Alice. Alice will then be able to recover the secret x via decrypting with her secret key sk, thus allowing the two parties to establish the shared secret x. Observe that in this case, assuming semantic security (we will see what this means in a moment) of the public-key encryption system employed, passive attackers (i.e. attackers that cannot actively modify traffic in the public channel) will be shielded away from the chosen secret, thus allowing a secure key exchange process. Similar to private key encryption, it is then essential for us to discuss the semantic security properties of public-key encryption. As one would guess, it is a bit similar to what we have seen in private key encryption, with a little bit of a twist due to the availability of the public-key to the adversary, as we will see in the next section.
Public encryption semantic security can be defined in terms of the following experiment.
Definition 10.2. Public-key encryption one-time attacker game. Experiment b ∈ { 0 , 1 }, denoted as EXPone(b), is defined using a challenger C and a efficient (i.e. PPT) adversary A where:
Proof. Proof for this direction is straightforward as many-time semantic security is a gen- eralization of one-time semantic security.
Lemma 10.8. One-time semantic security implies many-time semantic security.
The one-time to many-time part is harder to prove. Before we dive into the details, let’s design a new game that will help us along the process.
Definition 10.9. m-modified public-key encryption many-time attacker game. Experiment b ∈ { 0 , 1 }, denoted EXPmodm(b), is defined using a challenger Cmodm and an adversary A, where i ∈ Z+^ of interactions occur and m ∈ Z+, m ≤ i:
(a) A sends mj 0 , mj 1 ∈ M where M is the message space and |mj 0 | = |mj 1 | (b) Cmodm sends E(pk, mj 0 ) to A
(a) A sends mj 0 , mj 1 ∈ M and |mj 0 | = |mj 1 | (b) C chooses mjb and sends E(pk, mjb) to A
Notice that the difference between EXPmodm and EXPmany is that in the first m round of interaction, the challenger always sends the encrypted mj 0 for round j. Now to the real proof.
Proof. Let’s use proof by contradiction to prove this direction. Suppose there is a public encryption system ε = (G, E, D), that is one-time semantic secure but not many-time se- mantic secure. Therefore, there exist a PPT adversary A that can distinguish EXPmany (·). Consider the modified game 10.9 with m being 1 (i.e. EXPmod 1 (.)). The argument that we want to construct here is that the assumed A that can break many-time semantic security of ε can also have a non-negligible advantage in distinguishing EXPmod 1 (·):
Claim 10.10. A that can break game 10.4 can defeat EXPmod 1 (.) with the non-negligible advantage many − one, i.e.
|P r[b′^ = 1|EXPmod 1 (0)] − P r[b′^ = 1|EXPmod 1 (1)]| > many − one
The claim can be proved by contradiction, where a new adversary B capable of defeating the one-time semantic security game 10.2 (by having an advantage of > one) can be created by simulating EXPmod 1 for A, which cannot defeat EXPmod 1. The exact proof for this part is left for exercise. Now consider the modified game 10.9 with m being 2 (i.e. EXPmod 2 (.)). The argument that we want to construct here is that the assumed A that can break many-time semantic security of ε can defeat EXPmod 2 (.) as well:
Claim 10.11. A that can break game 10.4 can defeat EXPmod 2 (.) with the non-negligible advantage many − 2 one, i.e.
|P r[b′^ = 1|EXPmod 2 (0)] − P r[b′^ = 1|EXPmod 2 (1)]| > many − 2 one
The claim can also be proved by contradiction, which is left as an exercise. Note that we can in fact iteratively prove similar claims for m up to i, the maximum number of interaction rounds, which leads us to the final claim:
Claim 10.12. A that can break game 10.4 can defeat EXPmodi(.) with the non-negligible advantage many − ione, i.e.
|P r[b′^ = 1|EXPmodi(0)] − P r[b′^ = 1|EXPmodi(1)]| > many − ione
However, observe that in game 10.9 with m being i, no information regarding b is actually present to A, indicating that it is impossible for A to have an advantage in guessing b, i.e.
|P r[b′^ = 1|EXPmodi(0)] − P r[b′^ = 1|EXPmodi(1)]| = 0
With many − ione >= 0 by definition, we have a contradiction.
We thus have that the theorem 10.6 holds by lemma 10.7 and lemma 10.8.
After having formally defined public-key encryption, let’s take a look into an example: the El-Gamal encryption. The El-Gamal encryption in some sense combines the Diffie- Hellman protocol with message encryption. Suppose there is a finite cyclic group G with a generator g ∈ G (G and g publicly known), recall that in the Diffie-Hellman protocol, the two parties involved in the key exchange process would each pick some random secret ∈ G (say a and b) and calculate the discrete exponentiation of the secret, i.e. ga^ and gb. The exponentiation results are then passed to the other party, where both parties utilize the obtained result and their respective chosen secret to, again, calculate the discrete exponentiation, i.e. (ga)b^ = gab^ = (gb)a. The gab^ is then the shared secret among the two parties. In the El-Gamal encryption, we modify the Diffie-Hellman key exchange process by com- bining the establishment of the shared secret with the encryption of some plaintext. More concretely, consider the previous case of Alice and Bob in the Diffie-Hellman protocol exam- ple on G. In El-Gamal encryption, one of the party (say Alice), generate the public-private key pair (ga, a) in advance, where g is a generator for G and a ∈ G is Alice’s secret key. For Bob to encrypt some message m for Alice, he will first generate some random secret b ∈ G and calculate the ”shared” secret s = gab^ the same way via discrete exponentiation as in the Diffie-Hellman protocol. The secret is further hashed with some public hash algorithm H, and the resulting hash H(s) is the actual key that is used afterwards for message en- cryption, which Bob employs AES with some appropriate mode of operation in this case. The resulting ciphertext Bob sends onto the network is the pair (gb, AES.Enck(m)) where k = H(s). For Alice to decrypt the ciphertext, Alice first derives the ”shared” secret by performing discrete exponentiation against the first component gb^ of the ciphertext, getting the secret s = (gb)a^ = gab. Alice then hashes the resulting s to get the actual key k = H(s),
Definition 10.15. Given G being a finite cyclic group of order n, and a hash function H : G → K on some space K, the hash Diffie-Hellman (HDH) assumption holds for (G, H) if the pair (g, ga, gb, H(gab)) is (computationally) indistinguishable from (g, ga, gb, R), where a, b ∈ Zn, g is a generator of Zn and R is randomly sampled from K.
Not surprisingly, the two assumption is related:
Theorem 10.16. The HDH assumption holds implies the CDH assumption holds.
Proof. Proving the above statement is the same as proving that the CDH assumption does not hold implies the HDH assumption does not hold. This new statement is straightforward as the CDH assumption does not hold indicates there exist some adversary that has a non- negligible probability of finding gab. We can thus use this adversary to construct a new adversary with a non-negligible advantage against the HDH games by simply applying hash to the output of the CDH adversary, and check the result against the hash given by the HDH game challenger.
The idea behind the HDH assumption is that we want the case that even if the adversary has access to the public-keys ga, gb^ and the generator g, the adversary cannot differentiate H(gab) from the uniform random string, which is required for the semantic security of AES encryption used in the El-Gamal encryption protocol. Note that the hash function in the HDH assumption having the property to take in any input of G of arbitrary distribution and give outputs of K in a distribution that is indistinguishable to uniform distribution is called an extractor. With the assumptions defined, we can then briefly show that the El-Gamal encryption is one-time semantic secure based on the HDH assumption.
Theorem 10.17. The El-Gamal Encryption Protocol on a finite cyclic group G and some hash function H is one-time semantic secure if the Hash Diffie-Hellman (HDH) assumption holds for (G, H).
Proof. It is clear that proving one-time semantic security of the El-Gamal encryption pro- tocol is the same as proving that the pair (ga, gb, AES.Enck(m0)) is indistinguishable from (ga, gb, AES.Enck(m1)) for any m 0 , m 1 ∈ M , where M is the message space and k = H(gab). Suppose we have that the HDH assumption is true against (G, H) of the El- Gamal Encryption Protocol, we thus have that (ga, gb, AES.Enck(m0)) is indistinguishable from the pair (ga, gb, AES.EncR(m0)) and (ga, gb, AES.Enck(m1)) is indistinguishable from (ga, gb, AES.EncR(m1)), where R is some random string in key space K. It thus remain for us two show that (ga, gb, AES.EncR(m0)) is indistinguishable from (ga, gb, AES.EncR(m1)), which directly follows from the property of AES.
Having seen the El-Gamal encryption example, let’s move on to another well-known example of public-key encryption, namely the RSA system.
Recall the definition of inverse in a set.
Definition 10.18. Inverse of x ∈ ZN is y ∈ ZN such that (x · y)(modN ) = 1
As a result, an element is invertible if the inverse exists in the set. The following was proven in lecture 8.
Fact 10.19. Let ZN be a set { 0 , 1 , · · · , N − 1 } and N be a product of two primes p, q. Then x ∈ Zn is invertible ⇐⇒ gcd(x, N ) = 1 and the number of invertible elements in ZN , (ZN )∗, is φ(N ) = (p − 1)(q − 1) = N − p − q + 1
Therefore, φ(N ) counts the number of relative primes w.r.t. N in the set. Recall Euler’s theorem:
Theorem 10.20. ∀x ∈ (ZN )∗, xφ(N^ )^ = 1(modN )
Using the above information, we can look at textbook RSA system defined as following:
Definition 10.21. Textbook RSA is composed of three functions:
Why did we pick such e, d? Suppose we have plain-text x and create encrypted message y = RSA Enc(pk, x) = xe. Lets decrypt y using the scheme above.
RSAD ec(pk, xe) = xed^ = xk·φ(N^ )+1, k ∈ Z (10.1)
Notice that last equality in equation 10.1 is true because how e and d were picked.
xk·φ(N^ )+1^ = (xφ(N^ ))k^ · x = (1)k^ · x = 1, k ∈ Z (10.2)
Equation 10.2 uses Euler’s theorem (theorem 10.20) for the second equality. As a result, we get back the x. The encryption and decryption process is deterministic. Do keep in mind that the Textbook RSA is insecure. The generalization of this is called trapdoor permutation.
Definition 10.22. Trapdoor permutation consists of three algorithms (G, F, F −^1 ).
A secure trapdoor permutation is when inversing the F (pk, ·) is hard without the ”trap- door” sk when pk and x are sampled at random.
Definition 10.23. RSA Assumption: for all efficient adversary A, P r[A(N, e, y) = y (^1) e ] < where is negligible, p, q are randomly sampled n-bit primes, N = p · q, y ∈ Z∗ N is the encrypted message.