I experimented with some known RSA attacks. The code is for learning purposes and should not be used for real applications.
- RSA
- Common Modulus Attack
- Hastad Broadcast Attack
- Franklin-Reiter Related Message Attack
- Experiments for Hastad and Franklin-Reiter attacks
-
You can install it by using
pip install -r requirements.txt -
You also need to install Sage for Sage shell, otherwise you cannot run the Hastad Broadcast Attack or the Franklin-Reiter Related Message Attack which utilizes some Sage functionality. The Python code will not work and give errors if you use the normal Python interpreter.
-
Use Python 3
- For simple form: open up a Sage shell,
cd testsand usepython3 -m unittest test_Hastad_Simple.py - For generalized form: open up a Sage shell
cd testsand usepython3 -m unittest test_Hastad.py
Open up a Sage shell cd tests and use python3 -m unittest test_Franklin_Reiter.py
You can simply use an IDE that supports Python (I used intellij with Python plugin), and run the unit tests in the
tests folder