Public Key Cryptosystems - RSA

Slides:



Advertisements
Similar presentations
RSA COSC 201 ST. MARY’S COLLEGE OF MARYLAND FALL 2012 RSA.
Advertisements

Public Key Cryptosystems - RSA Receiver Sender Eavesdroppe r p q p q p q p and q prime.
Public Key Encryption Algorithm
Primality Testing By Ho, Ching Hei Cheung, Wai Kwok.
7. Asymmetric encryption-
Great Theoretical Ideas in Computer Science.
Session 4 Asymmetric ciphers.
The RSA Cryptosystem and Factoring Integers (II) Rong-Jaye Chen.
Cryptography Lecture 11: Oct 12. Cryptography AliceBob Cryptography is the study of methods for sending and receiving secret messages. adversary Goal:
Cryptography1 CPSC 3730 Cryptography Chapter 9 Public Key Cryptography and RSA.
Theory I Algorithm Design and Analysis (9 – Randomized algorithms) Prof. Dr. Th. Ottmann.
Public Key Algorithms 4/17/2017 M. Chatterjee.
CPE5021 Advanced Network Security --- Advanced Cryptography: RSA and its implementation --- Lecture 1.1 Last lecture we saw the data encryption standard.
Lecture 6: Public Key Cryptography
Public Key Model 8. Cryptography part 2.
The RSA Algorithm Based on the idea that factorization of integers into their prime factors is hard. ★ n=p . q, where p and q are distinct primes Proposed.
 Introduction  Requirements for RSA  Ingredients for RSA  RSA Algorithm  RSA Example  Problems on RSA.
1 CIS 5371 Cryptography 8. Asymmetric encryption-.
Quadratic Residuosity and Two Distinct Prime Factor ZK Protocols By Stephen Hall.
The RSA Algorithm Rocky K. C. Chang, March
Prime Numbers Prime numbers only have divisors of 1 and self
1 AN EFFICIENT METHOD FOR FACTORING RABIN SCHEME SATTAR J ABOUD 1, 2 MAMOUN S. AL RABABAA and MOHAMMAD A AL-FAYOUMI 1 1 Middle East University for Graduate.
Great Theoretical Ideas in Computer Science.
10/1/2015 9:38:06 AM1AIIS. OUTLINE Introduction Goals In Cryptography Secrete Key Cryptography Public Key Cryptograpgy Digital Signatures 2 10/1/2015.
Cryptography Dec 29. This Lecture In this last lecture for number theory, we will see probably the most important application of number theory in computer.
Digital Signatures A primer 1. Why public key cryptography? With secret key algorithms Number of key pairs to be generated is extremely large If there.
Implementing RSA Encryption in Java
Introduction to Algorithms Second Edition by Cormen, Leiserson, Rivest & Stein Chapter 31.
Modular Arithmetic with Applications to Cryptography Lecture 47 Section 10.4 Wed, Apr 13, 2005.
A Method for Obtaining Digital Signatures and Public-key Cryptosystems
1 Public-Key Cryptography and Message Authentication.
Cryptography and Network Security Chapter 9 - Public-Key Cryptography
CSE 311: Foundations of Computing Fall 2014 Lecture 12: Primes, GCD.
Ch1 - Algorithms with numbers Basic arithmetic Basic arithmetic Addition Addition Multiplication Multiplication Division Division Modular arithmetic Modular.
Encryption on the Internet Jeff Cohen. Keeping Information Secret What information do we want to be secret? –Credit card number –Social security number.
Computer Security Lecture 5 Ch.9 Public-Key Cryptography And RSA Prepared by Dr. Lamiaa Elshenawy.
Week 4 - Wednesday.  What did we talk about last time?  Finished DES  AES.
Primality Testing. Introduction The primality test provides the probability of whether or not a large number is prime. Several theorems including Fermat’s.
Lecture 3 (Chapter 9) Public-Key Cryptography and RSA Prepared by Dr. Lamiaa M. Elshenawy 1.
Chapter 1 Algorithms with Numbers. Bases and Logs How many digits does it take to represent the number N >= 0 in base 2? With k digits the largest number.
ECE454/599 Computer and Network Security Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2012.
Breaking Cryptosystems Joshua Langford University of Texas at Tyler Fall 2007 Advisor: Dr. Ramona Ranalli Alger.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
Lecture 6. RSA Use in Encryption to encrypt a message M the sender: – obtains public key of recipient PU={e,n} – computes: C = M e mod n, where 0≤M
Information and Computer Security CPIS 312 Lab 8 1 Asymmetric Key Algorithms RSA Algorithm TRIGUI Mohamed Salim.
1 The RSA Algorithm Rocky K. C. Chang February 23, 2007.
Lecture 5 Asymmetric Cryptography. Private-Key Cryptography Traditional private/secret/single key cryptography uses one key Shared by both sender and.
MA/CSSE 473 Day 9 Primality Testing Encryption Intro.
CS480 Cryptography and Information Security Huiping Guo Department of Computer Science California State University, Los Angeles 14. Digital signature.
Revision. Cryptography depends on some properties of prime numbers. One of these is that it is rather easy to generate large prime numbers, but much harder.
A Prime Example CS Lecture 20 A positive integer p  2 is prime if the only positive integers that divide p are 1 and p itself. Positive integers.
RSA Encryption Greg Gronn Laura Trimmer. RSA Encryption  Requires two 30 digit prime numbers to create an encoding/decryption key.  Goal: analyze different.
Overview Modern public-key cryptosystems: RSA
Encryption Take 2: Practical details
Public Key Cryptography
Attacks on Public Key Encryption Algorithms
Mathematics of Cryptography
CSE565: Computer Security Lecture 7 Number Theory Concepts
Number-Theoretic Algorithms (UNIT-4)
Outline of implementation
Number Theory (Chapter 7)
RSA Cryptosystem Bits PCs Memory MB ,000 4GB 1,020
Rivest, Shamir and Adleman
Public-key encryption
Cryptography: Basics (2)
Chapter 4-3 Prime Factorization
Chapter -5 PUBLIC-KEY CRYPTOGRAPHY AND RSA
Chapter 13 Digital Signature
Introduction to Cryptography
The RSA Public-Key Encryption Algorithm
Presentation transcript:

