Using random search and brute force algorithm in factoring the RSA modulus


  • Mohammad Andri Budiman Universitas Sumatera Utara
  • Dian Rachmawati Universitas Sumatera Utara



RSA modulus, factorization, random search, brute force, primality test.


Abstract. The security of the RSA cryptosystem is directly proportional to the size of its modulus, n. The modulus n is a multiplication of two very large prime numbers, notated as p and q. Since modulus n is public, a cryptanalyst can use factorization algorithms such as Euler’s and Pollard’s algorithms to derive the private keys, p and q. Brute force is an algorithm that searches a solution to a problem by generating all the possible candidate solutions and testing those candidates one by one in order to get the most relevant solution. Random search is a numerical optimization algorithm that starts its search by generating one candidate solution randomly and iteratively compares it with other random candidate solution in order to get the most suitable solution. This work aims to compare the performance of brute force algorithm and random search in factoring the RSA modulus into its two prime factors by experimental means in Python programming language. The primality test is done by Fermat algorithm and the sieve of Eratosthenes.


Download data is not yet available.



How to Cite

Budiman, M. A., & Rachmawati, D. (2018). Using random search and brute force algorithm in factoring the RSA modulus. Data Science: Journal of Computing and Applied Informatics, 2(1), 45-52.