The RSA Cryptosystem and Factoring Integers (II) Rong-Jaye Chen.

Slides:



Advertisements
Similar presentations
Number Theory Algorithms and Cryptography Algorithms Prepared by John Reif, Ph.D. Analysis of Algorithms.
Advertisements

Prime recognition and factorization
Agrawal-Kayal-Saxena Presented by: Xiaosi Zhou
Primality Testing Patrick Lee 12 July 2003 (updated on 13 July 2003)
Data encryption with big prime numbers
22C:19 Discrete Structures Integers and Modular Arithmetic
BY : Darshana Chaturvedi.  INTRODUCTION  RSA ALGORITHM  EXAMPLES  RSA IS EFFECTIVE  FERMAT’S LITTLE THEOREM  EUCLID’S ALGORITHM  REFERENCES.
Lecture 8: Primality Testing and Factoring Piotr Faliszewski
22C:19 Discrete Math Integers and Modular Arithmetic Fall 2010 Sukumar Ghosh.
Notation Intro. Number Theory Online Cryptography Course Dan Boneh
7. Asymmetric encryption-
CNS2010handout 8 :: introduction to number theory1 computer and network security matt barrie.
and Factoring Integers (I)
1 Chapter 7– Introduction to Number Theory Instructor: 孫宏民 Room: EECS 6402, Tel: , Fax :
CS470, A.SelcukPublic Key Cryptography1 CS 470 Introduction to Applied Cryptography Instructor: Ali Aydin Selcuk.
and Factoring Integers
Cryptography & Number Theory
Theory I Algorithm Design and Analysis (9 – Randomized algorithms) Prof. Dr. Th. Ottmann.
Factoring Algorithms Ref: D. Stinson, Cryptography - Theory and Practice, 2001.
Public Key Algorithms 4/17/2017 M. Chatterjee.
Chapter 8 – Introduction to Number Theory Prime 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
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.
1 CIS 5371 Cryptography 8. Asymmetric encryption-.
Topic 18: RSA Implementation and Security
8. Data Integrity Techniques
The RSA Algorithm Rocky K. C. Chang, March
Prime Numbers Prime numbers only have divisors of 1 and self
Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations Copyright © The McGraw-Hill Companies, Inc. Permission required.
Cryptography A little number theory Public/private key cryptography –Based on slides of William Stallings and Lawrie Brown.

Cryptography Lecture 8 Stefan Dziembowski
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.
Information Security and Management 4. Finite Fields 8
Lecture 5-6 The RSA and Rabin Algorithms. The possibility of the public key cryptosystem was first publicly suggested by Diffie and Hellman. However,
RSA Ramki Thurimella.
Prelude to Public-Key Cryptography Rocky K. C. Chang, February
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.
1 Lect. 13 : Public Key Encryption RSA ElGamal. 2 Shamir Rivest Adleman RSA Public Key Systems  RSA is the first public key cryptosystem  Proposed in.
Cryptography Lecture 7: RSA Primality Testing Piotr Faliszewski.
Introduction to Algorithms Second Edition by Cormen, Leiserson, Rivest & Stein Chapter 31.
By Yernar.  Background  Key generation  Encryption  Decryption  Preset Bits  Example.
Modular Arithmetic with Applications to Cryptography Lecture 47 Section 10.4 Wed, Apr 13, 2005.
RSA and its Mathematics Behind July Topics  Modular Arithmetic  Greatest Common Divisor  Euler’s Identity  RSA algorithm  Security in RSA.
Lecture 8 Overview. Analysis of Algorithms Algorithms – Time Complexity – Space Complexity An algorithm whose time complexity is bounded by a polynomial.
6.4 Factoring.
22C:19 Discrete Structures Integers and Modular Arithmetic Fall 2014 Sukumar Ghosh.
Scott CH Huang COM 5336 Cryptography Lecture 6 Public Key Cryptography & RSA Scott CH Huang COM 5336 Cryptography Lecture 6.
Lecture 6.1: Misc. Topics: Number Theory CS 250, Discrete Structures, Fall 2011 Nitesh Saxena.
Ch1 - Algorithms with numbers Basic arithmetic Basic arithmetic Addition Addition Multiplication Multiplication Division Division Modular arithmetic Modular.
Great Theoretical Ideas in Computer Science for Some.
11 RSA Variants.  Scheme ◦ Select s.t. p and q = 3 mod 4 ◦ n=pq, public key =n, private key =p,q ◦ y= e k (x)=x (x+b) mod n ◦ x=d k (y)=  y mod n.
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.1: Public Key Cryptography I CS 436/636/736 Spring 2015 Nitesh Saxena.
CS480 Cryptography and Information Security
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
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.
Lecture 5 Asymmetric Cryptography. Private-Key Cryptography Traditional private/secret/single key cryptography uses one key Shared by both sender and.
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 Encryption Major topics The RSA scheme was devised in 1978
Chapter Applications of Number Theory Some Useful Results
PUBLIC-KEY ENCRYPTION Focusing on RSA
Introduction to Number Theory
RSA and El Gamal Cryptosystems
Topic 24: Finding Prime Numbers, RSA
Public Key Cryptosystems - RSA
RSA Cryptosystem Bits PCs Memory MB ,000 4GB 1,020
Analysis of the RSA Encryption Algorithm
Mathematical Background for Cryptography
Presentation transcript:

