SlideShare une entreprise Scribd logo
1  sur  36
Factoring
Factoring
Factoring
Factoring
 Security of RSA algorithm depends on
(presumed) difficulty of factoring
o Given N = pq, find p or q and RSA is broken
o Rabin cipher also based on factoring
 Factoring like “exhaustive search” for RSA
 Lots of interest/research in factoring
 What are best factoring methods?
o How does RSA “key size” compare to symmetric
cipher key size?
Factoring
Factoring Methods
 Trial division
o Obvious method but not practical
 Dixon’s algorithm
o Less obvious and much faster
 Quadratic sieve
o Refinement of Dixon’s algorithm
o Best algorithm up to about 110 decimal digits
 Number field sieve
o Best for numbers greater than 100 digits
o We only briefly mention this algorithm
Factoring
Trial Division
 Given N, try to divide N by each of
2,3,5,7,9,11,…,sqrt(N)
 As soon as a factor found, we are done
o So, expected work is about sqrt(N)/2
 Improvement: try only prime numbers
 Work is then on order of π(N)
o Where π(N) ≈ N/ln(N) is number of primes up to N
Factoring
Congruence of Squares
 We want to factor N = pq
 Suppose we find x,y such that N = x2
− y2
 Then N = (x − y)(x + y), have factored N
 More generally, congruence of squares…
 Suppose x2
= y2
(mod N)
 Then x2
− y2
= kN for some k
 Which implies (x − y)(x + y) = kN
Factoring
Congruence of Squares
 Suppose x2
= y2
(mod N)
 Then (x − y)(x + y) = kN
 Implies (x − y) or (x + y) is factor of N
o Or x − y = k and x + y = N (or vice versa)
 With probability at least 1/2, we obtain a
factor of N
o If so, gcd(N, x − y) or gcd(N, x + y) factors N
o And the gcd is easy to compute
Factoring
Congruence of Squares
 For example 102
= 32
(mod 91)
 That is, (10 − 3)(10 + 3) = 91
o Factors of 91 are, in fact, 7 and 13
 Also, 342
= 82
(mod 91)
o Then 26⋅42 = 0 (mod 91) and we have
gcd(26,91) = 13 and gcd(42,91) = 7
 In general, gcd is necessary
Factoring
Congruence of Squares
 Find congruence of squares: x2
= y2
(mod N)
and we can likely factor N
 How to find congruence of squares?
 Consider, for example,
412
= 32 (mod 1649) and 432
= 200 (mod 1649)
 Neither 32 nor 200 is a square
 But 32⋅200 = 6400 = 802
 Therefore, (41⋅43)2
= 802
(mod 1649)
Factoring
Congruence of Squares
 Can combine non-squares to obtain a
square, for example
32 = 25
⋅50
and 200 = 23
⋅52
 And 32⋅200 = 28
⋅52
= (24
⋅51
)2
 We obtain a perfect square provided each
exponent in product is even
 Only concerned with exponents and only
need consider even or odd, i.e., mod 2
Factoring
Congruence of Squares
 Number has an exponent vector
 For example, first element of vector is
power of 2 and second power of 5
 Then
 And
Factoring
Congruence of Squares
 Mod 2 exponent vector of product 200⋅32
is all zero, so perfect square
 Also, this vector is sum (mod 2) of vectors
for 200 and 32
 Any set of exponent vectors that sum to
all-zero, mod 2, gives us a square
 We need to keep vectors small
o Only allow numbers with “small” prime factors
Factoring
Congruence of Squares
 Choose bound B and primes less than B
o This is our factor base
o For technical reasons, include “−1” in factor base
 A number that factors completely over the
factor base is B-smooth
 Smooth relations factor over factor base
 Restrict our attention to B-smooth relations
o Good: Exponent vectors are small
o Bad: Harder to find relations
Factoring
Example
 Want to factor N = 1829
 Choose bound B = 13
 Choose factor base −1,2,3,5,7,11,13
 Look at values in −N/2 to N/2
 To be systematic, we choose sqrt(kN) and
sqrt(kN) for k = 1,2,3,4
 And test each for B-smoothness
Factoring
Example
 Compute
 All are B-smooth except 602
and 752
Factoring
Example
 Obtain
exponent
vectors
Factoring
Example
 Find collection of exponent vectors that
sum, mod 2, to zero vector
 Vectors corresponding to 422
, 432
, 612
and
852
work:
Factoring
Example
 Implies that
(42⋅43⋅61⋅85)2
= (2⋅3⋅5⋅ 7⋅13)2
(mod 1829)
 Simplifies to 14592
= 9012
(mod 1829)
 Since 1459 − 901 = 558, we find factor
