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 <

Slides:



Advertisements
Similar presentations
RSA.
Advertisements

RSA COSC 201 ST. MARY’S COLLEGE OF MARYLAND FALL 2012 RSA.
Digital Signatures Good properties of hand-written signatures: 1. Signature is authentic. 2. Signature is unforgeable. 3. Signature is not reusable (it.
Prime recognition and factorization
WS Algorithmentheorie 03 – Randomized Algorithms (Primality Testing) Prof. Dr. Th. Ottmann.
CSE115/ENGR160 Discrete Mathematics 03/15/12
Lecture 8: Primality Testing and Factoring Piotr Faliszewski
COM 5336 Cryptography Lecture 7a Primality Testing
Notation Intro. Number Theory Online Cryptography Course Dan Boneh
RSA & F ACTORING I NTEGERS BY: MIKE NEUMILLER & BRIAN YARBROUGH.
1 The RSA Algorithm Supplementary Notes Prepared by Raymond Wong Presented by Raymond Wong.
CNS2010handout 8 :: introduction to number theory1 computer and network security matt barrie.
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.
RSA ( Rivest, Shamir, Adleman) Public Key Cryptosystem
The RSA Cryptosystem and Factoring Integers (II) Rong-Jaye Chen.
1 Cryptosystems Based on Discrete Logarithms. 2 Outline [1] Discrete Logarithm Problem [2] Algorithms for Discrete Logarithm –A trivial algorithm –Shanks’
Factoring 1 Factoring Factoring 2 Factoring  Security of RSA algorithm depends on (presumed) difficulty of factoring o Given N = pq, find p or q and.
Introduction to Modern Cryptography Homework assignments.
CSE115/ENGR160 Discrete Mathematics 03/17/11 Ming-Hsuan Yang UC Merced 1.
Discrete Log 1 Discrete Log. Discrete Log 2 Discrete Logarithm  Discrete log problem:  Given p, g and g a (mod p), determine a o This would break Diffie-Hellman.
and Factoring Integers
Theory I Algorithm Design and Analysis (9 – Randomized algorithms) Prof. Dr. Th. Ottmann.
Factoring Algorithms Ref: D. Stinson, Cryptography - Theory and Practice, 2001.
Chapter 8 – Introduction to Number Theory Prime Numbers
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.
Lecture 5 Overview Does DES Work? Differential Cryptanalysis Idea – Use two plaintext that barely differ – Study the difference in the corresponding.
1 CIS 5371 Cryptography 8. Asymmetric encryption-.
Topic 18: RSA Implementation and Security
The RSA Algorithm Rocky K. C. Chang, March

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.
MATH 224 – Discrete Mathematics
Research on the Discrete Logarithm Problem Wang Ping Meng Xuemei
Prelude to Public-Key Cryptography Rocky K. C. Chang, February
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.
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.
Prabhas Chongstitvatana1 Factorizing large integers Finding the unique decomposition of n into a product of prime factors. Factorize(n) if n is prime done.
Cryptography Lecture 9 Stefan Dziembowski
Implementing RSA Encryption in Java
Modular Arithmetic with Applications to Cryptography Lecture 47 Section 10.4 Wed, Apr 13, 2005.
Discrete Logarithm(s) (DLs) Fix a prime p. Let a, b be nonzero integers (mod p). The problem of finding x such that a x ≡ b (mod p) is called the discrete.
Lecture 8 Overview. Analysis of Algorithms Algorithms – Time Complexity – Space Complexity An algorithm whose time complexity is bounded by a polynomial.
6.4 Factoring.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Scott CH Huang COM 5336 Cryptography Lecture 6 Public Key Cryptography & RSA Scott CH Huang COM 5336 Cryptography Lecture 6.
Hard Problems Some problems are hard to solve.  No polynomial time algorithm is known.  E.g., NP-hard problems such as machine scheduling, bin packing,
Attacking RSA Brian Winant Reference “Twenty Years of Attacks on the RSA Cryptosystem” By Dan Boneh In Notices of the American Mathematical.
Ch1 - Algorithms with numbers Basic arithmetic Basic arithmetic Addition Addition Multiplication Multiplication Division Division Modular arithmetic Modular.
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),
Implementation Issues for Public Key Algorithms
Primality Testing. Introduction The primality test provides the probability of whether or not a large number is prime. Several theorems including Fermat’s.
Implementation of Public Key Encryption Algorithms
Introduction to Elliptic Curve Cryptography CSCI 5857: Encoding and Encryption.
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.
1 The RSA Algorithm Rocky K. C. Chang February 23, 2007.
Key Exchange in Systems VPN usually has two phases –Handshake protocol: key exchange between parties sets symmetric keys –Traffic protocol: communication.
Hard Problems Some problems are hard to solve.  No polynomial time algorithm is known.  E.g., NP-hard problems such as machine scheduling, bin packing,
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.
Public Key Encryption Major topics The RSA scheme was devised in 1978
Topic 26: Discrete LOG Applications
PUBLIC-KEY ENCRYPTION Focusing on RSA
Outline of implementation
RSA Cryptosystem Bits PCs Memory MB ,000 4GB 1,020
Topic 25: Discrete LOG, DDH + Attacks on Plain RSA
Number Theory and Euclidean Algorithm
Where Complexity Finally Comes In Handy…
Where Complexity Finally Comes In Handy…
Mathematical Background for Cryptography
Where Complexity Finally Comes In Handy…
Presentation transcript:

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 < ©Bob) such that gcd(e,ÁBob)=1. Then, d = e-1 mod ©Bob. Example: p = 9, q = 5, ©Bob = 32, e = 3, then d = 11. What is the encryption of 2 ? What is the decryption of the encryption of 2 ?