Public Key Cryptosystems - RSA Receiver Sender 57 17 p p 41 19 q q Attacker 53 p and q prime p 47 q

Public Key Cryptosystems - RSA Compute numbers n = p*q 2337 323 Receiver Sender 57 17 p p 41 19 q q Attacker 53 p and q prime p 2491 47 q

Public Key Cryptosystems - RSA Choose e prime relative to (p-1)(q-1) 2337 43 323 23 Receiver Sender 57 17 p p 41 19 q q Attacker 53 p and q prime p 2491 41 47 q

Public Key Cryptosystems - RSA Publish <n,e> pair as the public key 2337 43 323 23 Receiver Sender 57 17 p p 41 19 q q Attacker 53 p and q prime p 2491 41 47 q

Public Key Cryptosystems - RSA Find d such that (e*d -1) is divisible by (p-1)(q-1) 1667 2337 43 263 323 23 Receiver Sender 57 17 p p 41 19 q q 2217 Attacker 53 p and q prime p 2491 41 47 q

Public Key Cryptosystems - RSA Keep <d,n> as the private key 1667 2337 43 263 323 23 Receiver Sender 57 17 p p 41 19 q q 2217 Attacker 53 p and q prime p 2491 41 47 q

Public Key Cryptosystems - RSA Toss p and q 1667 2337 43 263 323 23 Receiver Sender 2217 Attacker 2491 41

Public Key Cryptosystems - RSA 1667 2337 43 263 323 23 Receiver m43 mod 2337 Sender 2217 Attacker 2491 41

Public Key Cryptosystems - RSA 1667 2337 43 263 323 23 Receiver Sender 2217 Attacker (m 43 mod 2337)1667 mod 2337 2491 41

Public Key Cryptosystems - RSA, signing 1667 2337 43 263 323 23 Receiver Sender m263 mod 323 2217 Attacker 2491 41

