Transcript
Page 1: Special Topics in Cryptographymohammad/courses/crypto/sp18/slides/Class … · Diffie Hellman Key Agreement β€’Public parameters: large prime a (multiplicative) generator 𝑔for

Special Topics in Cryptography

Mohammad Mahmoody

Page 2: Special Topics in Cryptographymohammad/courses/crypto/sp18/slides/Class … · Diffie Hellman Key Agreement β€’Public parameters: large prime a (multiplicative) generator 𝑔for

Last time

β€’ Public-key encryption and key-agreement

β€’ Diffie Hellman (key agreement protocol)

β€’ RSA public key encryption

β€’ Digital signatures

Today

Page 3: Special Topics in Cryptographymohammad/courses/crypto/sp18/slides/Class … · Diffie Hellman Key Agreement β€’Public parameters: large prime a (multiplicative) generator 𝑔for

Public Key Encryption

β€’ Secure communication even without shared secret keys!

Page 4: Special Topics in Cryptographymohammad/courses/crypto/sp18/slides/Class … · Diffie Hellman Key Agreement β€’Public parameters: large prime a (multiplicative) generator 𝑔for

Recalling Public Key Encryption

β€’ Key generation: Gen 1𝑛 β†’ π‘’π‘˜, π‘‘π‘˜

β€’ Encryption: Enc π‘’π‘˜,π‘š β†’ 𝑐

β€’ Decryption: Dec π‘‘π‘˜, 𝑐 = π‘šβ€²

β€’ Completeness: decrypting correction π‘š = π‘šβ€²

β€’ Security: same as CPA security for private-key, but the adversary does not need any encryption oracle: it has the encryption key itself!

Page 5: Special Topics in Cryptographymohammad/courses/crypto/sp18/slides/Class … · Diffie Hellman Key Agreement β€’Public parameters: large prime a (multiplicative) generator 𝑔for

Recalling Key Agreement

β€’ Interactive protocol between randomized Alice and Bob

β€’ The sequence of messages 𝑇 = (𝑑1, 𝑑2, … π‘‘π‘š) is called β€œtranscript”

β€’ At the end, Alice and Bob output key π‘˜π΄, π‘˜π΅

β€’ Completeness: getting same keys π‘˜π΄ = π‘˜π‘ = π‘˜π‘’π‘¦

β€’ Security: suppose |π‘˜π‘’π‘¦| = 𝑛, then(𝑇, π‘˜π‘’π‘¦) is computationally indistinguishable from 𝑇, π‘ˆπ‘›Namely, even if 𝑇 is known, π‘˜π‘’π‘¦ is indistinguishable from uniform π‘ˆπ‘›

Page 6: Special Topics in Cryptographymohammad/courses/crypto/sp18/slides/Class … · Diffie Hellman Key Agreement β€’Public parameters: large prime a (multiplicative) generator 𝑔for

Diffie Hellman Key Agreement

β€’ Public parameters: large prime π‘ž a (multiplicative) generator 𝑔 for 𝒁𝒒

1. Alice picks π‘₯ ← {1,… π‘ž βˆ’ 1} and Bob picks 𝑦 ← 1,β€¦π‘ž βˆ’ 1 at random

2. Alice sends π‘Ž = 𝑔π‘₯ to Bob and Bob sends 𝑏 = 𝑔𝑦 to Alice.

3. Alice takes 𝑏π‘₯ = 𝑔π‘₯𝑦 = π‘˜ and Bob takes π‘Žπ‘¦ = 𝑔π‘₯𝑦 = π‘˜ as the key.

β€’ To implement in efficiently, we use β€œfast exponentiation” algorithm that computes π‘Žπ‘¦ mod π‘ž in time polynomial in lengths of π‘ž, 𝑦, π‘Ž

Page 7: Special Topics in Cryptographymohammad/courses/crypto/sp18/slides/Class … · Diffie Hellman Key Agreement β€’Public parameters: large prime a (multiplicative) generator 𝑔for

RSA Public-Key Encryption