of 1829 by gcd(558,1829) = 31
 Easily verified 1829 = 59⋅31
Factoring
Example
 A systematic way to find set of
vectors that sum to zero vector…
 In this example, want x0,x1,…,x5
 This is a basic linear algebra problem
Factoring
Linear Algebra
 Suppose n elements in factor base
o Factor base includes “−1”
o Then matrix on previous slide has n rows
o Seek linearly dependent set of columns
 Theorem: If matrix has n rows and n + 1 or
more columns then a linearly dependent set
of columns exists
 Therefore, if we find n + 1 or more smooth
relations, we can solve the linear equations
Factoring
Dixon’s Algorithm
1. To factor N: select bound B and factor
base with n−1 primes less than B and “−1”
2. Select r, compute y = r2
(mod N)
Number r can be selected at random
3. If y factors completely over factor base,
save mod 2 exponent vector
4. Repeat steps 2 and 3 to obtain n+1 vectors
5. Solve linear system and compute gcd
Factoring
Dixon’s Algorithm
 If factor base is large, easier to find
B-smooth relations
o But linear algebra problem is harder
 Relation finding phase parallelizable
o Linear algebra part is not
 Next, quadratic sieve
o An improved version of Dixon’s algorithm
Factoring
Quadratic Sieve
 Quadratic sieve (QS) algorithm
o Dixon’s algorithm “on steroids”
 Finding B-smooth relations beefed up
 As in Dixon’s algorithm
o Choose bound B and factor base of
primes less than B
o Must find lots of B-smooth relations
Factoring
Quadratic Sieve
 Define quadratic polynomial
Q(x) = (sqrt(N) + x)2
− N
 The is the “quadratic” in QS
 Use Q(x) to find B-smooth values
o For each x ∈ [−M,M] compute y = Q(x)
o Mod N, we have y = z2
, where z = sqrt(N) + x
o Test y for B-smoothness
o If y is smooth, save mod 2 exponent vector
Factoring
Quadratic Sieve
 Advantage of QS over Dixon’s is that
by using Q(x) we can sieve
 What is sieving? Glad you asked…
 First, consider sieve of Eratosthenes
o Used to sieve for prime numbers
 Then modify it for B-smooth numbers
Factoring
Sieve of Eratosthenes
 To find prime numbers less than M
 List all numbers 2,3,4,…,M−1
 Cross out all numbers with factor of 2,
other than 2
 Cross out all numbers with factor of 3,
other than 3, and so on
 Number that “fall thru” sieve are prime
Factoring
Sieve of Eratosthenes
 To find prime numbers less than 31…
2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
— — — —
—————
— — — — —
⁄ ⁄
⁄ ⁄ ⁄
⁄ ⁄ ⁄ ⁄

 
 
|
| ||| ∩
 Find that primes less than 31 are
2,3,5,7,11,13,17,19,23 and 29
Factoring
Sieve of Eratosthenes
 This sieve gives us primes
 But also provides info on non-primes
 For example, 24 marked with “ ” and
“ ” so it is divisible by 2 and 3
 Note: we only find that 24 is divisible
by 2, not by 4 or 8
—
⁄
Factoring
Sieving for Smooth Numbers
 Instead of crossing out, we divide by
the prime (including prime itself)
2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
1 1 3
2 5 3
7 4 9 5
 All 1s represent 7-smooth numbers
 Some non-1s also 7-smooth
o Must divide by highest powers of primes
1 1
1 2
5 1
1
1
1 2
Factoring
Quadratic Sieve
 QS uses similar sieving strategy as on
previous slide
o And some computational refinements
 Suppose p in factor base divides Q(x)
o Then p divides Q(x + kp) for all k ≠ 0 (homework)
o That is, p divides Q of …,x−2p,x−p,x,x+p,x+2p,…
o No need to test these for divisibility by p
 This observation allows us to sieve
Factoring
Quadratic Sieve
 One trick to speed up sieving
 If Q(x) divisible by p, then Q(x) = 0 (mod p)
 Defn of Q implies (sqrt(N) + x)2
= N (mod p)
 Square roots of N (mod p), say, sp and p − sp
o Let x0 = sp − sqrt(N) and x1 = p − sp − sqrt(N)
o Then Q(x0) and Q(x1) divisible by p
o Implies Q(x0 + kp) and Q(x1 + kp) divisible by p
 Efficient algorithm for these square roots
Factoring
Quadratic Sieve
 How to sieve for B-smooth relations
 Array: Q(x) for x = −M,−M+1,…, M−1,M
 For first prime p in factor base
o Generate all x ∈ [−M,M] for which p divides Q(x)
(as described on previous slide)
o For each, divide by highest power of p
o For each, store power, mod 2, in vector for x
 Repeat for all primes in factor base
 Numbers reduced to 1 are B-smooth
