SlideShare a Scribd company logo
BACKTRACKING BASED INTEGER
FACTORISATION, PRIMALITY TESTING
AND SQUARE ROOT CALCULATION
Mohammed Golam Kaosar
School of Computing and Mathematics
Charles Sturt University Australia
mkaosar@csu.edu.au

ABSTRACT
Breaking a big integer into two factors is a famous problem in the field of Mathematics and
Cryptography for years. Many crypto-systems use such a big number as their key or part of a
key with the assumption - it is too big that the fastest factorisation algorithms running on the
fastest computers would take impractically long period of time to factorise. Hence, many efforts
have been provided to break those crypto-systems by finding two factors of an integer for
decades. In this paper, a new factorisation technique is proposed which is based on the concept
of backtracking. Binary bit by bit operations are performed to find two factors of a given
integer. This proposed solution can be applied in computing square root, primality test, finding
prime factors of integer numbers etc. If the proposed solution is proven to be efficient enough, it
may break the security of many crypto-systems. Implementation and performance comparison of
the technique is kept for future research.

KEYWORDS
Information Security, Crypto-system, Factorization, Primality test, Backtracking.

1. INTRODUCTION
Integer factorisation is known as the decomposition of a composite integer number into small
divisors. As for example, 91 is a composite integer which is a composition of 7 and 13, i.e. 91 = 7
x 13. Both 7 and 13 are known as the factors of 91. If the factor is a prime number, then it is
known as prime factor. In the above example, both of them are prime factors. As the size of the
number increases, it becomes very difficult to find its factors. Sometimes, a sophisticated
algorithm running in the fastest computer may take hundreds of years to find a factor of a large
number. As a matter of fact, many cryptographic algorithms, such as RSA [11], use a big number
(1024 or 2048 bits) in generating keys with the assumption that, fastest technique with the help of
many computers would not be able to factorise that number within a practically feasible time.
This paper proposes a new technique to decompose a composite integer into two factors using
backtracking technique. Repetitive application of the proposed technique will find all possible
David C. Wyld et al. (Eds) : CCSIT, SIPP, AISC, PDCTA, NLP - 2014
pp. 77–83, 2014. © CS & IT-CSCP 2014

DOI : 10.5121/csit.2014.4207
78

Computer Science & Information Technology (CS & IT)

factors of a given integer number. The proposed solution also can be used in testing the primality
and finding the square root of an integer (if there exist any).
The impact of the proposed solution can be tremendous, depending upon its performance. If it can
factorise a big number (as big as the number used in some crypto-systems) within a practically
feasible amount of time, it would make a big change in the field of Cryptography. Further impact,
implementation and performance analyses are kept for future research.
The rest of the paper is organised as follows: Section 2 presents existing solutions for factorising
integer numbers in brief. Section 3 discusses the proposed solution with an example and Section 4
concludes the paper with some future research directions.

2. EXISTING SOLUTIONS
There have been many efforts proposed to factorize an integer number. The use of prime factors
in crypto-systems increased much research interest to finding a practical solution to factorise a
big integer. Integer factorization intrinsically leads towards the solution of primality testing and
finding square root of an integer number. Some of the existing solutions are as follows:
•

Trial Division: Trial division algorithm finds whether a given integer N is divisible by
any positive number less than N. This is a simple and brute force approach which is very
time consuming to find a solution.

•

Wheel Factorisation: This is a graphical method of factorising an integer. In this method,
natural numbers are marked around the wheel to form spokes of primes and their
multiples.

•

ρ1 = 1 and
Rho Methods: Rho ( ρ ) method generates ρ1, ρ2, ρ3… where
parameter 10 is chosen by users. This method finds factors of N by computing gcd(N,
(ρ2- ρ1) (ρ4 – ρ2)….( ρ2n – ρn )). Parameter n is also chosen by user. This method initially
was proposed by Pollard [8]. Some variations, improvements and optimisations of Rho
methods are proposed in – [9], [2], [1] etc.

•

Fermat's and Euler's Factorisation: Fermat's Factorisation technique [7] represents odd
integer N as a2 – b2 where both a and b are positive integer. Thus, N is equal to a2 – b2 =
( a + b ) ( a – b ) and factors are ( a + b ) and ( a – b ). In Euler's Factorisation technique
[6], N is represented as a2 + b2 and c2 + d2, where a, b, c and d are positive integers.

•

Other Methods: Various other methods of factorisation algorithms are: group
factorisation technique of Pollard's ρ – 1 [8], William’s ρ + 1 factorisation [12], Lenstra’s
elliptic curve factorization [5]; Dixon’s factorization [3]; Quadratic sieve factorization
[10] etc.

3. PROPOSED SOLUTION
This section presents the proposed solution to factorize an integer with a simple example. The
solution is also extended for primality testing and square root calculation.
Computer Science & Information Technology (CS & IT)

3.1 Factorising an Integer

Figure 1: Binary standard multiplication of A and B to produce N

Shifted Multiplicands Matrix (SMM), as shown in Figure 2, has the dimension of
with entry as follows:

Figure 2: SMM block diagram

79
80

Computer Science & Information Technology (CS & IT)

