Parallel Quadratic Sieve

Slides:



Advertisements
Similar presentations
AKS Implementation of a Deterministic Primality Algorithm
Advertisements

RSA and Public Key Cryptography Oct Nathanael Paul.
Chris MacLellan, and Daniel W. Peterson. Statistical Primality Testing Miller-Rabin and pseudoprimes Frobenius test and pseudoprimes Composites which.
Number Theory Algorithms and Cryptography Algorithms Prepared by John Reif, Ph.D. Analysis of Algorithms.
RSA COSC 201 ST. MARY’S COLLEGE OF MARYLAND FALL 2012 RSA.
Factoring of Large Numbers using Number Field Sieve Matrix Step Chandana Anand, Arman Gungor, and Kimberly A. Thomas ECE 646 Fall 2006.
Integer Factorization By: Josh Tuggle & Kyle Johnson.
WS Algorithmentheorie 03 – Randomized Algorithms (Primality Testing) Prof. Dr. Th. Ottmann.
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.
Section 4.1: Primes, Factorization, and the Euclidean Algorithm Practice HW (not to hand in) From Barr Text p. 160 # 6, 7, 8, 11, 12, 13.
Computability and Complexity
Lecture 8: Primality Testing and Factoring Piotr Faliszewski
Capstone Project Presentation A Tool for Cryptography Problem Generation CSc 499 Mark Weston Winter 2006.
Notation Intro. Number Theory Online Cryptography Course Dan Boneh
RSA & F ACTORING I NTEGERS BY: MIKE NEUMILLER & BRIAN YARBROUGH.
Great Theoretical Ideas in Computer Science.
Announcements: 1. Term project groups and topics due tomorrow midnight Waiting for posts from most of you. Questions? This week: Primality testing, factoring.
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.
1 Chapter 7– Introduction to Number Theory Instructor: 孫宏民 Room: EECS 6402, Tel: , Fax :
Implementation of Pollard’s Rho Heuristic Mid-term Exam CSE670 Manoj Patil March 03, 2004.
The RSA Cryptosystem and Factoring Integers (II) Rong-Jaye Chen.
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.
Foundations of Network and Computer Security J J ohn Black Lecture #13 Sep 26 th 2007 CSCI 6268/TLEN 5831, Fall 2007.
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
Announcements: 1. Pass in worksheet on using RSA now. 2. DES graded soon 3. Short “pop” quiz on Ch 3 (Thursday at earliest) 4. Term project groups and.
implementations in a functional language
Factoring Algorithms Ref: D. Stinson, Cryptography - Theory and Practice, 2001.
Chapter 8 – Introduction to Number Theory Prime Numbers
Dan Boneh Intro. Number Theory Modular e’th roots Online Cryptography Course Dan Boneh.
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
CSE 321 Discrete Structures Winter 2008 Lecture 10 Number Theory: Primality.
Foundations of Network and Computer Security J J ohn Black Lecture #14 Oct 1 st 2007 CSCI 6268/TLEN 5831, Fall 2007.
Polynomial Factorization Olga Sergeeva Ferien-Akademie 2004, September 19 – October 1.
Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations Copyright © The McGraw-Hill Companies, Inc. Permission required.
Software Security Seminar - 1 Chapter 11. Mathematical Background 발표자 : 안병희 Applied Cryptography.