Factoring
Quadratic Sieve
 Linear algebra phase same as Dixon’s
 Sieving is the dominant work
 Lots of tricks used to speed up sieving
o For example, “logarithms” to avoid division
 Multiple Polynomial QS (MPQS)
o Multiple polynomials of form (ax+b)2
− N
o Can then use smaller interval [−M,M]
o Yields much faster parallel implementations
Factoring
Sieving Conclusions
 QS/MPQS attack has two phases
 Distributed relation finding phase
o Could recruit volunteers on Internet
 Linear equation solving phase
o For big problems, requires a supercomputer
 Number field sieve better than QS
o Requires 2 phases, like QS
o Number field sieve uses advanced math
Factoring
Factoring Algorithms
 Work to factor N = 2x
 Last column measures “bits” of work
 Symmetric cipher exhaustive key
search: x bit key is x−1 bits of work
Factoring
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
Factoring Algorithms
 Comparison of work factors
 QS best to
390 bit N
o 117 digits
 390-bit N is
as secure as
60-bit key
Factoring
Factoring Conclusions
 Work for factoring is subexponential
o Better than exponential time but worse
than polynomial time
o Exhaustive key search is exponential
 Factoring is active area of research
o Expect to see incremental improvement
 Next, discrete log algorithms…

Contenu connexe

Tendances

Chuyen de toan logic roi rac li thuyet to hop
Chuyen de toan logic  roi rac li thuyet to hopChuyen de toan logic  roi rac li thuyet to hop
Chuyen de toan logic roi rac li thuyet to hoplephucduc06011999
 
Factors and Multiples
Factors and MultiplesFactors and Multiples
Factors and MultiplesOsmanKhan58
 
CNIT 141: 9. Elliptic Curve Cryptosystems
CNIT 141: 9. Elliptic Curve CryptosystemsCNIT 141: 9. Elliptic Curve Cryptosystems
CNIT 141: 9. Elliptic Curve CryptosystemsSam Bowne
 
Vedic Mathematics For All
Vedic Mathematics For AllVedic Mathematics For All
Vedic Mathematics For Allguest574aac2
 
Algebraic expressions and equations
Algebraic expressions and equationsAlgebraic expressions and equations
Algebraic expressions and equationsChristian Costa
 
Number theory
Number theory Number theory
Number theory tes31
 
Algebra Rules - Addition and Subtraction
Algebra Rules - Addition and SubtractionAlgebra Rules - Addition and Subtraction
Algebra Rules - Addition and SubtractionPangala Nagendra Rao
 
Information and data security advanced encryption standard (aes)
Information and data security advanced encryption standard (aes)Information and data security advanced encryption standard (aes)
Information and data security advanced encryption standard (aes)Mazin Alwaaly
 
50 bài tập về bất đẳng thức
50 bài tập về bất đẳng thức50 bài tập về bất đẳng thức
50 bài tập về bất đẳng thứcHUHF huiqhr
 
Fully Homomorphic Encryption (1).pptx
Fully Homomorphic Encryption (1).pptxFully Homomorphic Encryption (1).pptx
Fully Homomorphic Encryption (1).pptxssuser1716c81
 

Tendances (20)

Maths quizzes
Maths quizzesMaths quizzes
Maths quizzes
 
Chuyen de toan logic roi rac li thuyet to hop
Chuyen de toan logic  roi rac li thuyet to hopChuyen de toan logic  roi rac li thuyet to hop
Chuyen de toan logic roi rac li thuyet to hop
 
Factors and Multiples
Factors and MultiplesFactors and Multiples
Factors and Multiples
 
CNIT 141: 9. Elliptic Curve Cryptosystems
CNIT 141: 9. Elliptic Curve CryptosystemsCNIT 141: 9. Elliptic Curve Cryptosystems
CNIT 141: 9. Elliptic Curve Cryptosystems
 
Ecc2
Ecc2Ecc2
Ecc2
 
Vedic Mathematics For All
Vedic Mathematics For AllVedic Mathematics For All
Vedic Mathematics For All
 
Straight line graphs
Straight line graphsStraight line graphs
Straight line graphs
 
1524 elliptic curve cryptography
1524 elliptic curve cryptography1524 elliptic curve cryptography
1524 elliptic curve cryptography
 
Algebraic expressions and equations
Algebraic expressions and equationsAlgebraic expressions and equations
Algebraic expressions and equations
 
Number theory
Number theory Number theory
Number theory
 
Presentation binomial theorem
Presentation binomial theoremPresentation binomial theorem
Presentation binomial theorem
 