Each bit in N is a binary summation of bits of SMM's corresponding positions, as displayed in
Equation 2. Where, Sk and Ck are the sum and carry bit of SMM entries at column k.

Further detail of binary multiplication method can be found in [4].
Now an algorithm is to be developed which would choose ai and bi in such a way that, nk
calculated in Equation 2 becomes equal to rk, for all k ≤ ( 2l – 1). Following example explains
how a number is factorised using the proposed technique.
3.1.1 An Example
Say an integer R = 12 and hence, m = 4. We have to find two factors, A and B, or R. Binary
representation of R, A, B and S M M, as discussed in Section 3.1, are now showed in step 1 of
Fig. 3, where fields of A and B are empty and entries of S M M are set to 0 initially.
We need to consider every bit of R from right to left. In Step 2 we try to choose values for a1, b1
and S M M [1] [1] such that n1 calculated using Equation 2 becomes equal to r1. Therefore,
S M M [1] [1] must be 0. Possible values of { a1, b1 } could be { 0,0 } or { 1,0} or { 0,1}, but
cannot be {1,1}. Let us say we choose { 0, 0}. Now immediately we can set S M M [2] [2] =
S M M [3] [3] = 0, since a1 would make these values to 0 regardless of the value of bi, i = 1 to l.
Similarly S M M [1] [2] = S M M [1] [3] = 0, since b1 would make these values to 0 regardless of
the value of ai, i = 1 to l.
Now, we move to the next bit of R in step 3. Values of SMM in column 2 are already consistent.
We have the option to choose any value for {a2, b2}. Say us choose {1, 1}. Therefore, S M M
[2][3] can be set to 1. Similarly we consider for r3 in Step 4. Only one position of S M M in this
column is left which has to be 0 to be consistent with r3. Choose any value for {a3, b3}. Let us
say we choose {0,0}. Hence S M M [2][4] and S M M [2][5] have to be 0. But in the next column
(column 4), all values become 0. Therefore, a conflict arises, since the summation could not
produce a value equal to r4. Hence, a backtracking will be necessary for r3. Now, let us try with
the values of {a3, b3} an {1,1} in Step 5. This time it creates conflict too. In next step, let us try
with {a3, b3} - {1,0} in step 6. Now the values of A, B and S M M becomes consistent with that
of R. Therefore, two factors of R would be A = 6 and B = 2.
Computer Science & Information Technology (CS & IT)

Figure 3: Steps of factorisation for the example

3.1.2 The Algorithm
The proposed solution appears in the following algorithm in a concised manner:

81
82

Computer Science & Information Technology (CS & IT)

3.2 Primality Test and Square Root
The proposed factorisation technique can easily be extended for the following solutions:
Square Root
If we set or require, A and B must be equal, then we get the square root of R (if it is a perfect
square) in A and B. In this case, the computation even would be quicker, since more values of
SMM would be pre-set.
Primality Test
If the proposed algorithm finds no solution after finishing all steps then, (R) is a prime number.

4. CONCLUSION AND FUTURE WORK
In spite of the existence of many factorisation techniques, cryptographic algorithms are still in
work with the assumption that, factorising a very large number would take too long time to be
practical for the crypto-system to be insecure. Therefore, a new solution in the factorisation
family should draw much attention to the crypto-community. In this paper, only the algorithm is
discussed in brief without considering its implementation and performance evaluation. If the
proposed solution performs such that, it becomes capable to factorise those big numbers, then it
may break the security of some crypto-systems, such as RSA.
In future, the algorithm can be implemented to measure its performance. It is also important to
see whether this solution can factorise very big numbers used in some crypto-systems. If fails,
still its performance can be compared with other existing factorisation solutions. A hybrid
approach also can be thought to engage this solution with others. The algorithm itself can be
improved by introducing some pruning and optimisation techniques too.
Computer Science & Information Technology (CS & IT)

83

REFERENCES
[1]

Richard P. Brent. An improved monte carlo factorization algorithm. BIT Numerical Mathematics,
20:176-184, 1980. 10.1007/BF01933190.
[2] Richard P. Brent. Factorization of the tenth fermat number. MATH.COMP, 68:429-451, 1999.
[3] J. D. Dixon. Asymptotically fast factorization of integers. Math. Comp.,36 (153):255260, 1981.
[4] Harris and David. Digital Design and Computer Architecture : From Gates to Processors. Elsevier,
Burlington 2007, 2007.
[5] A.K. Lenstra. Fast and rigorous factorization under the generalized riemann hypothesis. Indagationes
Mathematicae (Proceedings), 91(4):443-454, 1988.
[6] James Mckee. Turning euler's factoring method into a factoring algorithm. Bulletin of the London
Mathematical Society, 28, 1996.
[7] James McKee. Speeding fermat's factoring method. Math. Comput.,68(228):1729-1737, October
1999.
[8] J. M. Pollard. Theorems on factorization and primality testing. Mathematical Proceedings of the
Cambridge Philosophical Society, 76:521-528,1974.
[9] J. M. Pollard. A monte carlo method for factorization. BIT Numerical Mathematics, 15:331-334,
1975. 10.1007/BF01933667.
[10] Carl Pomerance. The quadratic sieve factoring algorithm. In Thomas Beth, Norbert Cot, and Ingemar
Ingemarsson, editors, Advances in Cryptology, volume 209 of Lecture Notes in Computer Science,
pages 169-182. Springer Berlin / Heidelberg, 1985. 10.1007/3-540-39757-417.
[11] R. L. Rivest, A. Shamir, and L. Adleman. A method for obtaining digital signatures and public-key
cryptosystems. Commun. ACM, 21(2):120-126, 1978.
[12] H. C. Williams. A p + 1 method of factoring. Math. Comput., 39:225-234,1982.

