This project implements practical cryptographic attacks against RSA to demonstrate how insecure key configurations can compromise public-key encryption. The implementations recover plaintexts or private keys by exploiting mathematical weaknesses in RSA rather than attempting to factor the modulus.
The project was completed as part of a graduate level Foundations of Cryptography course and focuses on applying number theory and cryptanalysis to real world attack scenarios.
Implemented an attack that recovers the original plaintext when the same message is encrypted using the same RSA modulus with different public exponents. The implementation uses Bézout's Identity, the Extended Euclidean Algorithm, and modular inverses to reconstruct the plaintext.
Implemented Wiener's Attack to recover RSA private keys that use insecurely small private exponents. The implementation applies continued fractions and convergents to identify vulnerable keys without factoring the modulus.
- Python
- Cryptography
- RSA
- Public-Key Cryptography
- Cryptanalysis
- Number Theory
- Algorithm Design
- Security Research
- Python 3
- Modular Arithmetic
- Continued Fractions
- Extended Euclidean Algorithm
rsa-cryptographic-attacks/
│
├── attacks.py
├── README.md
└── LICENSE
Through this project I gained hands-on experience implementing cryptographic attacks and understanding how implementation mistakes can weaken otherwise secure encryption systems. It reinforced the importance of secure key generation, parameter selection, and mathematical reasoning in modern public-key cryptography.
This repository is intended for educational purposes to demonstrate known cryptographic attacks against improperly configured RSA implementations. The techniques presented should only be used in authorized research, testing, and academic environments.