Number theory
Number theoryNumber theory
Number theory
 
Algebra Rules - Addition and Subtraction
Algebra Rules - Addition and SubtractionAlgebra Rules - Addition and Subtraction
Algebra Rules - Addition and Subtraction
 
ELEMENTARY NUMBER THEORY.pptx
ELEMENTARY NUMBER THEORY.pptxELEMENTARY NUMBER THEORY.pptx
ELEMENTARY NUMBER THEORY.pptx
 
Polynomials
PolynomialsPolynomials
Polynomials
 
Information and data security advanced encryption standard (aes)
Information and data security advanced encryption standard (aes)Information and data security advanced encryption standard (aes)
Information and data security advanced encryption standard (aes)
 
50 bài tập về bất đẳng thức
50 bài tập về bất đẳng thức50 bài tập về bất đẳng thức
50 bài tập về bất đẳng thức
 
9 drichle
9 drichle9 drichle
9 drichle
 
Eulers totient
Eulers totientEulers totient
Eulers totient
 
Fully Homomorphic Encryption (1).pptx
Fully Homomorphic Encryption (1).pptxFully Homomorphic Encryption (1).pptx
Fully Homomorphic Encryption (1).pptx
 

En vedette

ERATOSTHENES SIEVE
ERATOSTHENES SIEVEERATOSTHENES SIEVE
ERATOSTHENES SIEVEIES EUROPA
 
Поисковый отряд "Звезда"
Поисковый отряд "Звезда"Поисковый отряд "Звезда"
Поисковый отряд "Звезда"Денис Лонский
 
Jose Eugenio Beltran Pantoja english nuevo (4)
Jose Eugenio Beltran Pantoja english nuevo (4)Jose Eugenio Beltran Pantoja english nuevo (4)
Jose Eugenio Beltran Pantoja english nuevo (4)Jose Beltran
 
NEWEST CONSTITUTION OF CASHVILLE MULTI-PURPOSE COOPERATIVE SOCIETY LIMITED
NEWEST CONSTITUTION OF CASHVILLE MULTI-PURPOSE COOPERATIVE SOCIETY LIMITEDNEWEST CONSTITUTION OF CASHVILLE MULTI-PURPOSE COOPERATIVE SOCIETY LIMITED
NEWEST CONSTITUTION OF CASHVILLE MULTI-PURPOSE COOPERATIVE SOCIETY LIMITEDDr. Henry Akpojubaro Efegbere
 
ARTICLES FOR PRESENTATION AT ACEDCAMDS BY THE CASHVILLE GROUP OF COMPANIES AN...
ARTICLES FOR PRESENTATION AT ACEDCAMDS BY THE CASHVILLE GROUP OF COMPANIES AN...ARTICLES FOR PRESENTATION AT ACEDCAMDS BY THE CASHVILLE GROUP OF COMPANIES AN...
ARTICLES FOR PRESENTATION AT ACEDCAMDS BY THE CASHVILLE GROUP OF COMPANIES AN...Dr. Henry Akpojubaro Efegbere
 
Closed Door project
Closed Door projectClosed Door project
Closed Door projectGerry Hannah
 
Поисковый Отряд "Звезда"
Поисковый Отряд "Звезда"Поисковый Отряд "Звезда"
Поисковый Отряд "Звезда"Денис Лонский
 
Goodtogreat 150222012854-conversion-gate01
Goodtogreat 150222012854-conversion-gate01Goodtogreat 150222012854-conversion-gate01
Goodtogreat 150222012854-conversion-gate01Ritika Sharma
 
Upper Class White Women Powerpoint week 5 Presentation
Upper Class White Women Powerpoint week 5 PresentationUpper Class White Women Powerpoint week 5 Presentation
Upper Class White Women Powerpoint week 5 Presentationwapinskysmiths
 
Tier 1 presentation - AV blocks and pacemakers
Tier 1 presentation - AV blocks and pacemakersTier 1 presentation - AV blocks and pacemakers
Tier 1 presentation - AV blocks and pacemakersHannah Pegram
 
Lambing lunch-GFAVS lecture
Lambing lunch-GFAVS lectureLambing lunch-GFAVS lecture
Lambing lunch-GFAVS lectureHannah Pegram
 
Effect of Corruption on Natural Disaster Vulnerability
Effect of Corruption on Natural Disaster Vulnerability Effect of Corruption on Natural Disaster Vulnerability
Effect of Corruption on Natural Disaster Vulnerability Md Boby Sabur
 
The Netizen Approach to Security and Innovation
The Netizen Approach to Security and InnovationThe Netizen Approach to Security and Innovation
The Netizen Approach to Security and InnovationNetizen Corporation
 