AUTHOR
Dr. Mohammed Kaosar is one of the faculty members in the School of Computing
and Mathematics, Faculty of Business, Charles Sturt University, Australia. He has
wide experience of teaching various ICT courses in several universities in
Australia, KSA and Bangladesh. Previously, he used to work as a post-doc
research fellow after his completion of PhD from the School of Engineering and
Science, Victoria University Melbourne, Australia. Prior to that, Dr. Kaosar
finished his MS in Computer Engineering and BSc in Computer Science and
Engineering in the year of 2006 and 2001 from KSA and Bangladesh respectively.
He also has experience of working in many academic, research and commercial
projects. He has published good number of research papers in high quality
journals and conferences including, IEEE Transactions on Knowledge and Data
Engineering (TKDE), Data & Knowledge Engineering (DKE), Computer Communications, IEEE
International Conference on Data Engineering (ICDE- 2012) etc. He is an active member of various
professional associations including IEEE, EAI.
Ad

Recommended

Unit 2
Unit 2
Gunasundari Selvaraj
 
Unit 5
Unit 5
Gunasundari Selvaraj
 
Algorithm analysis
Algorithm analysis
Nisha Soms
 
Improving the initial values of VFactor suitable for balanced modulus
Improving the initial values of VFactor suitable for balanced modulus
IJECEIAES
 
L1803016468
L1803016468
IOSR Journals
 
I1803014852
I1803014852
IOSR Journals
 
Design and analysis of algorithms - Abstract View
Design and analysis of algorithms - Abstract View
Waqas Nawaz
 
Daa unit 2
Daa unit 2
snehajiyani
 
Slide1
Slide1
Thiti Sununta
 
Branch and bound technique
Branch and bound technique
ishmecse13
 
Design & Analysis Of Algorithm
Design & Analysis Of Algorithm
Computer Hardware & Trouble shooting
 
Data structure and algorithm notes
Data structure and algorithm notes
suman khadka
 
Design and analysis of algorithms
Design and analysis of algorithms
Dr Geetha Mohan
 
Cs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer key
appasami
 
algorithm Unit 2
algorithm Unit 2
Monika Choudhery
 
ADA complete notes
ADA complete notes
Vinay Kumar C
 
Fully fuzzy time cost trade-off in a project network - a new approach
Fully fuzzy time cost trade-off in a project network - a new approach
Alexander Decker
 
Notion of an algorithm
Notion of an algorithm
Nisha Soms
 
Daa unit 1
Daa unit 1
jinalgoti
 
Daa notes 1
Daa notes 1
smruti sarangi
 
Programming in python
Programming in python
Ivan Rojas
 
COCOON14
COCOON14
Yuan Tang
 
Daa notes 2
Daa notes 2
smruti sarangi
 
Design and analysis of computer algorithms
Design and analysis of computer algorithms
Krishna Chaytaniah
 
Algorithm analysis (All in one)
Algorithm analysis (All in one)
jehan1987
 
chapter 1
chapter 1
yatheesha
 
Bm35359363
Bm35359363
IJERA Editor
 
A Novel Design For Generating Dynamic Length Message Digest To Ensure Integri...
A Novel Design For Generating Dynamic Length Message Digest To Ensure Integri...
IRJET Journal
 
New Two-Step Method with Fifth-Order Convergence for Solving Nonlinear Equations
New Two-Step Method with Fifth-Order Convergence for Solving Nonlinear Equations
inventionjournals
 
IMPROVED QUALITY OF SERVICE PROTOCOL FOR REAL TIME TRAFFIC IN MANET
IMPROVED QUALITY OF SERVICE PROTOCOL FOR REAL TIME TRAFFIC IN MANET
IJCNCJournal
 

More Related Content

What's hot (20)

Slide1
Slide1
Thiti Sununta
 
Branch and bound technique
Branch and bound technique
ishmecse13
 
Design & Analysis Of Algorithm
Design & Analysis Of Algorithm
Computer Hardware & Trouble shooting
 
Data structure and algorithm notes
Data structure and algorithm notes
suman khadka
 
Design and analysis of algorithms
Design and analysis of algorithms
Dr Geetha Mohan
 
Cs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer key
appasami
 
algorithm Unit 2
algorithm Unit 2
Monika Choudhery
 
ADA complete notes
ADA complete notes
Vinay Kumar C
 
Fully fuzzy time cost trade-off in a project network - a new approach
Fully fuzzy time cost trade-off in a project network - a new approach
Alexander Decker
 