The RSA Cryptosystem and Factoring Integers (II) Rong-Jaye Chen

p2. OUTLINE  [1] Modular Arithmetic Algorithms  [2] The RSA Cryptosystem  [3] Quadratic Residues  [4] Primality Testing [5] Square Roots Modulo n [6] Factoring Algorithms [7] Other Attacks on RSA [8] The Rabin Cryptosystem [9] Semantics Security of RSA

p3. [5] Square Roots Modulo n 1. Fact Suppose that p is an odd prime and gcd(a,n)=1. Then the congruence y 2 =a (mod n) has no solutions if (a/p)=-1, and two solutions (mod n) if (a/p)=1. 2. Theorem Suppose that p is an odd prime, e is a positive integer, and gcd(a,p)=1. Then the congruence y 2 =a (mod p e ) has no solutions if (a/p)=-1, and two solutions (mod p e ) if (a/p)=1.

p4. 3. Theorem Suppose that n > 1 is an odd integer having factorization where the p i ’s are distinct primes and the e i ’s are positive integers, Suppose further that gcd(a,n)=1. Then the congruence y 2 =a (mod n) has 2 l solutions modulo n if (a/p i )=1 for all i in {1, …, l }, and no solutions, otherwise.

p5. [6] Factoring Algorithms 1. The Pollard’s p-1 algorithm input : an integer n, and a prespecified “bound” B output : factors of n

p6. Why? Suppose p is a prime divisor of n, and suppose that q <= B for every prime power q|(p-1). Then (p-1)|B! At the end of for loop, we have a=2 B! mod n Now 2 p-1 =1 mod p (by Fermat’s little Thm) Since (p-1)|B!, it follows a=2 B! =1 mod p and hence p|(a-1). Since we also have p|n, d=gcd(a-1, n) will be a non-trivial divisor of n (unless a=1).

p7. E.g. n= , B=180 a = 2 180! = D = gcd(a-1, n) = In fact, the complete factorization of n into primes is = x The factorization succeeds because has only “small” prime factors: = 2 x 3 x 131 x 173

p8. 2. The Pollard’s rho algorithm input : an integer n output : factors of n (1) Selecting a “random” function f with integer coefficients, and any Begin with x=x 0 and y=y 0. (2) Repeat the two calculations until d=gcd(x-y,n)>1. (3) Do the following compare 3.1 If d<n, we have succeeded. 3.2 If d=n, the method is failed. Goto (1). (*) A typical choice of f(x)=x 2 +1, with a seed x 0 =2.

p9. Complexity of rho method We expect this method to use the function f at most E.g : n=551, f(x)=x 2 +1 mod 551 and x 0 =

p Dixon’s random squares algorithm The idea is to locate with if gcd(x+y,n) is a nontrivial factor of n. (Why?) since n|(x-y)(x+y) but neither of x-y or x+y is divisible by n. Eg. n=15, x=2, y=7 (2 2 =7 2 mod 15) => gcd(2+7,15)=3 is a nontrivial factor of n. Eg. n=77, x=10, y=32 (10 2 =32 2 mod 77) => gcd(10+32,77)=7 is a nontrivial factor of n.

p11. factor base and p t -smooth A factor base B={p 1, p 2,…,p t } consisting of the first t primes is selected. If b factors over B, b is said to be p t -smooth. Eg : B={2,3,5}, b=2 3 *5 6 is 5-smooth; b=2 3 *7 6 is not 5-smooth. We may include -1 in B to handle the negative b B={p 0, p 1, p 2,…,p t }, with p 0 =-1.

p12. Algorithm input : a composite integer n and factor base B= {p 1, p 2,…,p t } output : factors of n (1) Suppose t+1 pairs (a i, b i =a i 2 mod n) are obtained, where b i is p t -smooth over B and the factorizations are given by (2) A set S is to be selected so that has only even powers of primes appearing. (3) Let, and do the following compare 3.1 If 3.2 If

p13. Eg : n=10057, t=5, B={2,3,5,7,11} *509 (discard!) 2 3 * *3 2 * *3 2 * *5 2 *11 2*3 2 * * If S={4,5,6}, then x=3010*4014*4023 mod n=2748 y=2 7 *3*5*7*11 mod n=7042 Since, we obtain a nontrivial factor gcd(x+y,n)=89, and 10057=89*113. If S={1,5}, then x=105*4014 mod n=9133 and y=2 2 *3*7*11=924. Unfortunately,, and no useful information is obtained.