Objectionable microorganisms within and beyond regulations
Objectionable microorganisms within and beyond regulationsObjectionable microorganisms within and beyond regulations
Objectionable microorganisms within and beyond regulationsStephen Mc Grath PhD
 
Pollution of Environment Due to Exhaust Gas & It's Control System
Pollution of Environment Due to Exhaust Gas & It's Control SystemPollution of Environment Due to Exhaust Gas & It's Control System
Pollution of Environment Due to Exhaust Gas & It's Control SystemMirajul Islam
 

En vedette (20)

Eratosthenes ppt
Eratosthenes pptEratosthenes ppt
Eratosthenes ppt
 
ERATOSTHENES SIEVE
ERATOSTHENES SIEVEERATOSTHENES SIEVE
ERATOSTHENES SIEVE
 
DRAMATIC LEADERSHIP
DRAMATIC LEADERSHIPDRAMATIC LEADERSHIP
DRAMATIC LEADERSHIP
 
Поисковый отряд "Звезда"
Поисковый отряд "Звезда"Поисковый отряд "Звезда"
Поисковый отряд "Звезда"
 
презентация2
презентация2презентация2
презентация2
 
Jose Eugenio Beltran Pantoja english nuevo (4)
Jose Eugenio Beltran Pantoja english nuevo (4)Jose Eugenio Beltran Pantoja english nuevo (4)
Jose Eugenio Beltran Pantoja english nuevo (4)
 
NEWEST CONSTITUTION OF CASHVILLE MULTI-PURPOSE COOPERATIVE SOCIETY LIMITED
NEWEST CONSTITUTION OF CASHVILLE MULTI-PURPOSE COOPERATIVE SOCIETY LIMITEDNEWEST CONSTITUTION OF CASHVILLE MULTI-PURPOSE COOPERATIVE SOCIETY LIMITED
NEWEST CONSTITUTION OF CASHVILLE MULTI-PURPOSE COOPERATIVE SOCIETY LIMITED
 
ARTICLES FOR PRESENTATION AT ACEDCAMDS BY THE CASHVILLE GROUP OF COMPANIES AN...
ARTICLES FOR PRESENTATION AT ACEDCAMDS BY THE CASHVILLE GROUP OF COMPANIES AN...ARTICLES FOR PRESENTATION AT ACEDCAMDS BY THE CASHVILLE GROUP OF COMPANIES AN...
ARTICLES FOR PRESENTATION AT ACEDCAMDS BY THE CASHVILLE GROUP OF COMPANIES AN...
 
Closed Door project
Closed Door projectClosed Door project
Closed Door project
 
constitution-1
constitution-1constitution-1
constitution-1
 
Поисковый Отряд "Звезда"
Поисковый Отряд "Звезда"Поисковый Отряд "Звезда"
Поисковый Отряд "Звезда"
 
Goodtogreat 150222012854-conversion-gate01
Goodtogreat 150222012854-conversion-gate01Goodtogreat 150222012854-conversion-gate01
Goodtogreat 150222012854-conversion-gate01
 
Upper Class White Women Powerpoint week 5 Presentation
Upper Class White Women Powerpoint week 5 PresentationUpper Class White Women Powerpoint week 5 Presentation
Upper Class White Women Powerpoint week 5 Presentation
 
korjaamo
korjaamokorjaamo
korjaamo
 
Tier 1 presentation - AV blocks and pacemakers
Tier 1 presentation - AV blocks and pacemakersTier 1 presentation - AV blocks and pacemakers
Tier 1 presentation - AV blocks and pacemakers
 
Lambing lunch-GFAVS lecture
Lambing lunch-GFAVS lectureLambing lunch-GFAVS lecture
Lambing lunch-GFAVS lecture
 
Effect of Corruption on Natural Disaster Vulnerability
Effect of Corruption on Natural Disaster Vulnerability Effect of Corruption on Natural Disaster Vulnerability
Effect of Corruption on Natural Disaster Vulnerability
 
The Netizen Approach to Security and Innovation
The Netizen Approach to Security and InnovationThe Netizen Approach to Security and Innovation
The Netizen Approach to Security and Innovation
 
Objectionable microorganisms within and beyond regulations
Objectionable microorganisms within and beyond regulationsObjectionable microorganisms within and beyond regulations
Objectionable microorganisms within and beyond regulations
 
Pollution of Environment Due to Exhaust Gas & It's Control System
Pollution of Environment Due to Exhaust Gas & It's Control SystemPollution of Environment Due to Exhaust Gas & It's Control System
Pollution of Environment Due to Exhaust Gas & It's Control System
 

Similaire à factoring

Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notationsajinis3
 