Information Security and Management 4. Finite Fields 8
Copyright, Yogesh Malhotra, PhD, 2013www.yogeshmalhotra.com SPECIAL PURPOSE FACTORING ALGORITHMS Special Purpose Factoring Algorithms For special class.
Prabhas Chongstitvatana1 Factorizing large integers Finding the unique decomposition of n into a product of prime factors. Factorize(n) if n is prime done.
MA/CSSE 473 Day 11 Primality testing summary Data Encryption RSA.
Prime Hunting Gábor Farkas Department of Computer Algebra Faculty of Informatics Eötvös Loránd University Jena, Germany 26. May 2008.
Factorization of a 768-bit RSA modulus Jung Daejin Lee Sangho.
6.4 Factoring.
CSE 311: Foundations of Computing Fall 2014 Lecture 12: Primes, GCD.
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.
Fast calculation methods. Addition  Add 137,95 Solution: = (137-5)+100= = 232.
A Survey on Factoring Large Numbers ~ 巨大数の因数分解に関する調査 ~ Kanada Lab. M Yoshida Hitoshi.
Key Generation Bob generates his keys as follows –Choose two large distinct random primes p, q –Set n = pq (in Z… no finite groups yet) –Compute  (n)
MA/CSSE 473 Day 10 Primality Testing. MA/CSSE 473 Day 10 In-class exam: Friday, Sept 28 –You may bring a two-sided 8.5x11 inch piece of paper containing.
Progress Report—11/13 宗慶. Problem Statement Find kernels of large and sparse linear systems over GF(2)
MA/CSSE 473 Day 9 Primality Testing Encryption Intro.
PRIMES is in P Manindra Agrawal Neeraj Kayal Nitin Saxena Dept of CSE, IIT Kanpur.
RSA Encryption Greg Gronn Laura Trimmer. RSA Encryption  Requires two 30 digit prime numbers to create an encoding/decryption key.  Goal: analyze different.
Public Key Encryption Major topics The RSA scheme was devised in 1978
CSE565: Computer Security Lecture 7 Number Theory Concepts
Progress Report— 11/06 宗慶.
PUBLIC-KEY ENCRYPTION Focusing on RSA
Introduction to Number Theory
Number Theory (Chapter 7)
Cryptography and Network Security
RSA Cryptosystem Bits PCs Memory MB ,000 4GB 1,020
Homework 3 As announced: not due today 
Analysis of the RSA Encryption Algorithm
Factoring RSA Moduli: Current State of the Art J
Introduction to Modern Cryptography
Mathematical Background for Cryptography
Introduction to Algorithms
Presentation transcript:

Parallel Quadratic Sieve Factoring and other adventures done in parallel Daniel Ron 11/24/2018

Background Factoring is hard Many different algorithms Background – Algorithm – Results – Moving Forward Factoring is hard Many different algorithms Daniel Ron 11/24/2018

Background Factoring is hard Many different algorithms Trial division Background – Algorithm – Results – Moving Forward Factoring is hard Many different algorithms Trial division Pullard’s 𝜌 Method Quadratic Number Field Sieve General Number Field Sieve Daniel Ron 11/24/2018

Background Factoring is hard Many different algorithms Trial division Background – Algorithm – Results – Moving Forward Factoring is hard Many different algorithms Trial division Pullard’s 𝜌 Method Quadratic Number Field Sieve General Number Field Sieve 𝑛 2 4 𝑛 𝑝𝑜𝑙𝑦𝑙𝑜𝑔 𝑛 exp 1+𝑜 1 log 𝑛 log log 𝑛 exp 3 64 9 +𝑜 1 log 𝑛 1 3 log log 𝑛 2 3 Daniel Ron 11/24/2018

Background: Goals Where can we parallelize? Background – Algorithm – Results – Moving Forward Where can we parallelize? What sub-problems can we improve in parallel? Daniel Ron 11/24/2018

Background: Goals Primality checking Modular square root GCD Background – Algorithm – Results – Moving Forward Primality checking Modular square root GCD “Small” number factoring Nullspace over 𝐹 2 Daniel Ron 11/24/2018

Background: Goals Primality checking Miller-Rabin Background – Algorithm – Results – Moving Forward Primality checking Miller-Rabin Modular square root Tonelli-Shanks GCD Lehmer “Small” number factoring Pullard’s 𝜌 method Nullspace over 𝐹 2 Block Lanczos Daniel Ron 11/24/2018

Background: Goals Good at Parallel Primality checking Background – Algorithm – Results – Moving Forward Good at Parallel Primality checking Small number factoring Nullspace over 𝐹 2 Bad at Parallel Modular square root GCD Daniel Ron 11/24/2018

Miller-Rabin Primality test Algorithm Background – Algorithm – Results – Moving Forward Primality Testing Miller-Rabin Primality test Daniel Ron 11/24/2018

Algorithm Given odd 𝑛, we have 𝑛−1= 2 𝑠 𝑑, 𝑑 odd Background – Algorithm – Results – Moving Forward Given odd 𝑛, we have 𝑛−1= 2 𝑠 𝑑, 𝑑 odd ∀𝑎, either 𝑎 𝑑 ≡1 mod 𝑛 or 𝑎 2 𝑟 𝑑 ≡−1 mod 𝑛 If 𝑎 𝑑 ≠1 mod 𝑛 or 𝑎 2 𝑟 𝑑 ≠−1 mod 𝑛 𝑛 must be composite a is called a witness Daniel Ron 11/24/2018