p14. Eg : n= , t=6, B={2,3,5,7,11, 13} = 3*7 (mod n) = 2*7*13 (mod n) = 2*3*13 (mod n) ( * * ) 2 = (2*3*7*13) 2 (mod n) = (mod n) gcd( –546, )= to find the factor of n

p15. Improvements: We may include -1 in B to handle the negative b B={p 0, p 1, p 2,…,p t }, with p 0 =-1. Define Let a i =z+m and b i = q(z) = a i 2 - kn for z=0,1,-1,2,-2, … k=1,2, …

p16. Quadratic sieve algorithm (simple version) input : a composite integer n output : factors of n (1) choose a suitable P and construct a factor base (2) Define (3) Let a i =z+m and b i =q(z)=a i 2 -n for z=0,1,-1,2,-2,… A set S is to be selected so that has only even powers of primes appearing. (4) Let, and do the following

p17.

p18. Eg : n= * * * * If S={1}, then x=101 and y= =2 2 *3. Since, we obtain a nontrivial factor gcd(x+y,n)=113, and 10057=89*113. If S={-1,-3, 5}, then x=99*97*105 and y=2 7 *3 2 *11. Unfortunately,, and no useful information is obtained.

p Factoring algorithms in practice (Asymptotic running times) 1. Quadratic sieve 2. Elliptic curve (p is the smallest prime factor of n) 3. Number field sieve

p20. [7] Other Attacks on RSA Are there possible attacks on RSA other than factoring n? (Yes, see 2. 3.) 1. Computing  (n) Computing  (n) is no easier than factoring n For, if n and  (n) are known, and n is the product of two primes p, q, then n can be easily factored by solving n=pq  (n)=(p-1)(q-1) for the two unknowns p and q. Substituting q=n/p into the 2nd eq., We have P 2 -(n-  (n)+1)p + n = 0. The two roots will be p and q.

p The Decryption Exponent (See sec ) 3. Wiener’s Low Decryption Exponent Attack (See sec )

p22. [8] The Rabin Cryptosystem 1. Rabin scheme Let p, q be large primes, n=pq (p,q) be the private key Encryption: c=m 2 mod n Decryption: find the four square roots and one is m 2. Example Consider p=31, q=41, so n=pq=1271 Assume message m=814 so c = m 2 mod n = mod 1271 = 405 Decryption Solving m 2  405  2 (mod 31) and m 2  405  36 (mod 41) obtain m   8 (mod 31) and m   6 (mod 41) four possible roots: {  240,  457} (mod 1271)

p How to find square roots of a  Q n where n=pq ? Factor n as pq Let x and y satisfy following congruences x = a p (mod p) and y = -a p (mod p) x = a q (mod q) y = a q (mod q) where a r denotes a square root of a modulo r The square roots are x, -x, y, -y

p How to find square roots of a  Q p ? In general, there is an efficient polynomial randomized algo For p=3 (mod 4) there is a deterministic algo: By Euler’s criterion if a  Q p then a (p-1)/2 =1 (mod p), and (a (p+1)/4 ) 2 = a (p-1)/2 a= a (mod p). Hence two roots of a modulo p are  a (p+1)/4. n is called Blum integer if n = pq and p=3 (mod 4), q=3 (mod 4)

p Definition RABIN: Given n=pq and c=m 2 mod n, find x, s.t. c  x 2 (mod n) 6. Theorem RABIN = FACTOR (1) RABIN  FACTOR Given an oracle for FACTOR 1. Factor n and obtain p,q 2. Solve the square root problems c  x 2 (mod p) c  x 2 (mod q) 3. Apply CRT and get four roots of RABIN

p26. (2) FACTOR  RABIN Given an oracle for RABIN 1. Query RABIN oracle twice, get two roots x and y 2. With prob. ½, we can successfully get the factor of n by gcd(x+y, n)

p27. [9] Semantic Security of RSA 1. Potential 3 adversarial goals: Total break The adversary is able to determine Bob’s private key (in the case of a public-key cryptosystem) or the secret key (in the case of a symmetric-key cryptosystem). Partial break The adversary is able to decrypt a previously unseen ciphertext (without knowing the key). Or the adversarial can determine some specific information about the plaintext, given the ciphertext.

p28. Distinguishability of ciphertexts With some prob. > 0.5, the adversary is able to distinguish between encryptions of 2 given plaintexts, or between an encryption of a given plaintext and a random string. 2. Semantic security A public-key cryptosystem is said to achieve semantic security if the adversary cannot (in polynomial time) distinguish ciphertexts, provided that certain computational assumptions hold.

p Partial information concerning plaintext bits (See sec ) 4. Optimal Asymmetric encryption padding (See sec )