Introduction to the AKS Primality Test
Introduction to the AKS Primality TestIntroduction to the AKS Primality Test
Introduction to the AKS Primality TestPranshu Bhatnagar
 
A study on number theory and its applications
A study on number theory and its applicationsA study on number theory and its applications
A study on number theory and its applicationsItishree Dash
 
Unit-1 DAA_Notes.pdf
Unit-1 DAA_Notes.pdfUnit-1 DAA_Notes.pdf
Unit-1 DAA_Notes.pdfAmayJaiswal4
 
Matrix 2 d
Matrix 2 dMatrix 2 d
Matrix 2 dxyz120
 
Principal Component Analysis
Principal Component AnalysisPrincipal Component Analysis
Principal Component AnalysisSumit Singh
 
Rosser's theorem
Rosser's theoremRosser's theorem
Rosser's theoremWathna
 
CMSC 56 | Lecture 8: Growth of Functions
CMSC 56 | Lecture 8: Growth of FunctionsCMSC 56 | Lecture 8: Growth of Functions
CMSC 56 | Lecture 8: Growth of Functionsallyn joy calcaben
 
DAA - UNIT 4 - Engineering.pptx
DAA - UNIT 4 - Engineering.pptxDAA - UNIT 4 - Engineering.pptx
DAA - UNIT 4 - Engineering.pptxvaishnavi339314
 
Graphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsGraphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsThirunavukarasu Mani
 
Graphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsGraphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsKetan Jani
 
Cs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer keyCs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer keyappasami
 

Similaire à factoring (20)

Randomized algorithms ver 1.0
Randomized algorithms ver 1.0Randomized algorithms ver 1.0
Randomized algorithms ver 1.0
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
 
Introduction to the AKS Primality Test
Introduction to the AKS Primality TestIntroduction to the AKS Primality Test
Introduction to the AKS Primality Test
 
UNIT III.pptx
UNIT III.pptxUNIT III.pptx
UNIT III.pptx
 
CRYPTO 2.pptx
CRYPTO 2.pptxCRYPTO 2.pptx
CRYPTO 2.pptx
 
A study on number theory and its applications
A study on number theory and its applicationsA study on number theory and its applications
A study on number theory and its applications
 
Unit-1 DAA_Notes.pdf
Unit-1 DAA_Notes.pdfUnit-1 DAA_Notes.pdf
Unit-1 DAA_Notes.pdf
 
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
Program on Quasi-Monte Carlo and High-Dimensional Sampling Methods for Applie...
 
Matrix 2 d
Matrix 2 dMatrix 2 d
Matrix 2 d
 
Vivek
VivekVivek
Vivek
 
Binomial
BinomialBinomial
Binomial
 
Principal Component Analysis
Principal Component AnalysisPrincipal Component Analysis
Principal Component Analysis
 
Rosser's theorem
Rosser's theoremRosser's theorem
Rosser's theorem
 
CMSC 56 | Lecture 8: Growth of Functions
CMSC 56 | Lecture 8: Growth of FunctionsCMSC 56 | Lecture 8: Growth of Functions
CMSC 56 | Lecture 8: Growth of Functions
 
Proof Techniques
Proof TechniquesProof Techniques
Proof Techniques
 
DAA - UNIT 4 - Engineering.pptx
DAA - UNIT 4 - Engineering.pptxDAA - UNIT 4 - Engineering.pptx
DAA - UNIT 4 - Engineering.pptx
 
2.ppt
2.ppt2.ppt
2.ppt
 
Graphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsGraphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygons
 
Graphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsGraphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygons
 
Cs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer keyCs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer key
 

Dernier

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 

