Skip to content

choyiny/factorizing-semiprimes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IB Math HL IA - Hacking RSA (kinda)

Build Status

Featured on The Mathematics IA: Earning Full Marks on HL or SL Mathematics Explorations: Ideal for the INTERNATIONAL BACCALAUREATE DIPLOMA as a method to increase personal engagement and a proof of authenticity.

I've created this java program as part of my International Baccalaureate Mathematics Higher Level Internal Assessment. This is a proof of concept for factorizing public keys and crack the RSA cryptographic algorithm.

Usage

Replace n with the semiprime you wish to factorize.

How does it work?

This script uses 2 methods to factorize semiprimes.

  • Brute Force Method
  • Fermat's Factorization Method
  • Pollard's Rho Method

Limitations

The code can only factorize the maximum of a JAVA_INT, 2^31 - 1.

Sample output

n = 397927
FF: 433 is a factor
FF: 919 is another factor
FF: Total execution time: 0ms
FF: steps involved: 22
BF: 433 is a factor
BF: 919 is another factor
BF: Total execution time: 0ms
BF: steps involved: 215
PF: 919 is a factor
PF: 433 is another factor
PF: steps involved: 51
PF: Total execution time: 2ms

About

Factorizing Semiprimes (Proof of concept to decrypt RSA keys)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages