Skip to content

Implementation of the RSA algorithm and a few methods to break it

License

Notifications You must be signed in to change notification settings

ADMARIl/Simple-RSA

Repository files navigation

Simple RSA

An implementation of the RSA encryption algorithm to generate a private key and a public key, along with various methods to attempt to factor the modulus of the private key.

This project was for my Design and Analysis of Algorithms class at UMBC (CMSC 441). The project outline can be found here: course website, web archive

Installation

  1. Presuming you already have python3 the only non-standard package used is gmpy2.
    • If you're on windows you'll need to install anaconda to get gmpy2
      conda install gmpy2  
    • If you're on linux/mac you can just use pip
      pip3 install gmpy2

Building and Running

  • To generate a public/private key pair you can run part1a

    python3 part1a.py
  • To factor a modulus, run part2 with the modulus as an argument

    python3 part2.py [modulus]

    E.g.

    python3 part2.py 21421376143373

    Will return:

    #####   Part 2   #####
    Attempting to find factors of 21421376143373
    Modulo size: 45
    Start Time: 20:49:42.451780
    1 p1 factor found: 5071501
    End Time: 20:49:42.620936

License

MIT

About

Implementation of the RSA algorithm and a few methods to break it

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages