Docsity

Crytography Private Key Encryption, Lecture Notes - Computer Science, Study notes of Cryptography and System Security

Toggle sidebar
bg1
CS 120/CSCI E-177: Introduction to Cryptography
Salil Vadhan and Alon Rosen Nov. 14, 2006
Lecture Notes 14:
Public-Key Encryption
Recommended Reading.
•
KatzLindell, Sections 9.19.3, 9.5.2, 9.5.4, 8.4.5
1 Setting
•
Can parties communicate privately
without meeting in advance
? One of the drawbacks of
private-key encryption is the exchange of the secret key: the parties have to meet in advance
or use some more secure channel.
•
Classical view: ability to encrypt
≡
ability to decrypt
≡
possession of key
•
DieHellman `76:
public-key encryption
separate encryption & decryption keys
public key
= encryption key, anyone can encrypt since the public key is published in some
public directory
secret key
= decryption key
secret key
7→
public key should be infeasible
We can imagine that there exists a public directory containing everyone's public key:
pk
Alice
,
pk
Bob
,... To send a message
m
to Alice, we get
pk
Alice
from the directory and
send
Epk
Alice
(m)
. The real implementation of the public-key infrastructure requires care.
For instance, how can we be sure that we access the
real
public directory?
•
Denition 1
A
public-key encryption scheme
consists of three polynomial-time algorithms
(G, E, D)
, as follows:
The
key generation
algorithm
G
is a randomized algorithm that takes a security parameter
1n
as input returns a pair
(pk,sk)
, where
pk
is the
public key
and
sk
is the
secret key
;
we write
(pk,sk)
R
←G(1n)
.
The
encryption
algorithm
E
is a
stateless
randomized algorithm that takes the public key
pk
and a
plaintext
(aka
message
)
m
and outputs a ciphertext
c
; we write
c
R
←Epk (m)
.
The
decryption
algorithm
D
is a deterministic algorithm that takes the secret key
sk
and
a ciphertext
c
and returns a plaintext
m=Dsk (c)
.
Associated with the scheme is a
plaintext space
Pn
from which
m
is allowed to be drawn. The
message space is a set, often the set of strings of a given length. We require
Dsk (Epk (m)) = m
for all
m∈ P
and all
(pk,sk)←G(1n)
.
1
pf3
pf4
pf5

Partial preview of the text

Download Crytography Private Key Encryption, Lecture Notes - Computer Science and more Study notes Cryptography and System Security in PDF only on Docsity!

CS 120/CSCI E-177: Introduction to Cryptography

Salil Vadhan and Alon Rosen Nov. 14, 2006

Lecture Notes 14:

Public-Key Encryption

Recommended Reading.

  • KatzLindell, Sections 9.19.3, 9.5.2, 9.5.4, 8.4.

1 Setting

  • Can parties communicate privately without meeting in advance? One of the drawbacks of private-key encryption is the exchange of the secret key: the parties have to meet in advance or use some more secure channel.
  • Classical view: ability to encrypt ≡ ability to decrypt ≡ possession of key
  • DieHellman `76: public-key encryption  separate encryption & decryption keys

 public key = encryption key, anyone can encrypt since the public key is published in some public directory  secret key = decryption key  secret key 7 → public key should be infeasible  We can imagine that there exists a public directory containing everyone's public key: pk (^) Alice,pk (^) Bob,... To send a message m to Alice, we get pk (^) Alice from the directory and send Epk (^) Alice (m). The real implementation of the public-key infrastructure requires care. For instance, how can we be sure that we access the real public directory?

  • Denition 1 A public-key encryption scheme consists of three polynomial-time algorithms (G, E, D), as follows:

 The key generation algorithm G is a randomized algorithm that takes a security parameter 1 n^ as input returns a pair (pk , sk ), where pk is the public key and sk is the secret key; we write (pk , sk ) ←R G(1n).  The encryption algorithm E is a stateless randomized algorithm that takes the public key pk and a plaintext (aka message) m and outputs a ciphertext c; we write c ←R Epk (m).  The decryption algorithm D is a deterministic algorithm that takes the secret key sk and a ciphertext c and returns a plaintext m = Dsk (c).

Associated with the scheme is a plaintext space Pn from which m is allowed to be drawn. The message space is a set, often the set of strings of a given length. We require Dsk (Epk (m)) = m for all m ∈ P and all (pk , sk ) ← G(1n).

2 Security

  • All denitions of security in the private-key case extend naturally to public-key case  just provide the adversary with the public key.

Denition 2 (indistinguishability for public-key encryption) Let (G, E, D) be a public- key encryption scheme over P =

n Pn.^ (G, E, D)^ has^ indistinguishable encryptions^ if for every (nonuniform) PPT A, there is a negligible function ε such that for all m 0 , m 1 ∈ Pn such that ‖m 0 ‖ = ‖m 1 ‖,

|Pr [A(1n, pk , Epk (m 0 )) = 1] − Pr [A(1n, pk , Epk (m 1 )) = 1]| ≤ ε(n),

