Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to...

166
Introduction Mathematical background Diffie-Hellman Key Exchange Digital Signature Public-Key Encryption Schemes Conclusion Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer Sciences National Institute of Science Education and Research (NISER), HBNI Bhubaneswar, India

Transcript of Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to...

Page 1: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction to Public-Key Cryptography

Sabyasachi Karati

Assistant ProfessorSchool of Computer Sciences

National Institute of Science Education and Research (NISER), HBNIBhubaneswar, India

Page 2: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Outline for section 1

1 Introduction

2 Mathematical background

3 Diffie-Hellman Key Exchange

4 Digital SignatureRSA Digital SignatureElGamal Digital SignatureDSA Digital Signature

5 Public-Key Encryption SchemesRSA Public-Key Encryption SchemeElGamal Public-Key Encryption Scheme

6 Conclusion

Page 3: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction

c1

c2

c1 = AES Encryption(m1, k) m1 = AES Decryption(c1, k)

m2 = AES Decryption(c2, k) c2 = AES Encryption(m2, k)

Alice Bob

Cipher textPlain text

Key

Cipher text

m1

m2

m1

m2

Figure: Secure Communication

Page 4: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction

Problem 1

Page 5: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction

c1

c2

c1 = AES Encryption(m1, k1) ? = AES Decryption(c1, ?)

? = AES Decryption(c2, ?) c2 = AES Encryption(m2, k2)

Alice Bob

m1

m2

?

?

Page 6: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction

c1

c2

c1 = AES Encryption(m1, k1) ? = AES Decryption(c1, ?)

? = AES Decryption(c2, ?) c2 = AES Encryption(m2, k2)

Alice Bob

Solution: Diffie-Hellm

an KeyExchange

m1

m2

?

?

Page 7: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction

Problem 2

Page 8: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction

c

c = AES Encryption(m, k) m = AES Decryption(c, k)

Alice Bob

m m

Page 9: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction

c

c = AES Encrypttion(m, k) m = AES Decryption(c, k)

? Bob

m m Is this message

really from Alice?

Page 10: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction

Case 1:

c

c = AES Encrypttion(m, k) m′ = AES Decryption(c′, k)

Alice Bob

Electrical sparks Transmission Problem

Adversary c′

m m′

Page 11: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction

c

c = AES Encrypttion(m, k) m′ = AES Decryption(c′, k)

Alice Bob

Electrical sparks Transmission Problem

Adversary c′

m m′Integrity P

roblem

Page 12: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction

Case 2:

c

c = AES Encrypttion(m, k) m = AES Decryption(c, k)

Malice Bob

m m

Authe

nticat

ionProblem

Page 13: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction

c

c = AES Encrypttion(m, k) m′ = AES Decryption(c′, k)

Malice Bob

Electrical sparks Transmission Problem

Adversary c′

m m′

Solution: D

igital Signature

Page 14: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction

Problem 3

Page 15: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction

How to achieve privacy?

Answer: Symmetric-Key Encryption Scheme

Yesterday’s Lecture by Dr. Rishiraj Bhattacharyya

Is there any alternative?

Answer: Public-Key Encryption Scheme

Page 16: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction

How to achieve privacy?

Answer: Symmetric-Key Encryption Scheme

Yesterday’s Lecture by Dr. Rishiraj Bhattacharyya

Is there any alternative?

Answer: Public-Key Encryption Scheme

Page 17: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction

How to achieve privacy?

Answer: Symmetric-Key Encryption Scheme

Yesterday’s Lecture by Dr. Rishiraj Bhattacharyya

Is there any alternative?

Answer: Public-Key Encryption Scheme

Page 18: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction

How to achieve privacy?

Answer: Symmetric-Key Encryption Scheme

Yesterday’s Lecture by Dr. Rishiraj Bhattacharyya

Is there any alternative?

Answer: Public-Key Encryption Scheme

Page 19: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction

In Public-Key Cryptosystem, each user has two types of keysSecret Key: Only known to the userPublic Key: known to each and every user

AdvantageLet the number of user be nIn Public-Key cryptosystem, total number of keys is 2n =O(n)In Symmetric-Key cryptosystem, total number of keys is n(n−1)/2 =O(n2)

DisadvantagePublic-Key cryptosystem is significantly slower than Symmetric-Key cryptosystem

Page 20: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction

In Public-Key Cryptosystem, each user has two types of keysSecret Key: Only known to the userPublic Key: known to each and every user

AdvantageLet the number of user be nIn Public-Key cryptosystem, total number of keys is 2n =O(n)In Symmetric-Key cryptosystem, total number of keys is n(n−1)/2 =O(n2)

DisadvantagePublic-Key cryptosystem is significantly slower than Symmetric-Key cryptosystem

Page 21: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction

In Public-Key Cryptosystem, each user has two types of keysSecret Key: Only known to the userPublic Key: known to each and every user

AdvantageLet the number of user be nIn Public-Key cryptosystem, total number of keys is 2n =O(n)In Symmetric-Key cryptosystem, total number of keys is n(n−1)/2 =O(n2)

DisadvantagePublic-Key cryptosystem is significantly slower than Symmetric-Key cryptosystem

Page 22: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction

1. Mathematical background

2. Diffie-Hellman Key Exchange3. Digital Signature

3.1 RSA Digital Signature3.2 ElGamal Digital Signature3.3 DSA Digital Signature

4. Public-Key Encryption Schemes4.1 RSA Public-Key Encryption Scheme4.2 ElGamal Public-Key Encryption Scheme

5. Conclusion

Page 23: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction

1. Mathematical background

2. Diffie-Hellman Key Exchange

3. Digital Signature3.1 RSA Digital Signature3.2 ElGamal Digital Signature3.3 DSA Digital Signature

4. Public-Key Encryption Schemes4.1 RSA Public-Key Encryption Scheme4.2 ElGamal Public-Key Encryption Scheme

5. Conclusion

Page 24: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction

1. Mathematical background

2. Diffie-Hellman Key Exchange3. Digital Signature

3.1 RSA Digital Signature3.2 ElGamal Digital Signature3.3 DSA Digital Signature

4. Public-Key Encryption Schemes4.1 RSA Public-Key Encryption Scheme4.2 ElGamal Public-Key Encryption Scheme

5. Conclusion

Page 25: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction

1. Mathematical background

2. Diffie-Hellman Key Exchange3. Digital Signature

3.1 RSA Digital Signature3.2 ElGamal Digital Signature3.3 DSA Digital Signature

4. Public-Key Encryption Schemes4.1 RSA Public-Key Encryption Scheme4.2 ElGamal Public-Key Encryption Scheme

5. Conclusion

Page 26: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction

1. Mathematical background

2. Diffie-Hellman Key Exchange3. Digital Signature

3.1 RSA Digital Signature3.2 ElGamal Digital Signature3.3 DSA Digital Signature

4. Public-Key Encryption Schemes

4.1 RSA Public-Key Encryption Scheme4.2 ElGamal Public-Key Encryption Scheme

5. Conclusion

Page 27: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Introduction

1. Mathematical background

2. Diffie-Hellman Key Exchange3. Digital Signature

3.1 RSA Digital Signature3.2 ElGamal Digital Signature3.3 DSA Digital Signature

4. Public-Key Encryption Schemes4.1 RSA Public-Key Encryption Scheme4.2 ElGamal Public-Key Encryption Scheme

5. Conclusion

Page 28: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Outline for section 2

1 Introduction

2 Mathematical background

3 Diffie-Hellman Key Exchange

4 Digital SignatureRSA Digital SignatureElGamal Digital SignatureDSA Digital Signature

5 Public-Key Encryption SchemesRSA Public-Key Encryption SchemeElGamal Public-Key Encryption Scheme

6 Conclusion

Page 29: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Notation

N Set of Natural Numbers {1,2,3, . . .}

Z Set of Integers {. . .,−3,−2,−1,0,1,2,3, . . .}Z+ Set of Positive Integers {0,1,2,3, . . .}P Set of (positive) Prime numbers {2,3,5, . . .}Q Set of Rational numbers

{ab | a ∈ Z and b ∈ N

}

Q+ Set of Positive Rational numbersR Set of Real numbersR+ Set of Positive Real numbers

N ⊂ Z ⊂ Q ⊂ R

Page 30: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Notation

N Set of Natural Numbers {1,2,3, . . .}Z Set of Integers {. . .,−3,−2,−1,0,1,2,3, . . .}

Z+ Set of Positive Integers {0,1,2,3, . . .}P Set of (positive) Prime numbers {2,3,5, . . .}Q Set of Rational numbers

{ab | a ∈ Z and b ∈ N

}

Q+ Set of Positive Rational numbersR Set of Real numbersR+ Set of Positive Real numbers

N ⊂ Z ⊂ Q ⊂ R

Page 31: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Notation

N Set of Natural Numbers {1,2,3, . . .}Z Set of Integers {. . .,−3,−2,−1,0,1,2,3, . . .}Z+ Set of Positive Integers {0,1,2,3, . . .}

P Set of (positive) Prime numbers {2,3,5, . . .}Q Set of Rational numbers

{ab | a ∈ Z and b ∈ N

}

Q+ Set of Positive Rational numbersR Set of Real numbersR+ Set of Positive Real numbers

N ⊂ Z ⊂ Q ⊂ R

Page 32: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Notation