Algorithm Try random 𝑎∈[2,𝑛−1] 𝑘 times 100% accuracy on primes Background – Algorithm – Results – Moving Forward Try random 𝑎∈[2,𝑛−1] 𝑘 times 100% accuracy on primes 1− 4 −𝑘 on composites Embarrassingly parallel If we find any witness, abort all threads Daniel Ron 11/24/2018

“Small” Number Factoring Pullard’s 𝜌 Method Algorithm Background – Algorithm – Results – Moving Forward “Small” Number Factoring Pullard’s 𝜌 Method Daniel Ron 11/24/2018

Algorithm Intelligently generate a pseudo-random sequence Background – Algorithm – Results – Moving Forward Intelligently generate a pseudo-random sequence Based on finding cycles 𝑓 𝑥 = 𝑥 2 +𝑐 mod 𝑛 for some 𝑐, 𝑐≠0,−2 Iterate over 𝑥=𝑓 𝑥 , 𝑦=𝑓 𝑓 𝑦 until 𝐺𝐶𝐷 𝑥−𝑦 ,𝑛 ≠1 → Can run multiple iterations at once with different values of 𝑐 Daniel Ron 11/24/2018

Block Lanczos Algorithm Background – Algorithm – Results – Moving Forward Nullspace over 𝐹 2 Block Lanczos Algorithm Daniel Ron 11/24/2018

Algorithm Works well on sparse matrices over small finite fields Background – Algorithm – Results – Moving Forward Works well on sparse matrices over small finite fields Known to be very fast for this data, but doesn’t gain from being parallelized Daniel Ron 11/24/2018

Algorithm Quadratic Sieve Background – Algorithm – Results – Moving Forward Quadratic Sieve Daniel Ron 11/24/2018

Algorithm Given 𝑛 Choose bounds 𝐵 and 𝑀 Background – Algorithm – Results – Moving Forward Given 𝑛 Choose bounds 𝐵 and 𝑀 Find set of all 𝑝<𝐵 such that 𝑛 𝑝 =1 Find all squares 𝑎 𝑖 2 = 𝑏 𝑖 <𝑀 such that 𝑏 𝑖 is a product of primes from our set Find subset of 𝑏 𝑖 such that Π 𝑏 𝑖 = 𝑐 2 for some c Calculate 𝐺𝐶𝐷(𝑎−𝑐, 𝑛), 𝐺𝐶𝐷(𝑎+𝑐, 𝑛) Daniel Ron 11/24/2018

Algorithm Given 𝑛 →Choose bounds 𝑩 and 𝑴 Tunable Parameter Background – Algorithm – Results – Moving Forward Given 𝑛 →Choose bounds 𝑩 and 𝑴 Tunable Parameter Find set of all 𝑝<𝐵 such that 𝑛 𝑝 =1 Find all squares 𝑎 𝑖 2 = 𝑏 𝑖 <𝑀 such that 𝑏 𝑖 is a product of primes from our set Find subset of 𝑏 𝑖 such that Π 𝑏 𝑖 = 𝑐 2 for some c Calculate 𝐺𝐶𝐷(𝑎−𝑐, 𝑛), 𝐺𝐶𝐷(𝑎+𝑐, 𝑛) Daniel Ron 11/24/2018

Algorithm Given 𝑛 Choose bounds 𝐵 and 𝑀 Background – Algorithm – Results – Moving Forward Given 𝑛 Choose bounds 𝐵 and 𝑀 → Find set of all 𝒑<𝑩 such that 𝒏 𝒑 =𝟏 Find all squares 𝑎 𝑖 2 = 𝑏 𝑖 <𝑀 such that 𝑏 𝑖 is a product of primes from our set Find subset of 𝑏 𝑖 such that Π 𝑏 𝑖 = 𝑐 2 for some c Calculate 𝐺𝐶𝐷(𝑎−𝑐, 𝑛), 𝐺𝐶𝐷(𝑎+𝑐, 𝑛) Brute force Daniel Ron 11/24/2018

Algorithm Given 𝑛 Choose bounds 𝐵 and 𝑀 Background – Algorithm – Results – Moving Forward Given 𝑛 Choose bounds 𝐵 and 𝑀 Find set of all 𝑝<𝐵 such that 𝑛 𝑝 =1 → Find all squares 𝒂 𝒊 𝟐 = 𝒃 𝒊 <𝑴 such that 𝒃 𝒊 is a product of primes from our set Find subset of 𝑏 𝑖 such that Π 𝑏 𝑖 = 𝑐 2 for some c Calculate 𝐺𝐶𝐷(𝑎−𝑐, 𝑛), 𝐺𝐶𝐷(𝑎+𝑐, 𝑛) Daniel Ron 11/24/2018