where the probabilities above are taken over (pk , sk ) ←R G(1n), the coin tosses of Epk , and the coin tosses of A.

  • All of the relations we have established between notions of security extend to the public-key case, such as the equivalence of indistinguishability and semantic security. Hence public- key encryptions satisfying the above denition are often referred to as semantically secure encryption schemes in the literature (and in KL).
  • Lemma 3 If public-key encryption scheme (G, E, D) has indistinguishable encryptions in the sense of Denition 1, then it satises indistinguishability under chosen plaintext attack (and hence satises multiple-message indistinguishability).

Proof Sketch: Encryption oracle cannot help adversary, because the adversary can encrypt on its own. 

  • Corollaries:

 No deterministic public-key encryption scheme can be secure.  No public-key encryption scheme can be perfectly (or even statistically) secure.

3 Trapdoor Permutations

Denition 4 F = {fk : Dk → Dk}k∈K is a collection of trapdoor permutations if each fk is a permutation and:

  1. There is a PPT G(1n) that outputs a pair (k, t), where k ∈ K is the (public) key (or index) and t is the trapdoor.
  2. Given k, one can sample uniformly from Dk in polynomial time.
  3. Given k and x ∈ Dk, one can evaluate fk(x) in polynomial time.
  4. For every (nonuniform) PPT A, there is a negligible function ε such that

Pr

[

A(1n, K, fK (X)) ∈ f (^) K− 1 (fK (X))

]

≤ ε(n) ∀n

where the probability is taken over (K, T ) ←R G(1n), X ←R DK , and the coin tosses of A.

A more ecient construction

  • Randomly select fk with trapdoor t.
  • pk = k, sk = t.
  • Epk (m) for m ∈ { 0 , 1 }`:
    1. Choose x ←R Dk.
    2. Compute Gk,(x) = bk(x)bk(fk(x))bk(fk(fk(x))) · · · bk(f (^) k− 1 (x)).
    3. Output

f (^) k(x), Gk,(x) ⊕ m

This construction is not more ecient in terms of computation because we still have to evaluate fk for each bit of the message but it is more ecient in terms of communication since the ciphertext is shorter.

Theorem 6 Above public-key encryption scheme is secure if {fk} is a collection of trapdoor per- mutations with hardcore bits {bk}.

Proof Sketch: (K, f (^) K(X), GK,(X)) c ≡ (K, f (^) K(X), GK,(X)). cf. construction of a PRG that stretches by an arbitrary polynomial. 

Blum-Goldwasser Encryption

This encryption scheme uses Rabin's functions: p, and q are n-bit primes, such that p ≡ q ≡ 3 mod 4 and N = pq. The public key is pk = N and the secret key is sk = {p, q}. Encryption Epk (m):

  • Choose x ←R QRN.
  • Let r = lsb(x)lsb(x^2 ) · · · lsb(x^2 − 1 mod N ) where = ‖m |.
  • Output (x^2 ` mod N, r ⊕ m).

Decryption: given the factorization of N , how do we compute x from x^2 ` mod N eciently?

5 Schemes Based on Discrete Log

  • Key Exchange: get rid of public directory, agree on key on the y.
  • DieHellman Key Exchange:

 Prime p, generator g xed.  Alice chooses x ←R Zp− 1 , sends gx^ to Bob.  Bob chooses y ←R Zp− 1 , sends gy^ to Alice.  Both can compute the DieHellman Key k = gxy.

  • Security of DH Key Exchange:

 Can be broken if discrete log problem easy, but seems to require Computational Die Hellman assumption: given p, g, gx, gy, hard to compute gxy^ (with nonnegligible proba- bility).  If Alice & Bob want to use gxy^ as a key, actually need Decisional DieHellman assump- tion: (P, G, GX^ , GY^ , GXY^ ) computationally indistinguishable from (P, G, GX^ , GY^ , GZ^ ), where Z is chosen randomly independently form X and Y. (not quite true as stated, should take g to be a random generator of large subgroup of Z∗ p of prime size, e.g. of QRp if p = 2q + 1 for prime q. See KL Ÿ8.4.5.)  DH Key Exchange insecure against active adversary: person-in-the-middle attack.  Properly dening security of key exchange vs. active adversaries very subtle!

  • Variants of DH Key Exchange used in practice, e.g. cell phones.
  • El Gamal Public-Key Encryption Scheme:

 Replace interaction in DH Key Exchange with public directory.  Secret Key: (p, g, x), Public Key: (p, g, xˆ), where xˆ = gx^ mod p.  E(m) (for m ∈ Z∗ p):

  1. Choose y ←R Zp− 1
  2. Compute ˆy = gy^ mod p.
  3. Compute w = ˆxy^ · m mod p. (like using ˆxy^ = gxy^ as a one-time pad)
  4. Output (ˆy, w).  Secure under Decisional DieHellman Assumption (with same caveats as above; see KL)
  • Cramer-Shoup encryption scheme: strengthened form of El Gamal with security against chosen-ciphertext attack (and eciency within a small constant factor)
  • DH Key Exchange, El Gamal make sense using any cyclic group in which discrete logs are hard (e.g. also elliptic curves).
  • There are other public-key encryption schemes based on: lattices, knapsack problem (related to subset sum), error-correcting codes... (some proven based on complexity assumptions, some not).