Code Monkey home page Code Monkey logo

rsa-algorithm's Introduction

RSA-Algorithm

Note: the proj status Is incomplete, it works for all the attacks noted. Feel free to contribute.

Usage

usage: main.py [-h] [-modulus ] [-n1] [-n2] [-e ] [-cipher ] [-c1] [-c2 ] [--attack]

options:
  -h, --help   show this help message and exit
  -modulus []  Enter the modulus (p * q), (default = 1)
  -n1          Enter the n1, for attack : commonfactor
  -n2          Enter the n2, for attack : commonfactor
  -e []        Enter the public exponent (default = 65537)
  -cipher []   Enter the ciphertext (default = 0)
  -c1          Enter the c1, for attack : commonfactor
  -c2 []       Enter the c2, for attack : commonfactor
  --attack     Enter the attack name {'weakprimes', 'e3', 'e1', 'commonfactor', 'commonmodulus', 'wiener'}
                                                                                           

Project Tree

.
├── attack-demo.txt
├── attacks
│   ├── commonFactor.py
│   ├── commonmodulus.py
│   ├── e1e3.py
│   ├── __init__.py
│   ├── weakprimes.py
│   └── wiener.py
├── banner.py
├── demonstration.md
├── main.py
├── README.md
├── requirements.txt
└── RSAScan.py

Installation

Dependencies and Requirements

install.py will be uploaded soon

  • Sage math

    • Debian Systems : sudo apt install sagemath
    • Arch System : sudo pacman -S sagemath
  • Python Libraries

    • sympy
    • Pycryptodome
    • gmpy2
    • sage
    • os
    • sys

Usage example

[RSA@arch RSA-Algorithm]$ python3 main.py -n1 14210100835811893798591078574673509799599435785629793053564426327501908443183140520609964712650358642983958098057476878561030530736365215542967098664119375313082664944585486342081477101282777511562123969111180556724024895406974743062387838042255090695147973536720609137941107044960129028680194236971517888073002151100105846731521577011388381786481148592693877947633594752266751375339343845793557960247402876231491392310849835544042849854976618763858282692179517051698041046443665430087664775796279151997682716153471202272855992352652294689251775067915427628426475352635713405663233084590482443696929909113022275932963 
-n2 9909416432857077839842635526397016570706233946465755602951432796949043674880406344119650144972805415270789891434962888017099110866828044976063665090118377534234873371879049768690146720022551696102687134324629943276999478646284416067186629436851833656583809441164967966550090424942940548947231116810115548706732879023945410706654471380653149453240459855653515761752212366682744164796337152295199350766681091460733764953863450049565749196047542053106675478773561074112623631487376796831953278385382743014813370224165409285606161953552927575831815431930860698082290914569442342899424158943471050819735954770403576952597 
-c1 11285068260062957431988077411736024737206589628789265002651924086474736320840849806849636018251251828077239003620308962675643100015540623853365642746583641951453604279131710660086093301811269653391260552592819184650086888954000144374933327696033327786284567656140368742793009894248924494218462754463148693302847012797824700163591585045003846574959107642615757249440973617079019352414537053550355304175853187762339891042353537700564042584001146787565804386975441940440343063218321437735266377940408404084148571212095663044215726786503139610972710995694977370136413410338805394618181460386598021764830520920207038119737 
-c2 230503441339098213197943518548655312076875819226223970855219569665753573103664712609350437983808420986583641073068105854125060471913930836416667369009514170582831848651921939378451110006113562704005699620419197602549448752802650444589462646332170281268255813665905615387269348720692230068701721670742423050385974680358920701195299973845205128906960697891429932020649292849065497077440117767693616929767088848790368510300776199101092705714635613968674042749221267282018181705865629738843289759917919084751195485925805417428843563894632311906290912939257073244799385899512676381701455731445225057370347845858046332075 
-e --attack commonfactor

		██████╗ ███████╗ █████╗     ███████╗ ██████╗ █████╗ ███╗   ██╗
		██╔══██╗██╔════╝██╔══██╗    ██╔════╝██╔════╝██╔══██╗████╗  ██║
		██████╔╝███████╗███████║    ███████╗██║     ███████║██╔██╗ ██║
		██╔══██╗╚════██║██╔══██║    ╚════██║██║     ██╔══██║██║╚██╗██║
		██║  ██║███████║██║  ██║    ███████║╚██████╗██║  ██║██║ ╚████║
		╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝    ╚══════╝ ╚═════╝╚═╝  ╚═╝╚═╝  ╚═══╝

		An Open-Source Tool developed under the guidance of Prof V.B. Kamble                                                       
		
Trying for common factor attack......!!
Results :  GisecCTF{what_is_the_problem_in_using_a_common_prime?Easy_factorization!}

rsa-algorithm's People

Contributors

heapbytes avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.