RSA Question 3 Let’s compute a table of the products of all ·512-bit primes. If we have such a table, how do we find our n ? But how much space would such a table need ? How many primes of ·512 bits ? How many entries in our table ? How many bits per entry ? Total number of bits ? Atoms in the universe: about 1080

Breaking RSA Obvious ways how to try to break RSA: Factor n. Compute ©(n). Compute d. Observation: Computing ©(n) is not easier than factoring n.

Breaking RSA Obvious ways how to try to break RSA: Factor n. Compute ©(n). Compute d. Note: If we know d, then we can use a polynomial-time randomized algorithm to factor n (we will not do this). Thus, computing d is not easier than factoring n. Thus: We will try the factoring approach. Note: Does this mean that breaking RSA is as hard as factoring ?

Factoring Algorithms many algorithms (no polynomial-time!) the most effective on very large numbers (and their running times): quadratic sieve: O(e(1+o(1))(ln n . n ln n) ) elliptic curve: O(e(1+o(1))(2 ln p . ln ln p) ) number field sieve: O(e(1.92+o(1))(ln n) (ln ln n) ) where p is denotes the smallest prime factor of n Note: For RSA, quadratic sieve is better than elliptic curve, number field sieve is even faster (for very large numbers). In 1999 it was used to factor RSA-155 (a 155-bit number). 1/2 1/2 1/3 2/3

Simple Factoring Algorithms We will look at some simpler factoring algorithms. We will usually find one non-trivial factor of n – how to get the complete factorization ? The simplest factoring algorithm: trail division. Does it work ?

Simple Factoring Algorithms Pollard p-1 factoring algorithm (n,B): Input: odd number n, bound B b := 2 for j from 2 to B do: b := bj mod n d := gcd(b-1,n) if 1 < d < n then: return d return “failure” Note: From 1974, see page 182. Sometimes works for larger integers.

Simple Factoring Algorithms What is the running time of Pollard p-1 ? If the algorithm returns d, is it a non-trivial factor of n ? Note: Works only if n has a prime factor p such that p-1 has only “small” prime factors. For example for RSA, we can have p,q such that p=2p1+1 and q=2q1+1 where p1 and q1 are also primes. Lenstra’s elliptic curve method is a generalization of this algorithm (we will not go into it).

Another Factoring Algorithm Idea (base for quadratic sieve and number field sieve): If x  § y (mod n) and x2 ´ y2 (mod n), then gcd(x+y,n) and gcd(x-y,n) are nontrivial factors of n. Example: 102 ´ 322 (mod 77) So: gcd(10+32,77) = 7 and gcd(10-32,77) = 11 are nontrivial factors of 77 The catch: how to find x and y ?

Another Factoring Algorithm Many algorithms use a factor base: a set of the smallest b primes. Idea: Suppose we find several numbers z such that all prime factors of z2 mod n are in the factor base. Take a product of several of these z2’s so that each prime in the factor base is used an even number of times. That will give us x2 ´ y2 (mod n). If x  § y (mod n), we get a nontrivial factor of n.

Another Factoring Algorithm Example 1: Let n = 197209 and let {2, 3, 5} be our factor base. Consider the following z’s: 159316 and 133218. 1593162 ≡ 24 . 32 . 51 (mod n) 1332182 ≡ 20 . 34 . 51 (mod n) Then, (159316 . 133218)2 ≡ (22 . 33 . 5)2 (mod n). Reducing both sides mod n, we get 1263082 ≡ 5402 (mod n) Use the Euclidean algorithm to find gcd(126308−540,n)=199. We obtain the factorization 197209 = 199 . 991.

Another Factoring Algorithm Example 2: Let n = 15770708441 and let {2, 3, 5, 7, 11, 13} be our factor base. Consider the following z’s: 8340934156, 12044942944, and 2773700011. 83409341562 ≡ 3 . 7 (mod n) 120449429442 ≡ 2 . 7 . 13 (mod n) 2773700011^2 ≡ 2 . 3 . 13 (mod n) Then, (8340934156 . 12044942944 . 2773700011)2 ≡ (2 . 3 . 7 . 13)2 (mod n). Reducing mod n, we get 95034357852 ≡ 5462 (mod n) Then, gcd(9503435785-546,n)=115759.

Another Factoring Algorithm - Vectors Suppose the factor base is {p1, …, pb} and let z by such that all prime factors of z2 mod n are in the factor base, e.g., z2 mod n = p1® p2® …pb® How many different z’s do we need ? For each z, look at the binary vector (®1 mod 2, … , ®b mod 2). For example, in Example 1, the binary vector for 159316 is (4 mod 2, 2 mod 2, 1 mod 2) = (0,0,1) and the vector for 133218 is (0 mod 2, 4 mod 2, 1 mod 2) = (0,0,1). We need a set of z’s that the sum of their binary vectors is (0,…,0). In Example 1: (0,0,1) + (0,0,1) = (0,0,0). What are the vectors for Example 2? 1 2 b

Another Factoring Algorithm – How many z’s Let b be the size of the factor base. Suppose we have c z’s. We need to have a set of vectors (one vector per z) so that they sum to (0,…,0). How large does c need to be ? Well… we also need to worry about the condition x  § y (mod n) – recall that we already have x2 ´ y2 (mod n). The good news is that x  § y (mod n) happens with probability · ½. (I.e. take a little larger c and it’s ok.)

Another Factoring Algorithm – Choosing z’s There are different ways to choose the z’s. In the random squares algorithm, the z’s are chosen randomly. Another possibility is to try integers of the form j+b(in)1/2c for small j and i=1,2,3,… These integers tend to be small when squared mod n. Note: quadratic sieve uses a sieving procedure to determine the z’s. Choosing the factor base: all primes smaller than 2(log n log log n) . ½