Dernier (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

factoring

  • 2. Factoring Factoring  Security of RSA algorithm depends on (presumed) difficulty of factoring o Given N = pq, find p or q and RSA is broken o Rabin cipher also based on factoring  Factoring like “exhaustive search” for RSA  Lots of interest/research in factoring  What are best factoring methods? o How does RSA “key size” compare to symmetric cipher key size?
  • 3. Factoring Factoring Methods  Trial division o Obvious method but not practical  Dixon’s algorithm o Less obvious and much faster  Quadratic sieve o Refinement of Dixon’s algorithm o Best algorithm up to about 110 decimal digits  Number field sieve o Best for numbers greater than 100 digits o We only briefly mention this algorithm
  • 4. Factoring Trial Division  Given N, try to divide N by each of 2,3,5,7,9,11,…,sqrt(N)  As soon as a factor found, we are done o So, expected work is about sqrt(N)/2  Improvement: try only prime numbers  Work is then on order of π(N) o Where π(N) ≈ N/ln(N) is number of primes up to N
  • 5. Factoring Congruence of Squares  We want to factor N = pq  Suppose we find x,y such that N = x2 − y2  Then N = (x − y)(x + y), have factored N  More generally, congruence of squares…  Suppose x2 = y2 (mod N)  Then x2 − y2 = kN for some k  Which implies (x − y)(x + y) = kN
  • 6. Factoring Congruence of Squares  Suppose x2 = y2 (mod N)  Then (x − y)(x + y) = kN  Implies (x − y) or (x + y) is factor of N o Or x − y = k and x + y = N (or vice versa)  With probability at least 1/2, we obtain a factor of N o If so, gcd(N, x − y) or gcd(N, x + y) factors N o And the gcd is easy to compute
  • 7. Factoring Congruence of Squares  For example 102 = 32 (mod 91)  That is, (10 − 3)(10 + 3) = 91 o Factors of 91 are, in fact, 7 and 13  Also, 342 = 82 (mod 91) o Then 26⋅42 = 0 (mod 91) and we have gcd(26,91) = 13 and gcd(42,91) = 7  In general, gcd is necessary
  • 8. Factoring Congruence of Squares  Find congruence of squares: x2 = y2 (mod N) and we can likely factor N  How to find congruence of squares?  Consider, for example, 412 = 32 (mod 1649) and 432 = 200 (mod 1649)  Neither 32 nor 200 is a square  But 32⋅200 = 6400 = 802  Therefore, (41⋅43)2 = 802 (mod 1649)
  • 9. Factoring Congruence of Squares  Can combine non-squares to obtain a square, for example 32 = 25 ⋅50 and 200 = 23 ⋅52  And 32⋅200 = 28 ⋅52 = (24 ⋅51 )2  We obtain a perfect square provided each exponent in product is even  Only concerned with exponents and only need consider even or odd, i.e., mod 2
  • 10. Factoring Congruence of Squares  Number has an exponent vector  For example, first element of vector is power of 2 and second power of 5  Then  And
  • 11. Factoring Congruence of Squares  Mod 2 exponent vector of product 200⋅32 is all zero, so perfect square  Also, this vector is sum (mod 2) of vectors for 200 and 32  Any set of exponent vectors that sum to all-zero, mod 2, gives us a square  We need to keep vectors small o Only allow numbers with “small” prime factors
  • 12. Factoring Congruence of Squares  Choose bound B and primes less than B o This is our factor base o For technical reasons, include “−1” in factor base  A number that factors completely over the factor base is B-smooth  Smooth relations factor over factor base  Restrict our attention to B-smooth relations o Good: Exponent vectors are small o Bad: Harder to find relations
  • 13. Factoring Example  Want to factor N = 1829  Choose bound B = 13  Choose factor base −1,2,3,5,7,11,13  Look at values in −N/2 to N/2  To be systematic, we choose sqrt(kN) and sqrt(kN) for k = 1,2,3,4  And test each for B-smoothness
  • 14. Factoring Example  Compute  All are B-smooth except 602 and 752
  • 16. Factoring Example  Find collection of exponent vectors that sum, mod 2, to zero vector  Vectors corresponding to 422 , 432 , 612 and 852 work:
  • 17. Factoring Example  Implies that (42⋅43⋅61⋅85)2 = (2⋅3⋅5⋅ 7⋅13)2 (mod 1829)  Simplifies to 14592 = 9012 (mod 1829)  Since 1459 − 901 = 558, we find factor of 1829 by gcd(558,1829) = 31  Easily verified 1829 = 59⋅31
  • 18. Factoring Example  A systematic way to find set of vectors that sum to zero vector…  In this example, want x0,x1,…,x5  This is a basic linear algebra problem
  • 19. Factoring Linear Algebra  Suppose n elements in factor base o Factor base includes “−1” o Then matrix on previous slide has n rows o Seek linearly dependent set of columns  Theorem: If matrix has n rows and n + 1 or more columns then a linearly dependent set of columns exists  Therefore, if we find n + 1 or more smooth relations, we can solve the linear equations
  • 20. Factoring Dixon’s Algorithm 1. To factor N: select bound B and factor base with n−1 primes less than B and “−1” 2. Select r, compute y = r2 (mod N) Number r can be selected at random 3. If y factors completely over factor base, save mod 2 exponent vector 4. Repeat steps 2 and 3 to obtain n+1 vectors 5. Solve linear system and compute gcd
  • 21. Factoring Dixon’s Algorithm  If factor base is large, easier to find B-smooth relations o But linear algebra problem is harder  Relation finding phase parallelizable o Linear algebra part is not  Next, quadratic sieve o An improved version of Dixon’s algorithm
  • 22. Factoring Quadratic Sieve  Quadratic sieve (QS) algorithm o Dixon’s algorithm “on steroids”  Finding B-smooth relations beefed up  As in Dixon’s algorithm o Choose bound B and factor base of primes less than B o Must find lots of B-smooth relations
  • 23. Factoring Quadratic Sieve  Define quadratic polynomial Q(x) = (sqrt(N) + x)2 − N  The is the “quadratic” in QS  Use Q(x) to find B-smooth values o For each x ∈ [−M,M] compute y = Q(x) o Mod N, we have y = z2 , where z = sqrt(N) + x o Test y for B-smoothness o If y is smooth, save mod 2 exponent vector
  • 24. Factoring Quadratic Sieve  Advantage of QS over Dixon’s is that by using Q(x) we can sieve  What is sieving? Glad you asked…  First, consider sieve of Eratosthenes o Used to sieve for prime numbers  Then modify it for B-smooth numbers
  • 25. Factoring Sieve of Eratosthenes  To find prime numbers less than M  List all numbers 2,3,4,…,M−1  Cross out all numbers with factor of 2, other than 2  Cross out all numbers with factor of 3, other than 3, and so on  Number that “fall thru” sieve are prime
  • 26. Factoring Sieve of Eratosthenes  To find prime numbers less than 31… 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 — — — — ————— — — — — — ⁄ ⁄ ⁄ ⁄ ⁄ ⁄ ⁄ ⁄ ⁄ | | ||| ∩  Find that primes less than 31 are 2,3,5,7,11,13,17,19,23 and 29
  • 27. Factoring Sieve of Eratosthenes  This sieve gives us primes  But also provides info on non-primes  For example, 24 marked with “ ” and “ ” so it is divisible by 2 and 3  Note: we only find that 24 is divisible by 2, not by 4 or 8 — ⁄
  • 28. Factoring Sieving for Smooth Numbers  Instead of crossing out, we divide by the prime (including prime itself) 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 1 3 2 5 3 7 4 9 5  All 1s represent 7-smooth numbers  Some non-1s also 7-smooth o Must divide by highest powers of primes 1 1 1 2 5 1 1 1 1 2
  • 29. Factoring Quadratic Sieve  QS uses similar sieving strategy as on previous slide o And some computational refinements  Suppose p in factor base divides Q(x) o Then p divides Q(x + kp) for all k ≠ 0 (homework) o That is, p divides Q of …,x−2p,x−p,x,x+p,x+2p,… o No need to test these for divisibility by p  This observation allows us to sieve
  • 30. Factoring Quadratic Sieve  One trick to speed up sieving  If Q(x) divisible by p, then Q(x) = 0 (mod p)  Defn of Q implies (sqrt(N) + x)2 = N (mod p)  Square roots of N (mod p), say, sp and p − sp o Let x0 = sp − sqrt(N) and x1 = p − sp − sqrt(N) o Then Q(x0) and Q(x1) divisible by p o Implies Q(x0 + kp) and Q(x1 + kp) divisible by p  Efficient algorithm for these square roots
  • 31. Factoring Quadratic Sieve  How to sieve for B-smooth relations  Array: Q(x) for x = −M,−M+1,…, M−1,M  For first prime p in factor base o Generate all x ∈ [−M,M] for which p divides Q(x) (as described on previous slide) o For each, divide by highest power of p o For each, store power, mod 2, in vector for x  Repeat for all primes in factor base  Numbers reduced to 1 are B-smooth
  • 32. Factoring Quadratic Sieve  Linear algebra phase same as Dixon’s  Sieving is the dominant work  Lots of tricks used to speed up sieving o For example, “logarithms” to avoid division  Multiple Polynomial QS (MPQS) o Multiple polynomials of form (ax+b)2 − N o Can then use smaller interval [−M,M] o Yields much faster parallel implementations
  • 33. Factoring Sieving Conclusions  QS/MPQS attack has two phases  Distributed relation finding phase o Could recruit volunteers on Internet  Linear equation solving phase o For big problems, requires a supercomputer  Number field sieve better than QS o Requires 2 phases, like QS o Number field sieve uses advanced math
  • 34. Factoring Factoring Algorithms  Work to factor N = 2x  Last column measures “bits” of work  Symmetric cipher exhaustive key search: x bit key is x−1 bits of work
  • 35. Factoring QuickTime™ and a TIFF (Uncompressed) decompressor are needed to see this picture. Factoring Algorithms  Comparison of work factors  QS best to 390 bit N o 117 digits  390-bit N is as secure as 60-bit key
  • 36. Factoring Factoring Conclusions  Work for factoring is subexponential o Better than exponential time but worse than polynomial time o Exhaustive key search is exponential  Factoring is active area of research o Expect to see incremental improvement  Next, discrete log algorithms…