Notion of an algorithm
Notion of an algorithm
Nisha Soms
 
Daa unit 1
Daa unit 1
jinalgoti
 
Daa notes 1
Daa notes 1
smruti sarangi
 
Programming in python
Programming in python
Ivan Rojas
 
COCOON14
COCOON14
Yuan Tang
 
Daa notes 2
Daa notes 2
smruti sarangi
 
Design and analysis of computer algorithms
Design and analysis of computer algorithms
Krishna Chaytaniah
 
Algorithm analysis (All in one)
Algorithm analysis (All in one)
jehan1987
 
chapter 1
chapter 1
yatheesha
 
Bm35359363
Bm35359363
IJERA Editor
 
A Novel Design For Generating Dynamic Length Message Digest To Ensure Integri...
A Novel Design For Generating Dynamic Length Message Digest To Ensure Integri...
IRJET Journal
 
Branch and bound technique
Branch and bound technique
ishmecse13
 
Data structure and algorithm notes
Data structure and algorithm notes
suman khadka
 
Design and analysis of algorithms
Design and analysis of algorithms
Dr Geetha Mohan
 
Cs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer key
appasami
 
Fully fuzzy time cost trade-off in a project network - a new approach
Fully fuzzy time cost trade-off in a project network - a new approach
Alexander Decker
 
Notion of an algorithm
Notion of an algorithm
Nisha Soms
 
Programming in python
Programming in python
Ivan Rojas
 
Design and analysis of computer algorithms
Design and analysis of computer algorithms
Krishna Chaytaniah
 
Algorithm analysis (All in one)
Algorithm analysis (All in one)
jehan1987
 
A Novel Design For Generating Dynamic Length Message Digest To Ensure Integri...
A Novel Design For Generating Dynamic Length Message Digest To Ensure Integri...
IRJET Journal
 

Viewers also liked (20)

New Two-Step Method with Fifth-Order Convergence for Solving Nonlinear Equations
New Two-Step Method with Fifth-Order Convergence for Solving Nonlinear Equations
inventionjournals
 
IMPROVED QUALITY OF SERVICE PROTOCOL FOR REAL TIME TRAFFIC IN MANET
IMPROVED QUALITY OF SERVICE PROTOCOL FOR REAL TIME TRAFFIC IN MANET
IJCNCJournal
 
An Efficient Queuing Model for Resource Sharing in Cloud Computing
An Efficient Queuing Model for Resource Sharing in Cloud Computing
theijes
 
Windstream Hosted Solutions: Public Cloud Security
Windstream Hosted Solutions: Public Cloud Security
Jason Proctor
 
AlgoPerm2012 - 08 Jean Cardinal
AlgoPerm2012 - 08 Jean Cardinal
AlgoPerm 2012
 
A survey of peer-to-peer content distribution technologies
A survey of peer-to-peer content distribution technologies
sharefish
 
SEM ICT Integration SITE2012
SEM ICT Integration SITE2012
Jason Zagami
 
AN IMPROVED ITERATIVE METHOD FOR SOLVING GENERAL SYSTEM OF EQUATIONS VIA GENE...
AN IMPROVED ITERATIVE METHOD FOR SOLVING GENERAL SYSTEM OF EQUATIONS VIA GENE...
Zac Darcy
 
Startup & Change the World: Guide for Young Social Entrepreneurs
Startup & Change the World: Guide for Young Social Entrepreneurs
xmergnc
 
REDUCTION IN THE TRANSIENT TIME OF SHUNT ACTIVE FILTERS USING INTELLIGENT CON...
REDUCTION IN THE TRANSIENT TIME OF SHUNT ACTIVE FILTERS USING INTELLIGENT CON...
ijscmc
 
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Paolo Negri
 
Webinar Monitoring in era of cloud computing
Webinar Monitoring in era of cloud computing
CREATE-NET
 
Georgia Tech: Performance Engineering - Queuing Theory and Predictive Modeling
Georgia Tech: Performance Engineering - Queuing Theory and Predictive Modeling
Brian Wilson
 
Basics on Decision Making
Basics on Decision Making
Guillaume Guérard
 
Computer graphics homework help
Computer graphics homework help
john mayer
 
Learning Styles and Learning Objects for Higher Education Teaching
Learning Styles and Learning Objects for Higher Education Teaching
sarahswart
 
SMART GRID USING WSN
SMART GRID USING WSN
Jaganya Naina
 
Big Data and Advanced Data Intensive Computing
Big Data and Advanced Data Intensive Computing
Jongwook Woo
 
Pine Ridge Mathematics Association Social Night - Making Math Contextual, Vis...
Pine Ridge Mathematics Association Social Night - Making Math Contextual, Vis...
Kyle Pearce
 
Life and Work of Ronald L. Rivest, Adi Shamir & Leonard M. Adleman | Turing10...
Life and Work of Ronald L. Rivest, Adi Shamir & Leonard M. Adleman | Turing10...
Persistent Systems Ltd.
 
New Two-Step Method with Fifth-Order Convergence for Solving Nonlinear Equations
New Two-Step Method with Fifth-Order Convergence for Solving Nonlinear Equations
inventionjournals
 
IMPROVED QUALITY OF SERVICE PROTOCOL FOR REAL TIME TRAFFIC IN MANET
IMPROVED QUALITY OF SERVICE PROTOCOL FOR REAL TIME TRAFFIC IN MANET
IJCNCJournal
 
An Efficient Queuing Model for Resource Sharing in Cloud Computing
An Efficient Queuing Model for Resource Sharing in Cloud Computing
theijes
 
Windstream Hosted Solutions: Public Cloud Security
Windstream Hosted Solutions: Public Cloud Security
Jason Proctor
 
AlgoPerm2012 - 08 Jean Cardinal
AlgoPerm2012 - 08 Jean Cardinal
AlgoPerm 2012
 
A survey of peer-to-peer content distribution technologies
A survey of peer-to-peer content distribution technologies
sharefish
 
SEM ICT Integration SITE2012
SEM ICT Integration SITE2012
Jason Zagami
 
AN IMPROVED ITERATIVE METHOD FOR SOLVING GENERAL SYSTEM OF EQUATIONS VIA GENE...
AN IMPROVED ITERATIVE METHOD FOR SOLVING GENERAL SYSTEM OF EQUATIONS VIA GENE...
Zac Darcy
 
Startup & Change the World: Guide for Young Social Entrepreneurs
Startup & Change the World: Guide for Young Social Entrepreneurs
xmergnc
 
REDUCTION IN THE TRANSIENT TIME OF SHUNT ACTIVE FILTERS USING INTELLIGENT CON...
REDUCTION IN THE TRANSIENT TIME OF SHUNT ACTIVE FILTERS USING INTELLIGENT CON...
ijscmc
 
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Paolo Negri
 
Webinar Monitoring in era of cloud computing
Webinar Monitoring in era of cloud computing
CREATE-NET
 
Georgia Tech: Performance Engineering - Queuing Theory and Predictive Modeling
Georgia Tech: Performance Engineering - Queuing Theory and Predictive Modeling
Brian Wilson
 
Computer graphics homework help
Computer graphics homework help
john mayer
 
Learning Styles and Learning Objects for Higher Education Teaching
Learning Styles and Learning Objects for Higher Education Teaching
sarahswart
 
SMART GRID USING WSN
SMART GRID USING WSN
Jaganya Naina
 
Big Data and Advanced Data Intensive Computing
Big Data and Advanced Data Intensive Computing
Jongwook Woo
 
Pine Ridge Mathematics Association Social Night - Making Math Contextual, Vis...
Pine Ridge Mathematics Association Social Night - Making Math Contextual, Vis...
Kyle Pearce
 
Life and Work of Ronald L. Rivest, Adi Shamir & Leonard M. Adleman | Turing10...
Life and Work of Ronald L. Rivest, Adi Shamir & Leonard M. Adleman | Turing10...
Persistent Systems Ltd.
 
Ad

Similar to Backtracking based integer factorisation, primality testing and square root calculation (20)

Integer Factorization in cyber security.pptx
Integer Factorization in cyber security.pptx
iamipn03
 
NFSFIXES
NFSFIXES
Robert Reynoldson
 
Advances in composite integer factorization
Advances in composite integer factorization
Alexander Decker
 
Various other factorizing algorithm.pptx
Various other factorizing algorithm.pptx
Geeta Arora
 
A New Deterministic RSA-Factoring Algorithm
A New Deterministic RSA-Factoring Algorithm
Jim Jimenez
 
chap3.pdf
chap3.pdf
eseinsei
 
The new integer factorization algorithm based on fermat’s factorization algor...
The new integer factorization algorithm based on fermat’s factorization algor...
IJECEIAES
 
Security Attacks on RSA
Security Attacks on RSA
Pratik Poddar
 
Lecture-1.pptx
Lecture-1.pptx
NiharikaThakur32
 
25010001
25010001
Premavardhan Reddy
 
FACTORING CRYPTOSYSTEM MODULI WHEN THE CO-FACTORS DIFFERENCE IS BOUNDED
FACTORING CRYPTOSYSTEM MODULI WHEN THE CO-FACTORS DIFFERENCE IS BOUNDED
Zac Darcy
 
CS8461 - Design and Analysis of Algorithms
CS8461 - Design and Analysis of Algorithms
Krishnan MuthuManickam
 
Security_Attacks_On_RSA~ A Computational Number Theoretic Approach.pptx
Security_Attacks_On_RSA~ A Computational Number Theoretic Approach.pptx
shahiduljahid71
 
Digit Factorial Chains .(Euler Problem -74) (Matlab Programming Solution)
Digit Factorial Chains .(Euler Problem -74) (Matlab Programming Solution)
Omkar Rane
 
Lec-9gdfweerwertwertvgwertwertevrgwgtwertertgdfg.pdf
Lec-9gdfweerwertwertvgwertwertevrgwgtwertertgdfg.pdf
GolamKaderye2
 
factoring
factoring
Harish Sahu
 
BCS401 ADA Module 1 PPT 2024-25 IV SEM.pptx
BCS401 ADA Module 1 PPT 2024-25 IV SEM.pptx
VENKATESHBHAT25
 