Algorithm Use polynomial 𝑓 𝑥 = 𝐴𝑥+𝐵 2 −n Background – Algorithm – Results – Moving Forward Use polynomial 𝑓 𝑥 = 𝐴𝑥+𝐵 2 −n Note: 𝑓 𝑥 mod n ≡ 𝐴𝑥+𝐵 2 mod 𝑛 ⇒ 𝑎 𝑖 =(𝐴𝑥+𝐵) for some 𝑥 Solve 𝑓 𝑥 ≡0 mod 𝑝, call solution α 𝑝 factors f 𝛼+𝑘𝑝 , mark all these values Repeat for all 𝑝 in our base Daniel Ron 11/24/2018

Algorithm Given 𝑛 Choose bounds 𝐵 and 𝑀 Background – Algorithm – Results – Moving Forward Given 𝑛 Choose bounds 𝐵 and 𝑀 Find set of all 𝑝<𝐵 such that 𝑛 𝑝 =1 Find all squares 𝑎 𝑖 2 = 𝑏 𝑖 <𝑀 such that 𝑏 𝑖 is a product of primes from our set → Find subset of 𝒃 𝒊 such that 𝚷 𝒃 𝒊 = 𝒄 𝟐 for some c Calculate 𝐺𝐶𝐷(𝑎−𝑐, 𝑛), 𝐺𝐶𝐷(𝑎+𝑐, 𝑛) Daniel Ron 11/24/2018

Algorithm Write each 𝑏 𝑖 in prime power representation Background – Algorithm – Results – Moving Forward Write each 𝑏 𝑖 in prime power representation 𝑏 𝑖 = 𝑝 𝑖0 𝑒 𝑖0 𝑝 𝑖1 𝑒 𝑖1 … 𝑝 𝑖𝑚 𝑒 𝑖𝑚 Can be represented as vector 𝑒 𝑖0 , 𝑒 𝑖1 ,…, 𝑒 𝑖𝑚 we set 𝑒 𝑖𝑚 , can set size of vector Consider these vectors in 𝐹 2 Choose subset of vectors whos sum is 0 Daniel Ron 11/24/2018

Algorithm This is a matrix operation! Background – Algorithm – Results – Moving Forward This is a matrix operation! 𝑥 ⋅ 1 0 1 0 1 1 0 1 1 0 1 1 =0↔ 1 0 1 0 1 1 0 1 1 0 1 1 𝑥 =0 Finding the nullspace gives us 𝑏 𝑖 s.t. Π 𝑏 𝑖 = 𝑐 2 mod 𝑛 Daniel Ron 11/24/2018

Algorithm Given 𝑛 Choose bounds 𝐵 and 𝑀 Background – Algorithm – Results – Moving Forward Given 𝑛 Choose bounds 𝐵 and 𝑀 Find set of all 𝑝<𝐵 such that 𝑛 𝑝 =1 Find all squares 𝑎 𝑖 2 = 𝑏 𝑖 <𝑀 such that 𝑏 𝑖 is a product of primes from our set Find subset of 𝑏 𝑖 such that Π 𝑏 𝑖 = 𝑐 2 for some c → Calculate 𝑮𝑪𝑫(𝒂−𝒄, 𝒏), 𝑮𝑪𝑫(𝒂+𝒄, 𝒏) Now we have two factors! Daniel Ron 11/24/2018

Results Background – Algorithm – Results – Moving Forward Improvement in primality testing for larger numbers ~1 order of magnitude on one core Primality testing: Linear speedup with cores Pollard’s Rho: faster than trial division for semiprimes Worse for small smooth numbers Slight parallel speedup Daniel Ron 11/24/2018

Results Background – Algorithm – Results – Moving Forward Daniel Ron 11/24/2018

Moving Forward Implement efficient blocking of matrix data Background – Algorithm – Results – Moving Forward Implement efficient blocking of matrix data Where + when parallelization helps Parallel for loops Parallel polynomials in QS → 𝐴𝑥+𝐵 2 Parallel nullspace over 𝐹 2 etc Get QS working on bigints Determine proper cutoffs Daniel Ron 11/24/2018