Implementing RSA encryption from scratch in C++ and attacking weak keys using Fermat's factorisation method. Documenting the exact key-size boundary where attacks fail.
RSA encryption protects every HTTPS connection on the internet. Its security rests on one fact: factoring the product of two large primes is computationally hard. This project implements RSA from scratch in C++ and attempts to break weak keys using Fermat's factorisation method.
- Implementing RSA key generation, encryption, decryption in C++
- Attacking weak keys where primes p and q are chosen close together
- Finding the exact key-size boundary where Fermat factorisation fails
- Documenting the mathematics of why production RSA is unbreakable
Real-world RSA implementations have been broken this way. This is not a textbook exercise. It replicates documented vulnerabilities in real deployed cryptographic systems.
/src — RSA implementation and attack code in C++ /logs — weekly progress logs /writeup — working draft of the research write-up
- Modular arithmetic
- Euler's totient function
- Fermat's little theorem
- GCD and the Euclidean algorithm
- Prime factorisation and its computational limits
Project begins May/21/2026. All progress committed daily.
EMAIL: devangsharma7772@gmail.com INSTAGRAM: @sharma___devang