Buacm 3
Buacm 3
Lifeparticle
 
Coding Concept.ppt
Coding Concept.ppt
ssuser3b64952
 
2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiou
vafopoulos
 
Integer Factorization in cyber security.pptx
Integer Factorization in cyber security.pptx
iamipn03
 
Advances in composite integer factorization
Advances in composite integer factorization
Alexander Decker
 
Various other factorizing algorithm.pptx
Various other factorizing algorithm.pptx
Geeta Arora
 
A New Deterministic RSA-Factoring Algorithm
A New Deterministic RSA-Factoring Algorithm
Jim Jimenez
 
The new integer factorization algorithm based on fermat’s factorization algor...
The new integer factorization algorithm based on fermat’s factorization algor...
IJECEIAES
 
Security Attacks on RSA
Security Attacks on RSA
Pratik Poddar
 
FACTORING CRYPTOSYSTEM MODULI WHEN THE CO-FACTORS DIFFERENCE IS BOUNDED
FACTORING CRYPTOSYSTEM MODULI WHEN THE CO-FACTORS DIFFERENCE IS BOUNDED
Zac Darcy
 
CS8461 - Design and Analysis of Algorithms
CS8461 - Design and Analysis of Algorithms
Krishnan MuthuManickam
 
Security_Attacks_On_RSA~ A Computational Number Theoretic Approach.pptx
Security_Attacks_On_RSA~ A Computational Number Theoretic Approach.pptx
shahiduljahid71
 
Digit Factorial Chains .(Euler Problem -74) (Matlab Programming Solution)
Digit Factorial Chains .(Euler Problem -74) (Matlab Programming Solution)
Omkar Rane
 
Lec-9gdfweerwertwertvgwertwertevrgwgtwertertgdfg.pdf
Lec-9gdfweerwertwertvgwertwertevrgwgtwertertgdfg.pdf
GolamKaderye2
 
BCS401 ADA Module 1 PPT 2024-25 IV SEM.pptx
BCS401 ADA Module 1 PPT 2024-25 IV SEM.pptx
VENKATESHBHAT25
 
2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiou
vafopoulos
 
Ad

Recently uploaded (20)

The Future of Data, AI, and AR: Innovation Inspired by You.pdf
The Future of Data, AI, and AR: Innovation Inspired by You.pdf
Safe Software
 
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
2025_06_18 - OpenMetadata Community Meeting.pdf
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
cnc-processing-centers-centateq-p-110-en.pdf
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
Powering Multi-Page Web Applications Using Flow Apps and FME Data Streaming
Powering Multi-Page Web Applications Using Flow Apps and FME Data Streaming
Safe Software
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
 
"Database isolation: how we deal with hundreds of direct connections to the d...
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
OpenPOWER Foundation & Open-Source Core Innovations
OpenPOWER Foundation & Open-Source Core Innovations
IBM
 
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
Priyanka Aash
 
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Impelsys Inc.
 
Techniques for Automatic Device Identification and Network Assignment.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
The Future of Data, AI, and AR: Innovation Inspired by You.pdf
The Future of Data, AI, and AR: Innovation Inspired by You.pdf
Safe Software
 
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
2025_06_18 - OpenMetadata Community Meeting.pdf
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
cnc-processing-centers-centateq-p-110-en.pdf
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
Powering Multi-Page Web Applications Using Flow Apps and FME Data Streaming
Powering Multi-Page Web Applications Using Flow Apps and FME Data Streaming
Safe Software
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
 
"Database isolation: how we deal with hundreds of direct connections to the d...
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
OpenPOWER Foundation & Open-Source Core Innovations
OpenPOWER Foundation & Open-Source Core Innovations
IBM
 
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
Priyanka Aash
 
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Impelsys Inc.
 
Techniques for Automatic Device Identification and Network Assignment.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 

