RSA cryptosystem--preview Suppose n=p  q and  (n)=(p-1)(q-1), where p and q are big primes. Select (find) a and b, such that a  b=1 mod  (n). K=(n,p,q,a,b),

Slides:



Advertisements
Similar presentations
RSA.
Advertisements

RSA COSC 201 ST. MARY’S COLLEGE OF MARYLAND FALL 2012 RSA.
Cryptography and Network Security
Chapter 8 – Introduction to Number Theory. Prime Numbers prime numbers only have divisors of 1 and self –they cannot be written as a product of other.
Announcements: 1. Congrats on reaching the halfway point once again! 2. DES graded soon 3. Short “pop” quiz on Ch 3. (Thursday at earliest) 4. Reminder:
Public Key Cryptosystems - RSA Receiver Sender Eavesdroppe r p q p q p q p and q prime.
Data encryption with big prime numbers
22C:19 Discrete Structures Integers and Modular Arithmetic
Public Key Encryption Algorithm
Lecture 8: Primality Testing and Factoring Piotr Faliszewski
22C:19 Discrete Math Integers and Modular Arithmetic Fall 2010 Sukumar Ghosh.
Lecture 3.3: Public Key Cryptography III CS 436/636/736 Spring 2012 Nitesh Saxena.
1 The RSA Algorithm Supplementary Notes Prepared by Raymond Wong Presented by Raymond Wong.
Great Theoretical Ideas in Computer Science.
Session 4 Asymmetric ciphers.
Foundations of Network and Computer Security J J ohn Black Lecture #10 Sep 18 th 2009 CSCI 6268/TLEN 5550, Fall 2009.
and Factoring Integers (I)
Announcements: 1. Pass in Homework 5 now. 2. Term project groups and topics due by Friday 1.Can use discussion forum to find teammates 3. HW6 posted, due.
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:
Announcements: 1. Congrats on reaching the halfway point once again! 2. Reminder: HW5 due tomorrow, HW6 due Tuesday after break 3. Term project groups.
1 Lecture #10 Public Key Algorithms HAIT Summer 2005 Shimrit Tzur-David.
and Factoring Integers
WS Algorithmentheorie 03 – Randomized Algorithms (Public Key Cryptosystems) Prof. Dr. Th. Ottmann.
Cryptography1 CPSC 3730 Cryptography Chapter 9 Public Key Cryptography and RSA.
Chapter 8 – Introduction to Number Theory Prime Numbers  prime numbers only have divisors of 1 and self they cannot be written as a product of other numbers.
Theory I Algorithm Design and Analysis (9 – Randomized algorithms) Prof. Dr. Th. Ottmann.
WS Algorithmentheorie 03 – Randomized Algorithms (Public Key Cryptosystems) Prof. Dr. Th. Ottmann.
Chapter 8 – Introduction to Number Theory Prime Numbers
Cryptography and Network Security Chapter 8. Chapter 8 – Introduction to Number Theory The Devil said to Daniel Webster: "Set me a task I can't carry.
Chapter 8 – Introduction to Number Theory Prime Numbers  prime numbers only have divisors of 1 and self they cannot be written as a product of other numbers.
RSA Question 2 Bob thinks that p and q are primes but p isn’t. Then, Bob thinks ©Bob:=(p-1)(q-1) = Á(n). Is this true ? Bob chooses a random e (1 < e
Public key ciphers 1 Session 5.
“RSA”. RSA  by Rivest, Shamir & Adleman of MIT in 1977  best known & widely used public-key scheme  RSA is a block cipher, plain & cipher text are.
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.
Topic 18: RSA Implementation and Security
The RSA Algorithm Rocky K. C. Chang, March
Prime Numbers Prime numbers only have divisors of 1 and self
Cryptography A little number theory Public/private key cryptography –Based on slides of William Stallings and Lawrie Brown.

Introduction to Modular Arithmetic and Public Key Cryptography.
Information Security and Management 4. Finite Fields 8
RSA Parameter Generation Bob needs to: - find 2 large primes p,q - find e s.t. gcd(e, Á (pq))=1 Good news: - primes are fairly common: there are about.
The Complexity of Primality Testing. What is Primality Testing? Testing whether an integer is prime or not. – An integer p is prime if the only integers.
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.
MA/CSSE 473 Day 11 Primality testing summary Data Encryption RSA.
Analyzing and Testing a justified Prime Number Jeong-kyu YANG Seok-kyu Kang ( Mid-term Presentation )
Cryptography Lecture 7: RSA Primality Testing Piotr Faliszewski.
Introduction to Algorithms Second Edition by Cormen, Leiserson, Rivest & Stein Chapter 31.
MA/CSSE 473 Day 10 Primality testing summary Data Encryption RSA.
Algebra of RSA codes Yinduo Ma Tong Li. Ron Rivest, Adi Shamir and Leonard Adleman.
22C:19 Discrete Structures Integers and Modular Arithmetic Fall 2014 Sukumar Ghosh.
Chapter 3 – Public Key Cryptography and RSA (A). Private-Key Cryptography traditional private/secret/single-key cryptography uses one key shared by both.
Scott CH Huang COM 5336 Cryptography Lecture 6 Public Key Cryptography & RSA Scott CH Huang COM 5336 Cryptography Lecture 6.
Public Key Cryptosystems RSA Diffie-Hellman Department of Computer Engineering Sharif University of Technology 3/8/2006.
Lecture 6.1: Misc. Topics: Number Theory CS 250, Discrete Structures, Fall 2011 Nitesh Saxena.
ENCRYPTION TAKE 2: PRACTICAL DETAILS David Kauchak CS52 – Spring 2015.
9/22/15UB Fall 2015 CSE565: S. Upadhyaya Lec 7.1 CSE565: Computer Security Lecture 7 Number Theory Concepts Shambhu Upadhyaya Computer Science & Eng. University.
Ch1 - Algorithms with numbers Basic arithmetic Basic arithmetic Addition Addition Multiplication Multiplication Division Division Modular arithmetic Modular.
6.3 Primality Testing. p2. (1) Prime numbers 1. How to generate large prime numbers? (1) Generate as candidate a random odd number n of appropriate size.
Implementation of Public Key Encryption Algorithms
Data encryption with big prime numbers DANIEL FREEMAN, SLU.
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.
Foundations of Network and Computer Security J J ohn Black CSCI 6268/TLEN 5550, Spring 2014.
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
CSEN 1001 Computer and Network Security Amr El Mougy Mouaz ElAbsawi.
1 The RSA Algorithm Rocky K. C. Chang February 23, 2007.
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.
Public Key Cryptosystems - RSA
RSA Cryptosystem Bits PCs Memory MB ,000 4GB 1,020
Presentation transcript:

RSA cryptosystem--preview Suppose n=p  q and  (n)=(p-1)(q-1), where p and q are big primes. Select (find) a and b, such that a  b=1 mod  (n). K=(n,p,q,a,b), publicize n,b, but keep p,q,a secret. For any x,y  Z n, define –e K (x)= x b mod n (encryption) –d K (y)= y a mod n (decryption: (x b ) a mod n=x) Of course, from n,b, it is very difficult to get a (as well as p,q,  (n)).

RSA--implementation 1.Generate two large primes, p and q. 2.n  pq and  (n)  (p-1)(q-1) 3.Chose a random b (1< b <  (n)) such that gcd(b,  (n))=1 4.a  b -1 mod  (n) 5.The public key is (n,b) and the private key is (p,q,a). Could you raise any questions about RSA?

Questions about RSA How to generate large primes? How to compute the modular-exponentiation (encryption & decryption) efficiently? RSA attack: attempt to factor n and how? RSA uses numbers, therefore need encoding for normal text.

RSA—primality testing How to generate large primes? –Select a random large number –Test whether or not the number is a prime. How often a random selected number is a prime? –Let  (N) be the number of primes  N. –Prime number theory:  (N)  N/lnN –Therefore the probability of a random number being a prime is 1/lnN –Suppose n = pq is 1024 bits, so p and q are 512 bits, 1/ln2 512  1/355.

(yes-biased) Monte Carlo algorithm: –For yes-no decision problem –Random algorithm (randomly choose a number) –If the algorithm gives answer “yes”, it is always correct –It the answer is “no”, it may be incorrect. RSA—primality testing Therefore, may try several times such that the probability of the incorrectness for “no” is extremely small. Las Vegas algorithm: may not give answer, but any answer it gives is correct. Probabilistic algorithms: the algorithms which can be wrong in some cases (i.e., probably, or with certain probability)

RSA—primality testing (yes-biased) Monte Carlo algorithm: –Solovay-Strassen algorithm –Miller-Rabin algorithm A good news: confirmed primality testing algorithm –By three Indian scientists.

Solovay-Strassen primality test Given integer n, is n a composite? –Choose a random integer a ( 1 < a < n) –x  –If x=0 then return “yes” (n is a composite) –y  a (n-1)/2 (mod n) –If x  y (mod n) then return “no” (n is a prime) ( of course maybe incorrect ) else return “yes” (n is a composite). a n ()

The proof of the algorithm –If n is a prime, the  a (n-1)/2 mod n for any a –If n is a composite, then for some a,  a (n-1)/2, Call n to be an Euler pseudo-prime to base a. For example, = -1  mod 91. but others not. At most half of a  Z n *, n is a pseudo-prime to a. So error probability is at most ½. –Test k different a, (1/2) k. Solovay-Strassen primality test a n () a n () ()

RSA attacks Computing  (n)– no easier than factoring n. Decryption Exponent a—no easier than factoring n So the security of RSA is based on the difficulty of factorization of large numbers. Factoring algorithms –Trial division– up to  n –Pollard p-1 algorithm

RSA attack—Pollard p-1 algorithm Given n, and select a random B (not too big) –a  2 –For j=2 to B a  a j mod n –d  gcd(a-1,n) –If d > 1 then return d (d is a factor of n) else return ‘failure’.

The correctness of p-1 algorithm 1.Suppose p is a prime factor of n, 2.Assume for all q, q≤B, q is (power of) a prime factor of p-1. 3.Then p-1| B!, suppose B! = (p-1)t. 4.The final a  2 B! mod n, since p|n, so a  2 B! mod p 5.We know, 2 p-1  1 mod p, so 6.a  2 B! mod p = 2 (p-1)t mod p  1 t mod p  1 mod p 7.So p | (a-1), thus p|gcd(a-1,n) Conclusion: if p or q of factors of n is not selected in a correct way, n will be easily factored.

P-1 example n= , B=180 Then a = , and d= As a result: =135979* Here =2*3*131*173

RSA summary RSA principle RSA implementation –Generate large primes –Compute x c mod n – square-and-multiply RSA attacks Conclusion: p and q must be appropriately selected large primes.