Page 8: Special Topics in Cryptographymohammad/courses/crypto/sp18/slides/Class … · Diffie Hellman Key Agreement β€’Public parameters: large prime a (multiplicative) generator 𝑔for

Main Idea of RSA: Trapdoor Permutations

β€’ Intuition: Permutation πœ‹ ∢ 0,…𝑁 βˆ’ 1 β†’ 0,…𝑁 βˆ’ 11. Easy to compute πœ‹ publically2. Easy to β€œinvert” πœ‹ only if have the trapdoor.

β€’ Key generation find: π‘’π‘˜ = πœ‹ and π‘‘π‘˜ = 𝜎 for permutations πœ‹, 𝜎 such that :1. for all π‘₯ ∈ 0,…𝑁 βˆ’ 1 : 𝜎 πœ‹ π‘₯ = π‘₯ namely 𝜎(β‹…) = πœ‹βˆ’1(β‹…)2. Given πœ‹(π‘₯) it is β€œhard” to invert it to find π‘₯. Formally, for all poly-time 𝐴

Prπ‘₯← 0,β€¦π‘βˆ’1

𝐴 πœ‹ π‘₯ = π‘₯ ≀ negl(𝑛) where 𝑛 β‰ˆ log(𝑁) is sec parameter

β€’ What is useful intuitively?β€’ Why cannot we use it naively?

Page 9: Special Topics in Cryptographymohammad/courses/crypto/sp18/slides/Class … · Diffie Hellman Key Agreement β€’Public parameters: large prime a (multiplicative) generator 𝑔for

Number Theory 101- (continued)

β€’ gcd 𝑁,𝑀 = greatest common divisor of 𝑀,𝑁

β€’ πœ‘ 𝑁 = 𝑖 1 ≀ 𝑖 ≀ 𝑁, gcd 𝑁, 𝑖 = 1 |

β€’ πœ‘(𝑝) for prime 𝑝 ?

β€’ πœ‘ π‘π‘ž for primes 𝑝, π‘ž ?

β€’ Euler’s theorem: if gcd π‘Ž, 𝑁 = 1 β†’ π‘Žπœ‘(𝑁) = 1 (mod 𝑁)

Page 10: Special Topics in Cryptographymohammad/courses/crypto/sp18/slides/Class … · Diffie Hellman Key Agreement β€’Public parameters: large prime a (multiplicative) generator 𝑔for

RSA Trapdoor Permutation

β€’ Euler’s theorem: if gcd π‘Ž, 𝑁 = 1 β†’ π‘Žπœ‘(𝑁) = 1 (mod 𝑁)

β€’ π‘Žπœ‘(𝑁) β‹… π‘Žπœ‘ 𝑁 β‹… π‘Žπœ‘ 𝑁 … = 1 π‘Ž1+π‘˜β‹…πœ‘(𝑁) = π‘Ž (mod 𝑁)

β€’ If 𝑒 β‹… 𝑑 = 1 + π‘˜ β‹… πœ‘(𝑁) which is the same as 𝑒 β‹… 𝑑 = 1 mod πœ‘ 𝑛 then π‘Žπ‘’ 𝑑 = π‘Ž (mod πœ‘ 𝑁 )

which means πœ‹ π‘₯ = π‘₯𝑒 is inverse of 𝜎 𝑦 = 𝑦𝑑 for gcd π‘₯, 𝑁 = 1

β€’ Interestingly 𝜎 πœ‹ π‘₯ = π‘₯ even for gcd π‘₯, 𝑁 β‰  1

Page 11: Special Topics in Cryptographymohammad/courses/crypto/sp18/slides/Class … · Diffie Hellman Key Agreement β€’Public parameters: large prime a (multiplicative) generator 𝑔for

How to use RSA Trapdoor Permutation for public-key encryption?β€’ Intuition: Permutation πœ‹ ∢ 0, …𝑁 βˆ’ 1 β†’ 0,…𝑁 βˆ’ 1

1. Easy to compute πœ‹ publically

2. Easy to β€œinvert” πœ‹ only if have the trapdoor.

β€’ What is useful intuitively?