Backtracking based integer factorisation, primality testing and square root calculation

  • 1. BACKTRACKING BASED INTEGER FACTORISATION, PRIMALITY TESTING AND SQUARE ROOT CALCULATION Mohammed Golam Kaosar School of Computing and Mathematics Charles Sturt University Australia [email protected] ABSTRACT Breaking a big integer into two factors is a famous problem in the field of Mathematics and Cryptography for years. Many crypto-systems use such a big number as their key or part of a key with the assumption - it is too big that the fastest factorisation algorithms running on the fastest computers would take impractically long period of time to factorise. Hence, many efforts have been provided to break those crypto-systems by finding two factors of an integer for decades. In this paper, a new factorisation technique is proposed which is based on the concept of backtracking. Binary bit by bit operations are performed to find two factors of a given integer. This proposed solution can be applied in computing square root, primality test, finding prime factors of integer numbers etc. If the proposed solution is proven to be efficient enough, it may break the security of many crypto-systems. Implementation and performance comparison of the technique is kept for future research. KEYWORDS Information Security, Crypto-system, Factorization, Primality test, Backtracking. 1. INTRODUCTION Integer factorisation is known as the decomposition of a composite integer number into small divisors. As for example, 91 is a composite integer which is a composition of 7 and 13, i.e. 91 = 7 x 13. Both 7 and 13 are known as the factors of 91. If the factor is a prime number, then it is known as prime factor. In the above example, both of them are prime factors. As the size of the number increases, it becomes very difficult to find its factors. Sometimes, a sophisticated algorithm running in the fastest computer may take hundreds of years to find a factor of a large number. As a matter of fact, many cryptographic algorithms, such as RSA [11], use a big number (1024 or 2048 bits) in generating keys with the assumption that, fastest technique with the help of many computers would not be able to factorise that number within a practically feasible time. This paper proposes a new technique to decompose a composite integer into two factors using backtracking technique. Repetitive application of the proposed technique will find all possible David C. Wyld et al. (Eds) : CCSIT, SIPP, AISC, PDCTA, NLP - 2014 pp. 77–83, 2014. © CS & IT-CSCP 2014 DOI : 10.5121/csit.2014.4207
  • 2. 78 Computer Science & Information Technology (CS & IT) factors of a given integer number. The proposed solution also can be used in testing the primality and finding the square root of an integer (if there exist any). The impact of the proposed solution can be tremendous, depending upon its performance. If it can factorise a big number (as big as the number used in some crypto-systems) within a practically feasible amount of time, it would make a big change in the field of Cryptography. Further impact, implementation and performance analyses are kept for future research. The rest of the paper is organised as follows: Section 2 presents existing solutions for factorising integer numbers in brief. Section 3 discusses the proposed solution with an example and Section 4 concludes the paper with some future research directions. 2. EXISTING SOLUTIONS There have been many efforts proposed to factorize an integer number. The use of prime factors in crypto-systems increased much research interest to finding a practical solution to factorise a big integer. Integer factorization intrinsically leads towards the solution of primality testing and finding square root of an integer number. Some of the existing solutions are as follows: • Trial Division: Trial division algorithm finds whether a given integer N is divisible by any positive number less than N. This is a simple and brute force approach which is very time consuming to find a solution. • Wheel Factorisation: This is a graphical method of factorising an integer. In this method, natural numbers are marked around the wheel to form spokes of primes and their multiples. • ρ1 = 1 and Rho Methods: Rho ( ρ ) method generates ρ1, ρ2, ρ3… where parameter 10 is chosen by users. This method finds factors of N by computing gcd(N, (ρ2- ρ1) (ρ4 – ρ2)….( ρ2n – ρn )). Parameter n is also chosen by user. This method initially was proposed by Pollard [8]. Some variations, improvements and optimisations of Rho methods are proposed in – [9], [2], [1] etc. • Fermat's and Euler's Factorisation: Fermat's Factorisation technique [7] represents odd integer N as a2 – b2 where both a and b are positive integer. Thus, N is equal to a2 – b2 = ( a + b ) ( a – b ) and factors are ( a + b ) and ( a – b ). In Euler's Factorisation technique [6], N is represented as a2 + b2 and c2 + d2, where a, b, c and d are positive integers. • Other Methods: Various other methods of factorisation algorithms are: group factorisation technique of Pollard's ρ – 1 [8], William’s ρ + 1 factorisation [12], Lenstra’s elliptic curve factorization [5]; Dixon’s factorization [3]; Quadratic sieve factorization [10] etc. 3. PROPOSED SOLUTION This section presents the proposed solution to factorize an integer with a simple example. The solution is also extended for primality testing and square root calculation.
  • 3. Computer Science & Information Technology (CS & IT) 3.1 Factorising an Integer Figure 1: Binary standard multiplication of A and B to produce N Shifted Multiplicands Matrix (SMM), as shown in Figure 2, has the dimension of with entry as follows: Figure 2: SMM block diagram 79
  • 4. 80 Computer Science & Information Technology (CS & IT) Each bit in N is a binary summation of bits of SMM's corresponding positions, as displayed in Equation 2. Where, Sk and Ck are the sum and carry bit of SMM entries at column k. Further detail of binary multiplication method can be found in [4]. Now an algorithm is to be developed which would choose ai and bi in such a way that, nk calculated in Equation 2 becomes equal to rk, for all k ≤ ( 2l – 1). Following example explains how a number is factorised using the proposed technique. 3.1.1 An Example Say an integer R = 12 and hence, m = 4. We have to find two factors, A and B, or R. Binary representation of R, A, B and S M M, as discussed in Section 3.1, are now showed in step 1 of Fig. 3, where fields of A and B are empty and entries of S M M are set to 0 initially. We need to consider every bit of R from right to left. In Step 2 we try to choose values for a1, b1 and S M M [1] [1] such that n1 calculated using Equation 2 becomes equal to r1. Therefore, S M M [1] [1] must be 0. Possible values of { a1, b1 } could be { 0,0 } or { 1,0} or { 0,1}, but cannot be {1,1}. Let us say we choose { 0, 0}. Now immediately we can set S M M [2] [2] = S M M [3] [3] = 0, since a1 would make these values to 0 regardless of the value of bi, i = 1 to l. Similarly S M M [1] [2] = S M M [1] [3] = 0, since b1 would make these values to 0 regardless of the value of ai, i = 1 to l. Now, we move to the next bit of R in step 3. Values of SMM in column 2 are already consistent. We have the option to choose any value for {a2, b2}. Say us choose {1, 1}. Therefore, S M M [2][3] can be set to 1. Similarly we consider for r3 in Step 4. Only one position of S M M in this column is left which has to be 0 to be consistent with r3. Choose any value for {a3, b3}. Let us say we choose {0,0}. Hence S M M [2][4] and S M M [2][5] have to be 0. But in the next column (column 4), all values become 0. Therefore, a conflict arises, since the summation could not produce a value equal to r4. Hence, a backtracking will be necessary for r3. Now, let us try with the values of {a3, b3} an {1,1} in Step 5. This time it creates conflict too. In next step, let us try with {a3, b3} - {1,0} in step 6. Now the values of A, B and S M M becomes consistent with that of R. Therefore, two factors of R would be A = 6 and B = 2.
  • 5. Computer Science & Information Technology (CS & IT) Figure 3: Steps of factorisation for the example 3.1.2 The Algorithm The proposed solution appears in the following algorithm in a concised manner: 81
  • 6. 82 Computer Science & Information Technology (CS & IT) 3.2 Primality Test and Square Root The proposed factorisation technique can easily be extended for the following solutions: Square Root If we set or require, A and B must be equal, then we get the square root of R (if it is a perfect square) in A and B. In this case, the computation even would be quicker, since more values of SMM would be pre-set. Primality Test If the proposed algorithm finds no solution after finishing all steps then, (R) is a prime number. 4. CONCLUSION AND FUTURE WORK In spite of the existence of many factorisation techniques, cryptographic algorithms are still in work with the assumption that, factorising a very large number would take too long time to be practical for the crypto-system to be insecure. Therefore, a new solution in the factorisation family should draw much attention to the crypto-community. In this paper, only the algorithm is discussed in brief without considering its implementation and performance evaluation. If the proposed solution performs such that, it becomes capable to factorise those big numbers, then it may break the security of some crypto-systems, such as RSA. In future, the algorithm can be implemented to measure its performance. It is also important to see whether this solution can factorise very big numbers used in some crypto-systems. If fails, still its performance can be compared with other existing factorisation solutions. A hybrid approach also can be thought to engage this solution with others. The algorithm itself can be improved by introducing some pruning and optimisation techniques too.
  • 7. Computer Science & Information Technology (CS & IT) 83 REFERENCES [1] Richard P. Brent. An improved monte carlo factorization algorithm. BIT Numerical Mathematics, 20:176-184, 1980. 10.1007/BF01933190. [2] Richard P. Brent. Factorization of the tenth fermat number. MATH.COMP, 68:429-451, 1999. [3] J. D. Dixon. Asymptotically fast factorization of integers. Math. Comp.,36 (153):255260, 1981. [4] Harris and David. Digital Design and Computer Architecture : From Gates to Processors. Elsevier, Burlington 2007, 2007. [5] A.K. Lenstra. Fast and rigorous factorization under the generalized riemann hypothesis. Indagationes Mathematicae (Proceedings), 91(4):443-454, 1988. [6] James Mckee. Turning euler's factoring method into a factoring algorithm. Bulletin of the London Mathematical Society, 28, 1996. [7] James McKee. Speeding fermat's factoring method. Math. Comput.,68(228):1729-1737, October 1999. [8] J. M. Pollard. Theorems on factorization and primality testing. Mathematical Proceedings of the Cambridge Philosophical Society, 76:521-528,1974. [9] J. M. Pollard. A monte carlo method for factorization. BIT Numerical Mathematics, 15:331-334, 1975. 10.1007/BF01933667. [10] Carl Pomerance. The quadratic sieve factoring algorithm. In Thomas Beth, Norbert Cot, and Ingemar Ingemarsson, editors, Advances in Cryptology, volume 209 of Lecture Notes in Computer Science, pages 169-182. Springer Berlin / Heidelberg, 1985. 10.1007/3-540-39757-417. [11] R. L. Rivest, A. Shamir, and L. Adleman. A method for obtaining digital signatures and public-key cryptosystems. Commun. ACM, 21(2):120-126, 1978. [12] H. C. Williams. A p + 1 method of factoring. Math. Comput., 39:225-234,1982. AUTHOR Dr. Mohammed Kaosar is one of the faculty members in the School of Computing and Mathematics, Faculty of Business, Charles Sturt University, Australia. He has wide experience of teaching various ICT courses in several universities in Australia, KSA and Bangladesh. Previously, he used to work as a post-doc research fellow after his completion of PhD from the School of Engineering and Science, Victoria University Melbourne, Australia. Prior to that, Dr. Kaosar finished his MS in Computer Engineering and BSc in Computer Science and Engineering in the year of 2006 and 2001 from KSA and Bangladesh respectively. He also has experience of working in many academic, research and commercial projects. He has published good number of research papers in high quality journals and conferences including, IEEE Transactions on Knowledge and Data Engineering (TKDE), Data & Knowledge Engineering (DKE), Computer Communications, IEEE International Conference on Data Engineering (ICDE- 2012) etc. He is an active member of various professional associations including IEEE, EAI.