N Set of Natural Numbers {1,2,3, . . .}Z Set of Integers {. . .,−3,−2,−1,0,1,2,3, . . .}Z+ Set of Positive Integers {0,1,2,3, . . .}P Set of (positive) Prime numbers {2,3,5, . . .}

Q Set of Rational numbers{ab | a ∈ Z and b ∈ N

}

Q+ Set of Positive Rational numbersR Set of Real numbersR+ Set of Positive Real numbers

N ⊂ Z ⊂ Q ⊂ R

Page 33: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Notation

N Set of Natural Numbers {1,2,3, . . .}Z Set of Integers {. . .,−3,−2,−1,0,1,2,3, . . .}Z+ Set of Positive Integers {0,1,2,3, . . .}P Set of (positive) Prime numbers {2,3,5, . . .}Q Set of Rational numbers

{ab | a ∈ Z and b ∈ N

}

Q+ Set of Positive Rational numbersR Set of Real numbersR+ Set of Positive Real numbers

N ⊂ Z ⊂ Q ⊂ R

Page 34: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Notation

N Set of Natural Numbers {1,2,3, . . .}Z Set of Integers {. . .,−3,−2,−1,0,1,2,3, . . .}Z+ Set of Positive Integers {0,1,2,3, . . .}P Set of (positive) Prime numbers {2,3,5, . . .}Q Set of Rational numbers

{ab | a ∈ Z and b ∈ N

}

Q+ Set of Positive Rational numbers

R Set of Real numbersR+ Set of Positive Real numbers

N ⊂ Z ⊂ Q ⊂ R

Page 35: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Notation

N Set of Natural Numbers {1,2,3, . . .}Z Set of Integers {. . .,−3,−2,−1,0,1,2,3, . . .}Z+ Set of Positive Integers {0,1,2,3, . . .}P Set of (positive) Prime numbers {2,3,5, . . .}Q Set of Rational numbers

{ab | a ∈ Z and b ∈ N

}

Q+ Set of Positive Rational numbersR Set of Real numbers

R+ Set of Positive Real numbers

N ⊂ Z ⊂ Q ⊂ R

Page 36: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Notation

N Set of Natural Numbers {1,2,3, . . .}Z Set of Integers {. . .,−3,−2,−1,0,1,2,3, . . .}Z+ Set of Positive Integers {0,1,2,3, . . .}P Set of (positive) Prime numbers {2,3,5, . . .}Q Set of Rational numbers

{ab | a ∈ Z and b ∈ N

}

Q+ Set of Positive Rational numbersR Set of Real numbersR+ Set of Positive Real numbers

N ⊂ Z ⊂ Q ⊂ R

Page 37: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Notation

N Set of Natural Numbers {1,2,3, . . .}Z Set of Integers {. . .,−3,−2,−1,0,1,2,3, . . .}Z+ Set of Positive Integers {0,1,2,3, . . .}P Set of (positive) Prime numbers {2,3,5, . . .}Q Set of Rational numbers

{ab | a ∈ Z and b ∈ N

}

Q+ Set of Positive Rational numbersR Set of Real numbersR+ Set of Positive Real numbers

N ⊂ Z ⊂ Q ⊂ R

Page 38: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Euclidean Division Theorem

Greek mathematician and philosopher Euclid (ca. 325–265 BC).

Division Theorem

For an integer a and an integer b , 0, there exist unique integers q and r such that

a = qb+ r

with 0 6 r < | b |.

q is called quotient and r is remainder

Notation: q = a quot b and r = a rem b

If r = 0, then b | a

Examples

a = 10 and b = 4, then 10 = 2×4+2a = −10 and b = 4, then −10 = −3×4+2a = 10 and b = 5, then 5 | 10

Page 39: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Euclidean Division Theorem

Greek mathematician and philosopher Euclid (ca. 325–265 BC).

Division Theorem

For an integer a and an integer b , 0, there exist unique integers q and r such that

a = qb+ r

with 0 6 r < | b |.

q is called quotient and r is remainder

Notation: q = a quot b and r = a rem b

If r = 0, then b | a

Examples

a = 10 and b = 4, then 10 = 2×4+2a = −10 and b = 4, then −10 = −3×4+2a = 10 and b = 5, then 5 | 10

Page 40: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Euclidean Division Theorem

Greek mathematician and philosopher Euclid (ca. 325–265 BC).

Division Theorem

For an integer a and an integer b , 0, there exist unique integers q and r such that

a = qb+ r

with 0 6 r < | b |.

q is called quotient and r is remainder

Notation: q = a quot b and r = a rem b

If r = 0, then b | a

Examples

a = 10 and b = 4, then 10 = 2×4+2a = −10 and b = 4, then −10 = −3×4+2a = 10 and b = 5, then 5 | 10

Page 41: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Greatest Common Divisor (gcd)

gcd(a,b) = d

Let a and b be two non-zero integers. The largest positive integer d that dividesboth a and b is called the greatest common divisor or the gcd of a and b.

gcd(a,b) = d.

gcd(a,b) = gcd(b,a).

For a , 0, gcd(a,0) =| a |.

gcd(0,0) is undefined.

Bezout Relation

For a,b ∈ Z, not both zero, ∃ u,v ∈ Z such that gcd(a,b) = ua+ vb.

Coprime

Two integers a, b are called coprime or relatively prime if gcd(a,b) = 1.

Examples

gcd(15,20) = gcd(20,15) = 5gcd(6,35) = 1

Page 42: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Greatest Common Divisor (gcd)

gcd(a,b) = d

Let a and b be two non-zero integers. The largest positive integer d that dividesboth a and b is called the greatest common divisor or the gcd of a and b.

gcd(a,b) = d.

gcd(a,b) = gcd(b,a).

For a , 0, gcd(a,0) =| a |.

gcd(0,0) is undefined.

Bezout Relation

For a,b ∈ Z, not both zero, ∃ u,v ∈ Z such that gcd(a,b) = ua+ vb.

Coprime

Two integers a, b are called coprime or relatively prime if gcd(a,b) = 1.

Examples

gcd(15,20) = gcd(20,15) = 5gcd(6,35) = 1

Page 43: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Greatest Common Divisor (gcd)

gcd(a,b) = d

Let a and b be two non-zero integers. The largest positive integer d that dividesboth a and b is called the greatest common divisor or the gcd of a and b.

gcd(a,b) = d.

gcd(a,b) = gcd(b,a).

For a , 0, gcd(a,0) =| a |.

gcd(0,0) is undefined.

Bezout Relation

For a,b ∈ Z, not both zero, ∃ u,v ∈ Z such that gcd(a,b) = ua+ vb.

Coprime

Two integers a, b are called coprime or relatively prime if gcd(a,b) = 1.

Examples

gcd(15,20) = gcd(20,15) = 5gcd(6,35) = 1

Page 44: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Greatest Common Divisor (gcd)

gcd(a,b) = d

Let a and b be two non-zero integers. The largest positive integer d that dividesboth a and b is called the greatest common divisor or the gcd of a and b.

gcd(a,b) = d.

gcd(a,b) = gcd(b,a).

For a , 0, gcd(a,0) =| a |.

gcd(0,0) is undefined.

Bezout Relation

For a,b ∈ Z, not both zero, ∃ u,v ∈ Z such that gcd(a,b) = ua+ vb.

Coprime

Two integers a, b are called coprime or relatively prime if gcd(a,b) = 1.

Examples

gcd(15,20) = gcd(20,15) = 5gcd(6,35) = 1

Page 45: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

(Positive) Prime numbers (P)

Prime

Let p be a positive integer and p , 0,1. We say p is prime if a - p for all 1 < a < p.Otherwise, p is a positive composite number.

Alternative Definition

Let p be a positive integer and p , 0,1. We say p is prime if p is coprime to all otherintegers which are not multiples of p.

Examples

7 is a prime number

6 is a composite as 6 = 2×3

Page 46: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

(Positive) Prime numbers (P)

Prime

Let p be a positive integer and p , 0,1. We say p is prime if a - p for all 1 < a < p.Otherwise, p is a positive composite number.

Alternative Definition

Let p be a positive integer and p , 0,1. We say p is prime if p is coprime to all otherintegers which are not multiples of p.

Examples

7 is a prime number

6 is a composite as 6 = 2×3

Page 47: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

(Positive) Prime numbers (P)

Prime

Let p be a positive integer and p , 0,1. We say p is prime if a - p for all 1 < a < p.Otherwise, p is a positive composite number.

Alternative Definition

Let p be a positive integer and p , 0,1. We say p is prime if p is coprime to all otherintegers which are not multiples of p.

Examples

7 is a prime number

6 is a composite as 6 = 2×3

Page 48: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Congruence and Modular Arithmetic

Congruence

Let m ∈ N. Two integers a,b ∈ Z are called congruent modulo m, denoted a ≡ bmod m, if m | (a− b) or, equivalently, if a rem m = b rem m. In this case, m is calledthe modulus of the congruence.

a ≡ b mod m⇔ m | (a− b)⇔ a rem m = b rem m

Examples

a = 10, b = 4, m = 3, then 10 ≡ 4 mod 33 | (10−4)

10 rem 3 = 4 rem 3 = 1

Page 49: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Congruence and Modular Arithmetic

Congruence

Let m ∈ N. Two integers a,b ∈ Z are called congruent modulo m, denoted a ≡ bmod m, if m | (a− b) or, equivalently, if a rem m = b rem m. In this case, m is calledthe modulus of the congruence.

a ≡ b mod m⇔ m | (a− b)⇔ a rem m = b rem m

