13
Introduction to Cryptography Lecture 9

Introduction to Cryptography Lecture 9. Public – Key Cryptosystems Each participant has a public key and a private key. It should be infeasible to determine

Embed Size (px)

Citation preview

Page 1: Introduction to Cryptography Lecture 9. Public – Key Cryptosystems Each participant has a public key and a private key. It should be infeasible to determine

Introduction to Cryptography

Lecture 9

Page 2: Introduction to Cryptography Lecture 9. Public – Key Cryptosystems Each participant has a public key and a private key. It should be infeasible to determine

Public – Key Cryptosystems

Each participant has a public key and a private key.

It should be infeasible to determine the private key from knowledge of the public key.

Page 3: Introduction to Cryptography Lecture 9. Public – Key Cryptosystems Each participant has a public key and a private key. It should be infeasible to determine

BobAlice

message

Public – Key Cryptosystems

Bob encrypts message using Alice’s public key

Alice decrypt message using her private key

Page 4: Introduction to Cryptography Lecture 9. Public – Key Cryptosystems Each participant has a public key and a private key. It should be infeasible to determine

Prime Numbers

Definition: A prime number is an integer number that has only two divisors: one and itself.

Example: 1, 2,17, 31. Prime numbers distributed irregularly

among the integers There are infinitely many prime numbers

Page 5: Introduction to Cryptography Lecture 9. Public – Key Cryptosystems Each participant has a public key and a private key. It should be infeasible to determine

Factoring

The Fundamental Theorem of Arithmetic tells us that every positive integer can be written as a product of powers of primes in essentially one way.

Example: 23176647 2

53290 2

Page 6: Introduction to Cryptography Lecture 9. Public – Key Cryptosystems Each participant has a public key and a private key. It should be infeasible to determine

The RSA Public – Key Cryptosystem

In 1978, Ronald Rives, Adi Shamir, and Leonard Adelman wrote a paper called “A Method for Obtaining Digital Signatures and Public Key Cryptosystem”.

They described a cipher system in which senders encrypt message using a method and a key that are publicly distributed.

Page 7: Introduction to Cryptography Lecture 9. Public – Key Cryptosystems Each participant has a public key and a private key. It should be infeasible to determine

The RSA Public – Key Cryptosystem

Alice: Selects two prime numbers p and q. Calculates m = pq and n = (p - 1)(q - 1). Selects number e relatively prime to n Finds inverse of e modulo n Publishes e and m

Page 8: Introduction to Cryptography Lecture 9. Public – Key Cryptosystems Each participant has a public key and a private key. It should be infeasible to determine

The RSA Public – Key Cryptosystem

To encrypt the message x: Bob computes: . Bob sends y to Alice.

To Decrypt the message y: Alice computes: .

mxy e mod

myx d mod

Page 9: Introduction to Cryptography Lecture 9. Public – Key Cryptosystems Each participant has a public key and a private key. It should be infeasible to determine

The RSA Public – Key Cryptosystem

Example: p =127, q = 223. Then m = 28321 and n = 27972 Let e = 5623, check gcd(n,e) = 1. Then using Extended Euclidean Algorithm

d = 22495. Public Key: (5623, 28321).

Page 10: Introduction to Cryptography Lecture 9. Public – Key Cryptosystems Each participant has a public key and a private key. It should be infeasible to determine

The RSA Public – Key Cryptosystem

Example: Let the message be x = 3620. Then Alice gets one and decrypts it Then

.2784528321mod36205623 y

.362028321mod2784522495 x

Page 11: Introduction to Cryptography Lecture 9. Public – Key Cryptosystems Each participant has a public key and a private key. It should be infeasible to determine

The RSA Public – Key Cryptosystem

Why does this method work?

Last step is a little bit more complicate How secure is RSA? Can opponent deduce d and n from (m,e)?

The opponent can find n and d only if he can factor m.

.modmod)()mod( xmxmxmxy eddeded

Page 12: Introduction to Cryptography Lecture 9. Public – Key Cryptosystems Each participant has a public key and a private key. It should be infeasible to determine

Factoring

Problem of factoring a number is very hard Fermat’s factoring method sometimes can

be used to find any large factors of a number fair quickly (pg.251)

Want to make sure Fermat’s factoring method does not work for your key

p and q should be at least 155 decimal digits each

Page 13: Introduction to Cryptography Lecture 9. Public – Key Cryptosystems Each participant has a public key and a private key. It should be infeasible to determine

Homework

Read pg.286-293. Exercises: 2(a), 4(c), 5(a) on pg.294. Those questions will be a part of your

collected homework.