β€’ Why cannot we use it naively?

Page 12: Special Topics in Cryptographymohammad/courses/crypto/sp18/slides/Class … · Diffie Hellman Key Agreement β€’Public parameters: large prime a (multiplicative) generator 𝑔for

One β€œcorrect” way to use RSA trapdoor permutation for public key encryption

β€’ Actual Randomized (CPA secure) Encryption of a big 𝑏: Pick π‘Ÿ, 𝑠 ∈ {0, … , 𝑁 βˆ’ 1} at random and output [πœ‹ π‘Ÿ , 𝑠, π‘Ÿ, 𝑠 βŠ• 𝑏]

Page 13: Special Topics in Cryptographymohammad/courses/crypto/sp18/slides/Class … · Diffie Hellman Key Agreement β€’Public parameters: large prime a (multiplicative) generator 𝑔for

More efficient way, using an β€œideal” hash function

β€’ Let β„Ž: 0,1 𝑛 β†’ 0,1 𝑛 be an β€œidea” hash functionβ€’ Key gen: generate a pair π‘’π‘˜ = 𝑔(β‹…), π‘‘π‘˜ = π‘”βˆ’1 (β‹…)

β€’ Encryption of π‘š ∈ 0,1 𝑛: pick π‘Ÿ ← 0,1 𝑛, output 𝑐 = 𝑔 π‘Ÿ , β„Ž π‘Ÿ βŠ•π‘š

β€’ Decryption of 𝑐 = (𝑦, 𝑧) : output π‘š = π‘”βˆ’1 𝑦 βŠ• 𝑧

β€’ Even possible to do it efficiently in a CCA secure way using ideal hashing

Page 14: Special Topics in Cryptographymohammad/courses/crypto/sp18/slides/Class … · Diffie Hellman Key Agreement β€’Public parameters: large prime a (multiplicative) generator 𝑔for

We need prime numbers for RSA and DH !

β€’ We need large prime numbers!

β€’ How many prime numbers are there?

β€’ How can we fine one?

Page 15: Special Topics in Cryptographymohammad/courses/crypto/sp18/slides/Class … · Diffie Hellman Key Agreement β€’Public parameters: large prime a (multiplicative) generator 𝑔for

Public Key Authentication:Digital Signatures

β€’ Secure authentication without shared secret keys!

Page 16: Special Topics in Cryptographymohammad/courses/crypto/sp18/slides/Class … · Diffie Hellman Key Agreement β€’Public parameters: large prime a (multiplicative) generator 𝑔for

Making MACs public key (just like how we moved to public key encryption)

Page 17: Special Topics in Cryptographymohammad/courses/crypto/sp18/slides/Class … · Diffie Hellman Key Agreement β€’Public parameters: large prime a (multiplicative) generator 𝑔for

Defining Digital Signatures

β€’ Alice has a signing key π‘ π‘˜ and a verification key π‘£π‘˜

β€’ Using π‘ π‘˜ Alice can sign π‘š with 𝜎 = Signπ‘ π‘˜(π‘š)

β€’ If Bob verifies Verifπ‘£π‘˜ π‘š, 𝜎 = 1 he can be sure Alice signed π‘š

β€’ Security:

Page 18: Special Topics in Cryptographymohammad/courses/crypto/sp18/slides/Class … · Diffie Hellman Key Agreement β€’Public parameters: large prime a (multiplicative) generator 𝑔for

One possible idea based on TDPs (e.g. RSA)

β€’ Signing key: β€œprivate key” (or the trapdoor)

β€’ Verification key: β€œpublic key” (or the description of the permutation)

β€’ To sign π‘š publish 𝜎 π‘š = 𝑑

β€’ To verify (π‘š, 𝑑) accept if and only if: πœ‹ 𝑑 = π‘š

β€’ Is it secure signature?

Page 19: Special Topics in Cryptographymohammad/courses/crypto/sp18/slides/Class … · Diffie Hellman Key Agreement β€’Public parameters: large prime a (multiplicative) generator 𝑔for

β€œHash and sign” using ideal hash function


Top Related