Public Key Cryptosystems - RSA, signing 1667 2337 43 263 323 23 Receiver Sender 2217 Attacker (m263 mod 323)23 mod 323 2491 41

Public Key Cryptosystems - RSA, exponentiating 55637 25663 mod 78837

Public Key Cryptosystems - RSA, exponentiating 55637 25663 mod 78837 Yikes!

Public Key Cryptosystems - RSA, exponentiating 55637 25663 mod 78837 Yikes! Rescued by: a x*b y mod p = (a x mod p)*(b y mod p) mod p

Public Key Cryptosystems - RSA, exponentiating 55637 25663 mod 78837 2 25663 mod 78837 ... That is, do the modular reduction after each multiplication.

Public Key Cryptosystems - RSA, find primes Probability that a random number n is prime: 1/ln(n) For 100 digit number this is 1/230. Probability that a random number n is prime: 1/ln(n) For 100 digit number this is 1/230. But how to test for being prime? If p is prime and 0 < a < p, then a p-1 = 1 mod p Ex: 3(5-1) = 81 = 1 mod 5 36(29-1) = 37711171281396032013366321198900157303750656 = 1 mod 29 Pr (p isn't prime but a p-1 = 1 mod p) = 1/1000000000000000

Public Key Cryptosystems - RSA, find primes Probability that a random number n is prime: 1/ln(n) For 100 digit number this is 1/230. But how to test for being prime? Probability that a random number n is prime: 1/ln(n) For 100 digit number this is 1/230. But how to test for being prime? If p is prime and 0 < a < p, then a p-1 = 1 mod p Ex: 3(5-1) = 81 = 1 mod 5 36(29-1) = 37711171281396032013366321198900157303750656 = 1 mod 29 Pr (p isn't prime but a p-1 = 1 mod p) = 1/1000000000000000

Public Key Cryptosystems - RSA, find primes Probability that a random number n is prime: 1/ln(n) For 100 digit number this is 1/230. But how to test for being prime? If p is prime and 0 < a < p, then a p-1 = 1 mod p Ex: 3(5-1) = 81 = 1 mod 5 36(29-1) = 37711171281396032013366321198900157303750656 = 1 mod 29 Probability that a random number n is prime: 1/ln(n) For 100 digit number this is 1/230. But how to test for being prime? If p is prime and 0 < a < p, then a p-1 = 1 mod p Ex: 3(5-1) = 81 = 1 mod 5 36(29-1) = 37711171281396032013366321198900157303750656 = 1 mod 29 Pr (p isn't prime but a p-1 = 1 mod p) = 1/1000000000000000

Public Key Cryptosystems - RSA, find primes Probability that a random number n is prime: 1/ln(n) For 100 digit number this is 1/230. But how to test for being prime? If p is prime and 0 < a < p, then a p-1 = 1 mod p Ex: 3(5-1) = 81 = 1 mod 5 36(29-1) = 37711171281396032013366321198900157303750656 = 1 mod 29 Pr (p isn't prime but a p-1 = 1 mod p) = 1/10000000000000 (See http://gauss.ececs.uc.edu/Courses/c653/lectures/Math/Fermat/fermat.html) Probability that a random number n is prime: 1/ln(n) For 100 digit number this is 1/230. But how to test for being prime? If p is prime and 0 < a < p, then a p-1 = 1 mod p Ex: 3(5-1) = 81 = 1 mod 5 36(29-1) = 37711171281396032013366321198900157303750656 = 1 mod 29 Pr (p isn't prime but a p-1 = 1 mod p) = 1/1000000000000000

Public Key Cryptosystems - RSA, find primes But we need some help to use the above - Define: trivial square roots of 1 mod p : 1 mod p and -1 mod p 1 mod p -1 mod p Fact 1: If p is prime, there are no non-trivial square roots of 1 mod p Let x be a square root of 1 mod p. Then x2 = 1 mod p. Or, (x-1)(x+1) = 0 mod p. But x-1 and x+1 are divisible by prime p. Hence, the product cannot be divisible by p. Therefore x other than -1 or 1 does not exist. 1 2 3 . . . p-2 p-1 Probability that a random number n is prime: 1/ln(n) For 100 digit number this is 1/230. But how to test for being prime? If p is prime and 0 < a < p, then a p-1 = 1 mod p Ex: 3(5-1) = 81 = 1 mod 5 36(29-1) = 37711171281396032013366321198900157303750656 = 1 mod 29 Pr (p isn't prime but a p-1 = 1 mod p) = 1/1000000000000000

Public Key Cryptosystems - RSA, find primes Fact 2: If p is prime, the exponent p-1 is an even number Probability that a random number n is prime: 1/ln(n) For 100 digit number this is 1/230. But how to test for being prime? If p is prime and 0 < a < p, then a p-1 = 1 mod p Ex: 3(5-1) = 81 = 1 mod 5 36(29-1) = 37711171281396032013366321198900157303750656 = 1 mod 29 Pr (p isn't prime but a p-1 = 1 mod p) = 1/1000000000000000

Public Key Cryptosystems - RSA, find primes Fact 2: If p is prime, the exponent p-1 is an even number Fact 3: If p is not prime then the probability that there is a square root of a p-1 mod p that is neither 1 mod p nor -1 mod p is not greater than 1/4, assuming a is an integer chosen randomly between 1 and p-1. Probability that a random number n is prime: 1/ln(n) For 100 digit number this is 1/230. But how to test for being prime? If p is prime and 0 < a < p, then a p-1 = 1 mod p Ex: 3(5-1) = 81 = 1 mod 5 36(29-1) = 37711171281396032013366321198900157303750656 = 1 mod 29 Pr (p isn't prime but a p-1 = 1 mod p) = 1/1000000000000000

Public Key Cryptosystems - RSA, find primes Fact 2: If p is prime, the exponent p-1 is an even number Fact 3: If p is not prime then the probability that there is a square root of a p-1 mod p that is neither 1 mod p nor -1 mod p is not greater than 1/4, assuming a is an integer chosen randomly between 0 and p-1. An algorithm to test p for being a prime number: If p is even, return false (p is not prime) Repeat the following at most 100 times: Choose a random integer a such that 0 ≤ a < p. If some square root of a p-1 mod p is neither 1 mod p nor -1 mod p then return false (p is not prime). Return probably (p is prime with 2-200 probability of error) Probability that a random number n is prime: 1/ln(n) For 100 digit number this is 1/230. But how to test for being prime? If p is prime and 0 < a < p, then a p-1 = 1 mod p Ex: 3(5-1) = 81 = 1 mod 5 36(29-1) = 37711171281396032013366321198900157303750656 = 1 mod 29 Pr (p isn't prime but a p-1 = 1 mod p) = 1/1000000000000000

} Public Key Cryptosystems - RSA, find primes Can always express integer p-1 as 2 bm for some odd number m Ex: 428 = 2 2 *107 Here is the 2 b (b = 2) 110101100 Here is the odd number (m = 107) Instead of finding the square root of a p-1 mod p, write p-1 = 2bm then check whether a m = 1 mod p. If so, there are no non-trivial square roots. Otherwise check whether a m21 = 1 mod p. If so and if the square root of the left side is a m mod p which, if not equal to -1 mod p, must be a non-trivial root of unity of a m21 mod p and therefore a m2b mod p. If a m21 ≠ 1 mod p then repeat for a m22 and so on, possibly up to a m2b. } } (See http://gauss.ececs.uc.edu/Courses/c653/lectures/Math/PrimesTest/mr.html)

Public Key Cryptosystems - RSA, picking d and e Choose e first, then find p and q so (p-1) and (q-1) are relatively prime to e RSA is no less secure if e is always the same and small Popular values for e are 3 and 65537 For e = 3, though, must pad message or else ciphertext = plaintext Choose p ≡ 2 mod 3 so p-1 = 1 mod 3 So, choose random odd number, multiply by 3 and add 2, then test for primality