Examples

a = 10, b = 4, m = 3, then 10 ≡ 4 mod 3

3 | (10−4)

10 rem 3 = 4 rem 3 = 1

Page 50: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Congruence and Modular Arithmetic

Congruence

Let m ∈ N. Two integers a,b ∈ Z are called congruent modulo m, denoted a ≡ bmod m, if m | (a− b) or, equivalently, if a rem m = b rem m. In this case, m is calledthe modulus of the congruence.

a ≡ b mod m⇔ m | (a− b)⇔ a rem m = b rem m

Examples

a = 10, b = 4, m = 3, then 10 ≡ 4 mod 33 | (10−4)

10 rem 3 = 4 rem 3 = 1

Page 51: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Congruence and Modular Arithmetic

Congruence

Let m ∈ N. Two integers a,b ∈ Z are called congruent modulo m, denoted a ≡ bmod m, if m | (a− b) or, equivalently, if a rem m = b rem m. In this case, m is calledthe modulus of the congruence.

a ≡ b mod m⇔ m | (a− b)⇔ a rem m = b rem m

Examples

a = 10, b = 4, m = 3, then 10 ≡ 4 mod 33 | (10−4)

10 rem 3 = 4 rem 3 = 1

Page 52: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Congruence and Modular Arithmetic

Let a,b,c,d ∈ Z and m ∈ N.

a ≡ a mod m.

If a ≡ b mod m, then b ≡ a mod m.

If a ≡ b mod m and b ≡ c mod m, then a ≡ c mod m.If a ≡ c mod m and b ≡ d mod m, then

a+b ≡ c+d mod ma−b ≡ c−d mod mab ≡ cd mod m

Page 53: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Arithmetic of Zm

Representation

Let m ∈ N, then Zm is represented as

Zm = {0,1,2, . . .,m−1}.

Examples

For m = 15,Z15 = {0,1,2, . . .,14}

Addition on Zm

a+ b ={

a+ b if a+ b < ma+ b−m if a+ b > m

Examples

Let m = 15.

If a = 7 and b = 4, then a+ b = 7+4 = 11 mod 15If a = 11 and b = 13, then a+ b = 11+13−15 = 9 mod 15

Page 54: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Arithmetic of Zm

Representation

Let m ∈ N, then Zm is represented as

Zm = {0,1,2, . . .,m−1}.

Examples

For m = 15,Z15 = {0,1,2, . . .,14}

Addition on Zm

a+ b ={

a+ b if a+ b < ma+ b−m if a+ b > m

Examples

Let m = 15.

If a = 7 and b = 4, then a+ b = 7+4 = 11 mod 15If a = 11 and b = 13, then a+ b = 11+13−15 = 9 mod 15

Page 55: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Arithmetic of Zm

Representation

Let m ∈ N, then Zm is represented as

Zm = {0,1,2, . . .,m−1}.

Examples

For m = 15,Z15 = {0,1,2, . . .,14}

Addition on Zm

a+ b ={

a+ b if a+ b < ma+ b−m if a+ b > m

Examples

Let m = 15.

If a = 7 and b = 4, then a+ b = 7+4 = 11 mod 15If a = 11 and b = 13, then a+ b = 11+13−15 = 9 mod 15

Page 56: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Arithmetic of Zm

Representation

Let m ∈ N, then Zm is represented as

Zm = {0,1,2, . . .,m−1}.

Examples

For m = 15,Z15 = {0,1,2, . . .,14}

Addition on Zm

a+ b ={

a+ b if a+ b < ma+ b−m if a+ b > m

Examples

Let m = 15.

If a = 7 and b = 4, then a+ b = 7+4 = 11 mod 15If a = 11 and b = 13, then a+ b = 11+13−15 = 9 mod 15

Page 57: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Arithmetic of Zm

Subtraction on Zm

a− b ={

a− b if a > ba− b+m if a < b

Examples

Let m = 15.

If a = 7 and b = 4, then a− b = 7−4 = 3 mod 15If a = 11 and b = 13, then a+ b = 11−13+15 = 13 mod 15

Multiplication on Zm

a · b = (ab) rem m

Examples

Let m = 15.

If a = 7 and b = 4, then ab = (7×4) rem 15 = 28 mod 15 = 13

Page 58: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Arithmetic of Zm

Subtraction on Zm

a− b ={

a− b if a > ba− b+m if a < b

Examples

Let m = 15.

If a = 7 and b = 4, then a− b = 7−4 = 3 mod 15If a = 11 and b = 13, then a+ b = 11−13+15 = 13 mod 15

Multiplication on Zm

a · b = (ab) rem m

Examples

Let m = 15.

If a = 7 and b = 4, then ab = (7×4) rem 15 = 28 mod 15 = 13

Page 59: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Arithmetic of Zm

Subtraction on Zm

a− b ={

a− b if a > ba− b+m if a < b

Examples

Let m = 15.

If a = 7 and b = 4, then a− b = 7−4 = 3 mod 15If a = 11 and b = 13, then a+ b = 11−13+15 = 13 mod 15

Multiplication on Zm

a · b = (ab) rem m

Examples

Let m = 15.

If a = 7 and b = 4, then ab = (7×4) rem 15 = 28 mod 15 = 13

Page 60: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Arithmetic of Zm

Subtraction on Zm

a− b ={

a− b if a > ba− b+m if a < b

Examples

Let m = 15.

If a = 7 and b = 4, then a− b = 7−4 = 3 mod 15If a = 11 and b = 13, then a+ b = 11−13+15 = 13 mod 15

Multiplication on Zm

a · b = (ab) rem m

Examples

Let m = 15.

If a = 7 and b = 4, then ab = (7×4) rem 15 = 28 mod 15 = 13

Page 61: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Arithmetic of Zm

Identity

An element e ∈ Zm is said to beAdditive identity : a+ e1 ≡ e1 + a ≡ a mod m, for all a ∈ Zm

Multiplicative identity : ae2 ≡ e2a ≡ a mod m, for all a ∈ Zm0 ∈ Zm is additive identity.

1 ∈ Zm is multiplicative identity.

Invertible

An element a ∈ Zm is said to be invertible modulo m if there exists an integeru ∈ Zm such that ua ≡ 1 mod m. u is called inverse of a denoted as a−1.

Examples

Let m = 15.

a = 7 is invertible as 7×13 ≡ 1 mod 15a = 6 is not invertible.

Theorem

An element a ∈ Zm is invertible if and only if gcd(a,m) = 1.

Page 62: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Arithmetic of Zm

Identity

An element e ∈ Zm is said to beAdditive identity : a+ e1 ≡ e1 + a ≡ a mod m, for all a ∈ Zm

Multiplicative identity : ae2 ≡ e2a ≡ a mod m, for all a ∈ Zm

0 ∈ Zm is additive identity.

1 ∈ Zm is multiplicative identity.

Invertible

An element a ∈ Zm is said to be invertible modulo m if there exists an integeru ∈ Zm such that ua ≡ 1 mod m. u is called inverse of a denoted as a−1.

Examples

Let m = 15.

a = 7 is invertible as 7×13 ≡ 1 mod 15a = 6 is not invertible.

Theorem

An element a ∈ Zm is invertible if and only if gcd(a,m) = 1.

Page 63: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Arithmetic of Zm

Identity

An element e ∈ Zm is said to beAdditive identity : a+ e1 ≡ e1 + a ≡ a mod m, for all a ∈ Zm

Multiplicative identity : ae2 ≡ e2a ≡ a mod m, for all a ∈ Zm0 ∈ Zm is additive identity.

1 ∈ Zm is multiplicative identity.

Invertible

An element a ∈ Zm is said to be invertible modulo m if there exists an integeru ∈ Zm such that ua ≡ 1 mod m. u is called inverse of a denoted as a−1.

Examples

Let m = 15.

a = 7 is invertible as 7×13 ≡ 1 mod 15a = 6 is not invertible.

Theorem

An element a ∈ Zm is invertible if and only if gcd(a,m) = 1.

Page 64: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Arithmetic of Zm

Identity

An element e ∈ Zm is said to beAdditive identity : a+ e1 ≡ e1 + a ≡ a mod m, for all a ∈ Zm

Multiplicative identity : ae2 ≡ e2a ≡ a mod m, for all a ∈ Zm0 ∈ Zm is additive identity.

1 ∈ Zm is multiplicative identity.

Invertible

An element a ∈ Zm is said to be invertible modulo m if there exists an integeru ∈ Zm such that ua ≡ 1 mod m. u is called inverse of a denoted as a−1.

Examples

Let m = 15.

a = 7 is invertible as 7×13 ≡ 1 mod 15a = 6 is not invertible.

Theorem

An element a ∈ Zm is invertible if and only if gcd(a,m) = 1.

Page 65: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Arithmetic of Zm

Identity

An element e ∈ Zm is said to beAdditive identity : a+ e1 ≡ e1 + a ≡ a mod m, for all a ∈ Zm

Multiplicative identity : ae2 ≡ e2a ≡ a mod m, for all a ∈ Zm0 ∈ Zm is additive identity.

1 ∈ Zm is multiplicative identity.

Invertible

An element a ∈ Zm is said to be invertible modulo m if there exists an integeru ∈ Zm such that ua ≡ 1 mod m. u is called inverse of a denoted as a−1.

Examples

Let m = 15.

a = 7 is invertible as 7×13 ≡ 1 mod 15a = 6 is not invertible.

Theorem

An element a ∈ Zm is invertible if and only if gcd(a,m) = 1.

Page 66: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Arithmetic of Zm

Identity

An element e ∈ Zm is said to beAdditive identity : a+ e1 ≡ e1 + a ≡ a mod m, for all a ∈ Zm

Multiplicative identity : ae2 ≡ e2a ≡ a mod m, for all a ∈ Zm0 ∈ Zm is additive identity.

1 ∈ Zm is multiplicative identity.

Invertible

An element a ∈ Zm is said to be invertible modulo m if there exists an integeru ∈ Zm such that ua ≡ 1 mod m. u is called inverse of a denoted as a−1.

Examples

Let m = 15.

a = 7 is invertible as 7×13 ≡ 1 mod 15a = 6 is not invertible.

Theorem

An element a ∈ Zm is invertible if and only if gcd(a,m) = 1.

Page 67: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Arithmetic of Zm

φ(m) is known as Euler’s phi function or Euler’s totient function.

φ(m) = ��{a | gcd(a,m) = 1 and 0 6 a < m}��.

Euler’s product formula

Let m = pe11 · · · p

err be the prime factorization of m with pair-wise distinct primes

p1, . . ., pr and with each of e1, . . ., er positive. Then,

φ(m) =(pe1

1 − pe1−11

)· · ·

(perr − per−1

r

)= m

∏p |m

(1−

1p

),

where the last product is over the set of all (distinct) prime divisors of m.

Examples

For m = 15,

15 = 31 ×51

φ(15) =(31 −30

) (51 −50

)= 2×4 = 8.

Page 68: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Arithmetic of Zm

φ(m) is known as Euler’s phi function or Euler’s totient function.

φ(m) = ��{a | gcd(a,m) = 1 and 0 6 a < m}��.

Euler’s product formula

Let m = pe11 · · · p

err be the prime factorization of m with pair-wise distinct primes

p1, . . ., pr and with each of e1, . . ., er positive. Then,

φ(m) =(pe1

1 − pe1−11

)· · ·

(perr − per−1

r

)= m

∏p |m

(1−

1p

),

where the last product is over the set of all (distinct) prime divisors of m.

Examples

For m = 15,

15 = 31 ×51

φ(15) =(31 −30

) (51 −50

)= 2×4 = 8.

Page 69: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Arithmetic of Zm

φ(m) is known as Euler’s phi function or Euler’s totient function.

φ(m) = ��{a | gcd(a,m) = 1 and 0 6 a < m}��.

Euler’s product formula

Let m = pe11 · · · p

err be the prime factorization of m with pair-wise distinct primes

p1, . . ., pr and with each of e1, . . ., er positive. Then,

φ(m) =(pe1

1 − pe1−11

)· · ·

(perr − per−1

r

)= m

∏p |m

(1−

1p

),

where the last product is over the set of all (distinct) prime divisors of m.

Examples

For m = 15,

15 = 31 ×51

φ(15) =(31 −30

) (51 −50

)= 2×4 = 8.

Page 70: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Structure of Z∗m

There are φ(m) elements in Zm which are coprime to m

Examples

φ(15) = 8Coprimes are {1,2,4,7,8,11,13,14}.

Z∗m

Z∗m ={a | 0 6 a < m and gcd(a,m) = 1

}.

Examples

Z∗15 = {1,2,4,7,8,11,13,14}

Page 71: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Structure of Z∗m

There are φ(m) elements in Zm which are coprime to m

Examples

φ(15) = 8Coprimes are {1,2,4,7,8,11,13,14}.

Z∗m

Z∗m ={a | 0 6 a < m and gcd(a,m) = 1

}.

Examples

Z∗15 = {1,2,4,7,8,11,13,14}

Page 72: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Structure of Z∗m

There are φ(m) elements in Zm which are coprime to m

Examples

φ(15) = 8Coprimes are {1,2,4,7,8,11,13,14}.

Z∗m

Z∗m ={a | 0 6 a < m and gcd(a,m) = 1

}.

Examples

Z∗15 = {1,2,4,7,8,11,13,14}

Page 73: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Structure of Z∗m

Euler’s theorem

Let m ∈ N and gcd(a,m) = 1. Then aφ(m) ≡ 1 mod m.

Examples

a ∈ Z∗m, aφ(m) ≡ 1 mod m

Let m = 15 and a = 4, them 48 = 65536 ≡ 1 mod 15 as 65536 = 4369×15+1.

a ∈ Z∗m, aaφ(m)−1 ≡ 1 mod m, then a−1 ≡ aφ(m)−1 mod m

Fermat’s little theorem

Let p ∈ P, and a an integer not divisible by p. Then, ap−1 ≡ 1 mod p. For anyinteger b, we have bp ≡ b mod p.

Page 74: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Structure of Z∗m

Euler’s theorem

Let m ∈ N and gcd(a,m) = 1. Then aφ(m) ≡ 1 mod m.

Examples

a ∈ Z∗m, aφ(m) ≡ 1 mod m

Let m = 15 and a = 4, them 48 = 65536 ≡ 1 mod 15 as 65536 = 4369×15+1.

a ∈ Z∗m, aaφ(m)−1 ≡ 1 mod m, then a−1 ≡ aφ(m)−1 mod m

Fermat’s little theorem

Let p ∈ P, and a an integer not divisible by p. Then, ap−1 ≡ 1 mod p. For anyinteger b, we have bp ≡ b mod p.

Page 75: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Structure of Z∗m

Euler’s theorem

Let m ∈ N and gcd(a,m) = 1. Then aφ(m) ≡ 1 mod m.

Examples

a ∈ Z∗m, aφ(m) ≡ 1 mod m

Let m = 15 and a = 4, them 48 = 65536 ≡ 1 mod 15 as 65536 = 4369×15+1.

a ∈ Z∗m, aaφ(m)−1 ≡ 1 mod m, then a−1 ≡ aφ(m)−1 mod m

Fermat’s little theorem

Let p ∈ P, and a an integer not divisible by p. Then, ap−1 ≡ 1 mod p. For anyinteger b, we have bp ≡ b mod p.

Page 76: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Binary Operation

Binary Operation

A binary operation ◦ on a set G is a map from G×G to G, that is

◦ : G×G 7→ G.

Examples

Addition, subtraction and multiplication on Zm.

Page 77: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Binary Operation

Binary Operation

A binary operation ◦ on a set G is a map from G×G to G, that is

◦ : G×G 7→ G.

Examples

Addition, subtraction and multiplication on Zm.

Page 78: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Group

Group

Let G be a set with binary operation ◦. (G,◦) is called a group if it satisfies thefollowing conditions:

Associative: (a ◦ b) ◦ c = a ◦ (b◦ c) for all a,b,c ∈ G.

Identity: ∃ an unique element e ∈ G such that a ◦ e = e ◦ a = a, ∀a ∈ G. Theelement e is called Identity of G.

Inverse: a ∈ G, ∃ an unique element b ∈ G such that a ◦ b = b◦ a = e. Theelement b is called Inverse of a.

Commutative or Abelian Group

A group (G,◦) is called commutative or abelian if for all a,b ∈ G

a ◦ b = b◦ a.

Examples

(Zm,+) and (Z∗m, ·)

Page 79: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Group

Group

Let G be a set with binary operation ◦. (G,◦) is called a group if it satisfies thefollowing conditions:

Associative: (a ◦ b) ◦ c = a ◦ (b◦ c) for all a,b,c ∈ G.

Identity: ∃ an unique element e ∈ G such that a ◦ e = e ◦ a = a, ∀a ∈ G. Theelement e is called Identity of G.

Inverse: a ∈ G, ∃ an unique element b ∈ G such that a ◦ b = b◦ a = e. Theelement b is called Inverse of a.

Commutative or Abelian Group

A group (G,◦) is called commutative or abelian if for all a,b ∈ G

a ◦ b = b◦ a.

Examples

(Zm,+) and (Z∗m, ·)

Page 80: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Group

Group

Let G be a set with binary operation ◦. (G,◦) is called a group if it satisfies thefollowing conditions:

Associative: (a ◦ b) ◦ c = a ◦ (b◦ c) for all a,b,c ∈ G.

Identity: ∃ an unique element e ∈ G such that a ◦ e = e ◦ a = a, ∀a ∈ G. Theelement e is called Identity of G.

Inverse: a ∈ G, ∃ an unique element b ∈ G such that a ◦ b = b◦ a = e. Theelement b is called Inverse of a.

Commutative or Abelian Group

A group (G,◦) is called commutative or abelian if for all a,b ∈ G

a ◦ b = b◦ a.

Examples

(Zm,+) and (Z∗m, ·)

Page 81: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Group

Group

Let G be a set with binary operation ◦. (G,◦) is called a group if it satisfies thefollowing conditions:

Associative: (a ◦ b) ◦ c = a ◦ (b◦ c) for all a,b,c ∈ G.

Identity: ∃ an unique element e ∈ G such that a ◦ e = e ◦ a = a, ∀a ∈ G. Theelement e is called Identity of G.

Inverse: a ∈ G, ∃ an unique element b ∈ G such that a ◦ b = b◦ a = e. Theelement b is called Inverse of a.

Commutative or Abelian Group

A group (G,◦) is called commutative or abelian if for all a,b ∈ G

a ◦ b = b◦ a.

Examples

(Zm,+) and (Z∗m, ·)

Page 82: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Group

Group

Let G be a set with binary operation ◦. (G,◦) is called a group if it satisfies thefollowing conditions:

Associative: (a ◦ b) ◦ c = a ◦ (b◦ c) for all a,b,c ∈ G.

Identity: ∃ an unique element e ∈ G such that a ◦ e = e ◦ a = a, ∀a ∈ G. Theelement e is called Identity of G.

Inverse: a ∈ G, ∃ an unique element b ∈ G such that a ◦ b = b◦ a = e. Theelement b is called Inverse of a.

Commutative or Abelian Group

A group (G,◦) is called commutative or abelian if for all a,b ∈ G

a ◦ b = b◦ a.

Examples

(Zm,+) and (Z∗m, ·)

Page 83: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Group

Order

The order of the group G, denoted by O(G), is simply the number of elementsin G.

The order of an element in a group G (notation O(a)) is the least positiveinteger n such that an = 1.

Subgroup

Let (G,◦) be group and H be a non-empty subset of G. If (H,◦) is also a group,then H is subgroup of G.

Lagrange’s Theorem

Let (G,◦) be a finite group and H be a subgroup of G. Then O(H) | O(G).

Examples

(Z∗15, ·) is group

(1, ·) is subgroup of Z∗15H = {1,2,4,8} is also a subgroup of Z∗15

Page 84: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Group

Order

The order of the group G, denoted by O(G), is simply the number of elementsin G.

The order of an element in a group G (notation O(a)) is the least positiveinteger n such that an = 1.

Subgroup

Let (G,◦) be group and H be a non-empty subset of G. If (H,◦) is also a group,then H is subgroup of G.

Lagrange’s Theorem

Let (G,◦) be a finite group and H be a subgroup of G. Then O(H) | O(G).

Examples

(Z∗15, ·) is group

(1, ·) is subgroup of Z∗15H = {1,2,4,8} is also a subgroup of Z∗15

Page 85: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Group

Order

The order of the group G, denoted by O(G), is simply the number of elementsin G.

The order of an element in a group G (notation O(a)) is the least positiveinteger n such that an = 1.

Subgroup

Let (G,◦) be group and H be a non-empty subset of G. If (H,◦) is also a group,then H is subgroup of G.

Lagrange’s Theorem

Let (G,◦) be a finite group and H be a subgroup of G. Then O(H) | O(G).

Examples

(Z∗15, ·) is group

(1, ·) is subgroup of Z∗15H = {1,2,4,8} is also a subgroup of Z∗15

Page 86: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Group

Order

The order of the group G, denoted by O(G), is simply the number of elementsin G.

The order of an element in a group G (notation O(a)) is the least positiveinteger n such that an = 1.

Subgroup

Let (G,◦) be group and H be a non-empty subset of G. If (H,◦) is also a group,then H is subgroup of G.

Lagrange’s Theorem

Let (G,◦) be a finite group and H be a subgroup of G. Then O(H) | O(G).

Examples

(Z∗15, ·) is group

(1, ·) is subgroup of Z∗15H = {1,2,4,8} is also a subgroup of Z∗15

Page 87: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Group

Cyclic Group

Let (G,◦) be a group. G is called cyclic if there exists a ∈ G such that

G = {an | n ∈ Z} = 〈a〉.

Let (G,◦) be a group and a ∈ G with order n. Then 〈a〉 is a cyclic subgroup ofG.

Examples

G = Z∗15 and H = {1,2,4,8}.O(G) = φ(15) = 8O(2) = 4.

H = 〈2〉 = {20,21,22,23} = {1,2,4,8}.

Page 88: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Group

Cyclic Group

Let (G,◦) be a group. G is called cyclic if there exists a ∈ G such that

G = {an | n ∈ Z} = 〈a〉.

Let (G,◦) be a group and a ∈ G with order n. Then 〈a〉 is a cyclic subgroup ofG.

Examples

G = Z∗15 and H = {1,2,4,8}.O(G) = φ(15) = 8O(2) = 4.

H = 〈2〉 = {20,21,22,23} = {1,2,4,8}.

Page 89: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Group

Theorem

Each cyclic group is abelian.

Theorem

If (G, ·) is a finite group and order of it is a prime, then G is cyclic.

Page 90: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Outline for section 3

1 Introduction

2 Mathematical background

3 Diffie-Hellman Key Exchange

4 Digital SignatureRSA Digital SignatureElGamal Digital SignatureDSA Digital Signature

5 Public-Key Encryption SchemesRSA Public-Key Encryption SchemeElGamal Public-Key Encryption Scheme

6 Conclusion

Page 91: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Diffie-Hellman Key Exchange

Introduced by Whitfield Diffie and Martin Hellman in 1976.

Domain Parameter

Let G be an abelian group of order n

Let g ∈ G such that 〈g〉 is the largest prime subgroup of G.

Let O(g) = m

Diffie-Hellman Key Exchange

Alice Bob1. a ∈R {2,3, . . .,m−1} 1. b ∈R {2,3, . . .,m−1}2. Computes A = ga 2. Computes B = gb

A−−−−−−→

B←−−−−−−

3. Computes K = Ba = gab 3. Computes K = Ab = gab

Page 92: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Diffie-Hellman Key Exchange

Introduced by Whitfield Diffie and Martin Hellman in 1976.

Domain Parameter

Let G be an abelian group of order n

Let g ∈ G such that 〈g〉 is the largest prime subgroup of G.

Let O(g) = m

Diffie-Hellman Key Exchange

Alice Bob1. a ∈R {2,3, . . .,m−1} 1. b ∈R {2,3, . . .,m−1}2. Computes A = ga 2. Computes B = gb

A−−−−−−→

B←−−−−−−

3. Computes K = Ba = gab 3. Computes K = Ab = gab

Page 93: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Diffie-Hellman Key Exchange

Introduced by Whitfield Diffie and Martin Hellman in 1976.

Domain Parameter

Let G be an abelian group of order n

Let g ∈ G such that 〈g〉 is the largest prime subgroup of G.

Let O(g) = m

Diffie-Hellman Key Exchange

Alice Bob

1. a ∈R {2,3, . . .,m−1} 1. b ∈R {2,3, . . .,m−1}2. Computes A = ga 2. Computes B = gb

A−−−−−−→

B←−−−−−−

3. Computes K = Ba = gab 3. Computes K = Ab = gab

Page 94: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Diffie-Hellman Key Exchange

Introduced by Whitfield Diffie and Martin Hellman in 1976.

Domain Parameter

Let G be an abelian group of order n

Let g ∈ G such that 〈g〉 is the largest prime subgroup of G.

Let O(g) = m

Diffie-Hellman Key Exchange

Alice Bob1. a ∈R {2,3, . . .,m−1} 1. b ∈R {2,3, . . .,m−1}

2. Computes A = ga 2. Computes B = gbA

−−−−−−→B

←−−−−−−

3. Computes K = Ba = gab 3. Computes K = Ab = gab

Page 95: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Diffie-Hellman Key Exchange

Introduced by Whitfield Diffie and Martin Hellman in 1976.

Domain Parameter

Let G be an abelian group of order n

Let g ∈ G such that 〈g〉 is the largest prime subgroup of G.

Let O(g) = m

Diffie-Hellman Key Exchange

Alice Bob1. a ∈R {2,3, . . .,m−1} 1. b ∈R {2,3, . . .,m−1}2. Computes A = ga 2. Computes B = gb

A−−−−−−→

B←−−−−−−

3. Computes K = Ba = gab 3. Computes K = Ab = gab

Page 96: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Diffie-Hellman Key Exchange

Introduced by Whitfield Diffie and Martin Hellman in 1976.

Domain Parameter

Let G be an abelian group of order n

Let g ∈ G such that 〈g〉 is the largest prime subgroup of G.

Let O(g) = m

Diffie-Hellman Key Exchange

Alice Bob1. a ∈R {2,3, . . .,m−1} 1. b ∈R {2,3, . . .,m−1}2. Computes A = ga 2. Computes B = gb

A−−−−−−→

B←−−−−−−

3. Computes K = Ba = gab 3. Computes K = Ab = gab

Page 97: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Diffie-Hellman Key Exchange

Introduced by Whitfield Diffie and Martin Hellman in 1976.

Domain Parameter

Let G be an abelian group of order n

Let g ∈ G such that 〈g〉 is the largest prime subgroup of G.

Let O(g) = m

Diffie-Hellman Key Exchange

Alice Bob1. a ∈R {2,3, . . .,m−1} 1. b ∈R {2,3, . . .,m−1}2. Computes A = ga 2. Computes B = gb

A−−−−−−→

B←−−−−−−

3. Computes K = Ba = gab 3. Computes K = Ab = gab

Page 98: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Diffie-Hellman Key Exchange

Domain Parameter

Let G = Z∗p where p = 35394171431 ∈ PLet g = 180 and O(g) = 122048867 ∈ P

Diffie-Hellman Key Exchange

Alice Bob1. a = 96642237 1. b = 549867572. A = ga = 14631136677 2. B = gb = 23989781989

14631136677−−−−−−−−−−−→23989781989←−−−−−−−−−−−

3. K = Ba = 30864161233 3. K = Ab = 3086416123

Page 99: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Diffie-Hellman Key Exchange

Domain Parameter

Let G = Z∗p where p = 35394171431 ∈ PLet g = 180 and O(g) = 122048867 ∈ P

Diffie-Hellman Key Exchange

Alice Bob

1. a = 96642237 1. b = 549867572. A = ga = 14631136677 2. B = gb = 23989781989

14631136677−−−−−−−−−−−→23989781989←−−−−−−−−−−−

3. K = Ba = 30864161233 3. K = Ab = 3086416123

Page 100: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Diffie-Hellman Key Exchange

Domain Parameter

Let G = Z∗p where p = 35394171431 ∈ PLet g = 180 and O(g) = 122048867 ∈ P

Diffie-Hellman Key Exchange

Alice Bob1. a = 96642237 1. b = 54986757

2. A = ga = 14631136677 2. B = gb = 2398978198914631136677−−−−−−−−−−−→23989781989←−−−−−−−−−−−

3. K = Ba = 30864161233 3. K = Ab = 3086416123

Page 101: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Diffie-Hellman Key Exchange

Domain Parameter

Let G = Z∗p where p = 35394171431 ∈ PLet g = 180 and O(g) = 122048867 ∈ P

Diffie-Hellman Key Exchange

Alice Bob1. a = 96642237 1. b = 549867572. A = ga = 14631136677 2. B = gb = 23989781989

14631136677−−−−−−−−−−−→23989781989←−−−−−−−−−−−

3. K = Ba = 30864161233 3. K = Ab = 3086416123

Page 102: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Diffie-Hellman Key Exchange

Domain Parameter

Let G = Z∗p where p = 35394171431 ∈ PLet g = 180 and O(g) = 122048867 ∈ P

Diffie-Hellman Key Exchange

Alice Bob1. a = 96642237 1. b = 549867572. A = ga = 14631136677 2. B = gb = 23989781989

14631136677−−−−−−−−−−−→23989781989←−−−−−−−−−−−

3. K = Ba = 30864161233 3. K = Ab = 3086416123

Page 103: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Diffie-Hellman Key Exchange

Domain Parameter

Let G = Z∗p where p = 35394171431 ∈ PLet g = 180 and O(g) = 122048867 ∈ P

Diffie-Hellman Key Exchange

Alice Bob1. a = 96642237 1. b = 549867572. A = ga = 14631136677 2. B = gb = 23989781989

14631136677−−−−−−−−−−−→23989781989←−−−−−−−−−−−

3. K = Ba = 30864161233 3. K = Ab = 3086416123

Page 104: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Diffie-Hellman Key Exchange

Intractable problems

From a computational complexity stance, intractable problems are problems forwhich there exist no efficient algorithms to solve them. Therefore, it is not feasiblefor computation with anything more than the smallest input.

Discrete Logarithm Problem (DLP)

Let G be a multiplicative group and let g ∈ G. Given g and ga for some (unknown)integer a, compute a.

Diffie-Hellman Problem (DHP)

Let G be a multiplicative group and let g ∈ G. Given g, ga and gb for some(unknown) integers a and b, compute gab .

Decisional Diffie-Hellman Problem (DDHP)

Let G be a multiplicative group and let g ∈ G with O(g) = m. Given g, ga , gb and

gc for some (unknown) integers a, b and c, decides whether c?≡ ab mod m.

Page 105: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Diffie-Hellman Key Exchange

Intractable problems

From a computational complexity stance, intractable problems are problems forwhich there exist no efficient algorithms to solve them. Therefore, it is not feasiblefor computation with anything more than the smallest input.

Discrete Logarithm Problem (DLP)

Let G be a multiplicative group and let g ∈ G. Given g and ga for some (unknown)integer a, compute a.

Diffie-Hellman Problem (DHP)

Let G be a multiplicative group and let g ∈ G. Given g, ga and gb for some(unknown) integers a and b, compute gab .

Decisional Diffie-Hellman Problem (DDHP)

Let G be a multiplicative group and let g ∈ G with O(g) = m. Given g, ga , gb and

gc for some (unknown) integers a, b and c, decides whether c?≡ ab mod m.

Page 106: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Diffie-Hellman Key Exchange

Intractable problems

From a computational complexity stance, intractable problems are problems forwhich there exist no efficient algorithms to solve them. Therefore, it is not feasiblefor computation with anything more than the smallest input.

Discrete Logarithm Problem (DLP)

Let G be a multiplicative group and let g ∈ G. Given g and ga for some (unknown)integer a, compute a.

Diffie-Hellman Problem (DHP)

Let G be a multiplicative group and let g ∈ G. Given g, ga and gb for some(unknown) integers a and b, compute gab .

Decisional Diffie-Hellman Problem (DDHP)

Let G be a multiplicative group and let g ∈ G with O(g) = m. Given g, ga , gb and

gc for some (unknown) integers a, b and c, decides whether c?≡ ab mod m.

Page 107: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Diffie-Hellman Key Exchange

Intractable problems

From a computational complexity stance, intractable problems are problems forwhich there exist no efficient algorithms to solve them. Therefore, it is not feasiblefor computation with anything more than the smallest input.

Discrete Logarithm Problem (DLP)

Let G be a multiplicative group and let g ∈ G. Given g and ga for some (unknown)integer a, compute a.

Diffie-Hellman Problem (DHP)

Let G be a multiplicative group and let g ∈ G. Given g, ga and gb for some(unknown) integers a and b, compute gab .

Decisional Diffie-Hellman Problem (DDHP)

Let G be a multiplicative group and let g ∈ G with O(g) = m. Given g, ga , gb and

gc for some (unknown) integers a, b and c, decides whether c?≡ ab mod m.

Page 108: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Outline for section 4

1 Introduction

2 Mathematical background

3 Diffie-Hellman Key Exchange

4 Digital SignatureRSA Digital SignatureElGamal Digital SignatureDSA Digital Signature

5 Public-Key Encryption SchemesRSA Public-Key Encryption SchemeElGamal Public-Key Encryption Scheme

6 Conclusion

Page 109: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Digital Signature

Digital Signature: {Key Generation, Signing, Verification}.

Key Generation: Probabilistic Polynomial-time (PPT) algorithm.

Signing: PPT algorithm.

Verification: Deterministic Polynomial-time algorithm.

M

m

Signing Verification

H

SK

M

m

H

σ

PK

1

0

message

Hash functionCryptographic

message digest

Signer’s Secret Key Signer’s public Key

signature

Figure: Digital Signature

Page 110: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Digital Signature

Digital Signature: {Key Generation, Signing, Verification}.

Key Generation: Probabilistic Polynomial-time (PPT) algorithm.

Signing: PPT algorithm.

Verification: Deterministic Polynomial-time algorithm.

M

m

Signing Verification

H

SK

M

m

H

σ

PK

1

0

message

Hash functionCryptographic

message digest

Signer’s Secret Key Signer’s public Key

signature

Figure: Digital Signature

Page 111: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

RSA Digital Signature

Introduced by Ron Rivest, Adi Shamir, and Leonard Adleman in 1977

Key Generation

1. Let the security parameter be l

2. Choose two primes p and q of bit-length almost l

3. Compute n = pq and φ(n) = (p−1)(q−1)

4. Choose e such that gcd(e, φ(n)) = 15. Compute d ≡ e−1 mod φ(n)

6. SK = d and PK = (n, e)

Page 112: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

RSA Digital Signature

Signing(M,SK )

1. Compute m =H (M) ∈ Z∗n.

2. Compute σ ≡ md mod n.

Verification(M,σ,PK )

1. Compute m =H (M) ∈ Z∗n.

2. Compute m′ ≡ σe mod n.

3. Check m ?= m′.

4. If m = m′, Return 1, else 0.

Correctness

m′ ≡ σe ≡ (md )e ≡ med ≡ m mod n,

ased ≡ 1 mod φ(n).

Page 113: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

RSA Digital Signature

Signing(M,SK )

1. Compute m =H (M) ∈ Z∗n.

2. Compute σ ≡ md mod n.

Verification(M,σ,PK )

1. Compute m =H (M) ∈ Z∗n.

2. Compute m′ ≡ σe mod n.

3. Check m ?= m′.

4. If m = m′, Return 1, else 0.

Correctness

m′ ≡ σe ≡ (md )e ≡ med ≡ m mod n,

ased ≡ 1 mod φ(n).

Page 114: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

RSA Digital Signature

Signing(M,SK )

1. Compute m =H (M) ∈ Z∗n.

2. Compute σ ≡ md mod n.

Verification(M,σ,PK )

1. Compute m =H (M) ∈ Z∗n.

2. Compute m′ ≡ σe mod n.

3. Check m ?= m′.

4. If m = m′, Return 1, else 0.

Correctness

m′ ≡ σe ≡ (md )e ≡ med ≡ m mod n,

ased ≡ 1 mod φ(n).

Page 115: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

RSA Digital Signature

Key Generation

1. security parameter l = 182. p = 241537 and q = 3820693. n = pq = 922838000534. φ(n) = (241537−1)(382069−1) = 922831764485. e = 56. d ≡ e−1 ≡ 55369905869 mod φ(n)

7. SK = 55369905869 and PK = (92283800053,5)

Page 116: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

RSA Digital Signature

Signing(M,SK )

1. m =H (M) = 1234567890 ∈ Z∗n2. σ ≡ md ≡ 85505674365 mod n

Verification(M,σ,PK )

1. m =H (M) = 1234567890 ∈ Z∗n2. m′ ≡ σe ≡ 1234567890 mod n

3. m ?= m′

4. As m = m′, Return 1

Page 117: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

RSA Digital Signature

Signing(M,SK )

1. m =H (M) = 1234567890 ∈ Z∗n2. σ ≡ md ≡ 85505674365 mod n

Verification(M,σ,PK )

1. m =H (M) = 1234567890 ∈ Z∗n2. m′ ≡ σe ≡ 1234567890 mod n

3. m ?= m′

4. As m = m′, Return 1

Page 118: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Security of RSA

Intractable problems

Integer Factorization.

RSA Key Inversion problem

Page 119: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

ElGamal Digital Signature

ElGamal signature scheme was introduced by Tahir Elgamal in 1985.

Domain parameter

Let G be a cyclic multiplicative group.

O(G) = n

∃g ∈ G such that G = 〈g〉 and O(g) = n

Key Generation

Choose d ∈R {2, . . .,n−1}Compute Q ≡ gd

SK = d and PK =Q

Page 120: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

ElGamal Digital Signature

ElGamal signature scheme was introduced by Tahir Elgamal in 1985.

Domain parameter

Let G be a cyclic multiplicative group.

O(G) = n

∃g ∈ G such that G = 〈g〉 and O(g) = n

Key Generation

Choose d ∈R {2, . . .,n−1}Compute Q ≡ gd

SK = d and PK =Q

Page 121: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

ElGamal Digital Signature

Signing(M,SK )

1. Choose k ∈R {2, . . .,n−1}2. Compute m =H (M) ∈ G

3. Compute s = gk

4. Compute t ≡ k−1 (m− ds)

5. Signature σ = (s, t)

Verification(M,σ,PK )

1. Compute m =H (M) ∈ G

2. Compute a1 = gm

3. Compute a2 =Qs st

4. Check a1?= a2.

5. If yes Return 1, else Return 0

Correctness

a1 ≡ gm ≡ gtk+ds = (gk )t (gd )s ≡ stQs = a2

Page 122: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

ElGamal Digital Signature

Signing(M,SK )

1. Choose k ∈R {2, . . .,n−1}2. Compute m =H (M) ∈ G

3. Compute s = gk

4. Compute t ≡ k−1 (m− ds)

5. Signature σ = (s, t)

Verification(M,σ,PK )

1. Compute m =H (M) ∈ G

2. Compute a1 = gm

3. Compute a2 =Qs st

4. Check a1?= a2.

5. If yes Return 1, else Return 0

Correctness

a1 ≡ gm ≡ gtk+ds = (gk )t (gd )s ≡ stQs = a2

Page 123: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

ElGamal Digital Signature

Signing(M,SK )

1. Choose k ∈R {2, . . .,n−1}2. Compute m =H (M) ∈ G

3. Compute s = gk

4. Compute t ≡ k−1 (m− ds)

5. Signature σ = (s, t)

Verification(M,σ,PK )

1. Compute m =H (M) ∈ G

2. Compute a1 = gm

3. Compute a2 =Qs st

4. Check a1?= a2.

5. If yes Return 1, else Return 0

Correctness

a1 ≡ gm ≡ gtk+ds = (gk )t (gd )s ≡ stQs = a2

Page 124: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

ElGamal Digital Signature

Domain parameter

G = Z∗p where p = 92283800099n =O(G) = 92283800098g = 19 and O(g) = 92283800098

Key Generation

d = 23499347910Q ≡ gd ≡ 66075503407 mod p

SK = 23499347910 and PK = 66075503407

Page 125: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

ElGamal Digital Signature

Domain parameter

G = Z∗p where p = 92283800099n =O(G) = 92283800098g = 19 and O(g) = 92283800098

Key Generation

d = 23499347910Q ≡ gd ≡ 66075503407 mod p

SK = 23499347910 and PK = 66075503407

Page 126: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

ElGamal Digital Signature

Signing(M,SK )

1. k = 92137532432. m =H (M) = 12345678903. s ≡ gk ≡ 85536409136 mod p

4. t ≡ k−1 (m− ds) ≡ 22134180366 mod φ(p)

5. σ = (85536409136,22134180366)

Verification(M,σ,PK )

1. m =H (M) = 12345678902. a1 = g

m ≡ 44505409554 mod p

3. a2 =Qs st ≡ 44505409554 mod p

4. As a1 = a2, Return 1.

Page 127: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

ElGamal Digital Signature

Signing(M,SK )

1. k = 92137532432. m =H (M) = 12345678903. s ≡ gk ≡ 85536409136 mod p

4. t ≡ k−1 (m− ds) ≡ 22134180366 mod φ(p)

5. σ = (85536409136,22134180366)

Verification(M,σ,PK )

1. m =H (M) = 12345678902. a1 = g

m ≡ 44505409554 mod p

3. a2 =Qs st ≡ 44505409554 mod p

4. As a1 = a2, Return 1.

Page 128: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

DSA Digital Signature

National Institute of Standards and Technology (NIST) proposed DSA in 1991

Domain parameter(p,q,g)

Let G = Z∗p for some prime p

Let g ∈ G such that 〈g〉 is the largest prime subgroup of G.

Let O(g) = q

Key Generation

Choose d ∈R {2, . . .,q−1}.Compute Q ≡ gd mod p

SK = d and PK =Q

Page 129: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

DSA Digital Signature

National Institute of Standards and Technology (NIST) proposed DSA in 1991

Domain parameter(p,q,g)

Let G = Z∗p for some prime p

Let g ∈ G such that 〈g〉 is the largest prime subgroup of G.

Let O(g) = q

Key Generation

Choose d ∈R {2, . . .,q−1}.Compute Q ≡ gd mod p

SK = d and PK =Q

Page 130: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

DSA Digital Signature

Signing(M,SK )

1. Choose k ∈R {2,3, . . .,q−1}2. Compute m =H (M) ∈ Zp

3. Compute s =(gk mod p

)mod q

4. Compute t = k−1(m+ ds) mod q

5. Signature σ = (s, t)

Verification(M,σ,PK )

1. Compute m =H (M) ∈ Zp

2. Compute w ≡ t−1 mod q

3. Compute w1 ≡ mw mod q

4. Compute w2 ≡ sw mod q

5. Compute s′ = (gw1Qw2 mod p) mod q

6. Check s′ ?= s; If yes Return 1, else Return 0.

Page 131: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

DSA Digital Signature

Signing(M,SK )

1. Choose k ∈R {2,3, . . .,q−1}2. Compute m =H (M) ∈ Zp

3. Compute s =(gk mod p

)mod q

4. Compute t = k−1(m+ ds) mod q

5. Signature σ = (s, t)

Verification(M,σ,PK )

1. Compute m =H (M) ∈ Zp

2. Compute w ≡ t−1 mod q

3. Compute w1 ≡ mw mod q

4. Compute w2 ≡ sw mod q

5. Compute s′ = (gw1Qw2 mod p) mod q

6. Check s′ ?= s; If yes Return 1, else Return 0.

Page 132: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

DSA Digital Signature

Correctness

s′ = gw1Qw2

= gw1gdw2 as Q = gd

= gwmgdsw as w1 = mw and w2 = sw= gw(m+ds)

= gt−1 (m+ds) as w = t−1

= gk as t = k−1(m+ ds)= s as s = gk .

Page 133: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

DSA Digital Signature

Correctness

s′ = gw1Qw2

= gw1gdw2 as Q = gd

= gwmgdsw as w1 = mw and w2 = sw= gw(m+ds)

= gt−1 (m+ds) as w = t−1

= gk as t = k−1(m+ ds)= s as s = gk .

Page 134: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

DSA Digital Signature

Correctness

s′ = gw1Qw2

= gw1gdw2 as Q = gd

= gwmgdsw as w1 = mw and w2 = sw

= gw(m+ds)

= gt−1 (m+ds) as w = t−1

= gk as t = k−1(m+ ds)= s as s = gk .

Page 135: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

DSA Digital Signature

Correctness

s′ = gw1Qw2

= gw1gdw2 as Q = gd

= gwmgdsw as w1 = mw and w2 = sw= gw(m+ds)

= gt−1 (m+ds) as w = t−1

= gk as t = k−1(m+ ds)= s as s = gk .

Page 136: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

DSA Digital Signature

Correctness

s′ = gw1Qw2

= gw1gdw2 as Q = gd

= gwmgdsw as w1 = mw and w2 = sw= gw(m+ds)

= gt−1 (m+ds) as w = t−1

= gk as t = k−1(m+ ds)= s as s = gk .

Page 137: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

DSA Digital Signature

Correctness

s′ = gw1Qw2

= gw1gdw2 as Q = gd

= gwmgdsw as w1 = mw and w2 = sw= gw(m+ds)

= gt−1 (m+ds) as w = t−1

= gk as t = k−1(m+ ds)

= s as s = gk .

Page 138: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

DSA Digital Signature

Correctness

s′ = gw1Qw2

= gw1gdw2 as Q = gd

= gwmgdsw as w1 = mw and w2 = sw= gw(m+ds)

= gt−1 (m+ds) as w = t−1

= gk as t = k−1(m+ ds)= s as s = gk .

Page 139: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

DSA Digital Signature

Domain parameter(p,q,g)

G = Z∗p where p = 92283800153

p−1 = 23 ×21529×535811g = 65180204028, where O(g) = 535811

Key Generation

d = 14723.

Q ≡ gd ≡ 3232858927 mod p.

SK = 14723 and PK = 3232858927

Page 140: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

DSA Digital Signature

Signing(M,SK )

1. k = 93722. m =H (M) = 12345678903. s1 ≡ g

k ≡ 75248267410 mod p

4. s ≡ s1 mod q ≡ 42192 mod q

5. t = k−1(m+ ds) ≡ 279309 mod q

6. σ = (42192,279309)

Verification(M,σ,PK )

1. m =H (M) = 12345678902. w ≡ t−1 ≡ 54105 mod q

3. w1 ≡ mw ≡ 335818 mod q

4. w2 ≡ sw ≡ 243300 mod q

5. s1 ≡ (gw1Qw2 ) ≡ 75248267410 mod p

6. s′ = s1 ≡ 42192 mod q

7. Check s′ ?= s; If yes Return 1, else Return 0.

Page 141: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

DSA Digital Signature

Signing(M,SK )

1. k = 93722. m =H (M) = 12345678903. s1 ≡ g

k ≡ 75248267410 mod p

4. s ≡ s1 mod q ≡ 42192 mod q

5. t = k−1(m+ ds) ≡ 279309 mod q

6. σ = (42192,279309)

Verification(M,σ,PK )

1. m =H (M) = 12345678902. w ≡ t−1 ≡ 54105 mod q

3. w1 ≡ mw ≡ 335818 mod q

4. w2 ≡ sw ≡ 243300 mod q

5. s1 ≡ (gw1Qw2 ) ≡ 75248267410 mod p

6. s′ = s1 ≡ 42192 mod q

7. Check s′ ?= s; If yes Return 1, else Return 0.

Page 142: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Outline for section 5

1 Introduction

2 Mathematical background

3 Diffie-Hellman Key Exchange

4 Digital SignatureRSA Digital SignatureElGamal Digital SignatureDSA Digital Signature

5 Public-Key Encryption SchemesRSA Public-Key Encryption SchemeElGamal Public-Key Encryption Scheme

6 Conclusion

Page 143: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Public-Key Encryption Schemes

Digital Signature: {Key Generation, Encryption, Decryption}.

Key Generation: Probabilistic Polynomial-time (PPT) algorithm.

Encryption: PPT algorithm.

Decryption: Deterministic Polynomial-time algorithm.

m

Enc DecPK c

SK

m

message or Plain text

Cipher textReceiver’s Public Key Receiver’s Secret key

Figure: Public-Key Encryption System

Page 144: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Public-Key Encryption Schemes

M

m

Signing Verification

H

SK

M

m

H

σ

PK

1

0

message

Hash functionCryptographic

message digest

Signer’s Secret Key Signer’s public Key

signature

Figure: Digital Signature

m

Enc DecPK c

SK

m

message or Plain text

Cipher textReceiver’s Public Key Receiver’s Secret key

Figure: Digital Signature

Page 145: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

RSA Public-Key Encryption Scheme

Key Generation

1. Let the security parameter be l

2. Choose two primes p and q of bit-length almost l

3. Compute n = pq and φ(n) = (p−1)(q−1)

4. Choose e such that gcd(e, φ(n)) = 15. Compute d ≡ e−1 mod φ(n)

6. SK = d and PK = (n, e)

Page 146: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

RSA Public-Key Encryption Scheme

Encryption(m ∈ Z∗n,PK )

1. Compute c ≡ me mod n

Decryption(c,SK )

1. Compute m = cd mod n

Correctness

m ≡ cd ≡ (me)d ≡ med ≡ m mod n,

ased ≡ 1 mod φ(n)

Page 147: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

RSA Public-Key Encryption Scheme

Encryption(m ∈ Z∗n,PK )

1. Compute c ≡ me mod n

Decryption(c,SK )

1. Compute m = cd mod n

Correctness

m ≡ cd ≡ (me)d ≡ med ≡ m mod n,

ased ≡ 1 mod φ(n)

Page 148: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

RSA Public-Key Encryption Scheme

Encryption(m ∈ Z∗n,PK )

1. Compute c ≡ me mod n

Decryption(c,SK )

1. Compute m = cd mod n

Correctness

m ≡ cd ≡ (me)d ≡ med ≡ m mod n,

ased ≡ 1 mod φ(n)

Page 149: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

RSA Public-Key Encryption Scheme

Key Generation

1. security parameter l = 182. p = 241537 and q = 3820693. n = pq = 922838000534. φ(n) = (241537−1)(382069−1) = 922831764485. e = 56. d ≡ e−1 ≡ 55369905869 mod φ(n)

7. SK = 55369905869 and PK = (92283800053,5)

Page 150: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

RSA Public-Key Encryption Scheme

Encryption(m,PK )

1. m = 1234567890 ∈ Z∗n.

2. c ≡ me ≡ 40073606699 mod n.

Verification(c,SK )

1. m = cd = 1234567890 ∈ Z∗n.

Page 151: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

RSA Public-Key Encryption Scheme

Encryption(m,PK )

1. m = 1234567890 ∈ Z∗n.

2. c ≡ me ≡ 40073606699 mod n.

Verification(c,SK )

1. m = cd = 1234567890 ∈ Z∗n.

Page 152: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

RSA Public-Key Encryption Scheme

Encryption(m,PK )

1. m = 1234567890 ∈ Z∗n.

2. c ≡ me ≡ 40073606699 mod n.

Verification(c,SK )

1. m = cd = 1234567890 ∈ Z∗n.

Page 153: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

ElGamal Public-Key Encryption Scheme

Domain parameter

Let G be a cyclic multiplicative group.

O(G) = n

∃g ∈ G such that G = 〈g〉 and O(g) = n

Key Generation

Choose d ∈R {2, . . .,n−1}Compute Q ≡ gd

SK = d and PK =Q

Page 154: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

ElGamal Public-Key Encryption Scheme

Domain parameter

Let G be a cyclic multiplicative group.

O(G) = n

∃g ∈ G such that G = 〈g〉 and O(g) = n

Key Generation

Choose d ∈R {2, . . .,n−1}Compute Q ≡ gd

SK = d and PK =Q

Page 155: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

ElGamal Public-Key Encryption Scheme

Encryption(m,PK )

1. Choose k ∈R {2, . . .,n−1}2. Compute r = gk

3. Compute s = mQk

4. c = (r, s)

Decryption(c,SK )

1. Compute m = sr−d

Correctness

m = sr−d = mQk (gk )−d = m(gd )k (gk )−d = mgkd−kd = m

Page 156: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

ElGamal Public-Key Encryption Scheme

Encryption(m,PK )

1. Choose k ∈R {2, . . .,n−1}2. Compute r = gk

3. Compute s = mQk

4. c = (r, s)

Decryption(c,SK )

1. Compute m = sr−d

Correctness

m = sr−d = mQk (gk )−d = m(gd )k (gk )−d = mgkd−kd = m

Page 157: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

ElGamal Public-Key Encryption Scheme

Encryption(m,PK )

1. Choose k ∈R {2, . . .,n−1}2. Compute r = gk

3. Compute s = mQk

4. c = (r, s)

Decryption(c,SK )

1. Compute m = sr−d

Correctness

m = sr−d = mQk (gk )−d = m(gd )k (gk )−d = mgkd−kd = m

Page 158: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

ElGamal Digital Signature

Domain parameter

G = Z∗p where p = 92283800099n =O(G) = 92283800098g = 19 and O(g) = 92283800098

Key Generation

d = 23499347910.

Q ≡ gd ≡ 66075503407 mod p.

SK = 23499347910 and PK = 66075503407

Page 159: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

ElGamal Digital Signature

Domain parameter

G = Z∗p where p = 92283800099n =O(G) = 92283800098g = 19 and O(g) = 92283800098

Key Generation

d = 23499347910.

Q ≡ gd ≡ 66075503407 mod p.

SK = 23499347910 and PK = 66075503407

Page 160: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

ElGamal Digital Signature

Encryption(m,SK )

1. k = 92137532432. m = 12345678903. Compute r ≡ gk ≡ 85536409136 mod p

4. Compute s ≡ mQk ≡ 9922819653 mod p

5. Signature σ = (85536409136,9922819653).

Decryption(c,PK )

1. Compute m = sr−d ≡ 1234567890 mod p

Page 161: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

ElGamal Digital Signature

Encryption(m,SK )

1. k = 92137532432. m = 12345678903. Compute r ≡ gk ≡ 85536409136 mod p

4. Compute s ≡ mQk ≡ 9922819653 mod p

5. Signature σ = (85536409136,9922819653).

Decryption(c,PK )

1. Compute m = sr−d ≡ 1234567890 mod p

Page 162: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Outline for section 6

1 Introduction

2 Mathematical background

3 Diffie-Hellman Key Exchange

4 Digital SignatureRSA Digital SignatureElGamal Digital SignatureDSA Digital Signature

5 Public-Key Encryption SchemesRSA Public-Key Encryption SchemeElGamal Public-Key Encryption Scheme

6 Conclusion

Page 163: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Conclusion

Basic mathematical tools

Basic concepts of public-key protocolsBooks:

Cryptography - Theory And Practice, Douglas StinsonCryptography and Network Security Principles and Practices, William StallingsIntroduction to Cryptography - Principles and Applications, Hans Delfs, HelmutKneblHandbook of Applied Cryptography, Alfred J. Menezes, Paul C. van Oorschot andScott A. Vanstone

Page 164: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Questions

Page 165: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Questions

Page 166: Introduction to Public-Key Cryptographysmishra/event/acmws2019/lectures/pkc.pdf · Introduction to Public-Key Cryptography Sabyasachi Karati Assistant Professor School of Computer

Introduction

Mathematicalbackground

Diffie-HellmanKey Exchange

Digital Signature

Public-KeyEncryptionSchemes

Conclusion

Thank You