Skip to content

Latest commit

 

History

History
40 lines (33 loc) · 1.29 KB

README.md

File metadata and controls

40 lines (33 loc) · 1.29 KB

cs42_coRSAir

coRSAir.c recieve as argument a public key and obtain its modulus and exponent and saved them in coRSAir_clavepublica.txt. It also performs the Wiener attack and obtains its private key.

Getting started

The OpenSSL library has to be installed:

sudo apt-get install libssl-dev

Usage

  1. Create a public and a private key vulnerable to a Wiener Attack with generador_clave_wiener.py
python3 generador_clave_wiener.py
  1. Compile coRSAir.c with the follwing instruction:
gcc -o coRSAir coRSAir.c -lssl -lcrypto -lm
  1. Run coRSAir by giving the private key created in step 1 as input:
./coRSAir my_pubkey.key

A new file with the public key modulus (N) and exponent (e) will be created. It will also print the private key (d) in terminal if the Wiener Attack is succesfully

Other program

  • generador_clave_wiener.py creates a private key that is vulnurable to Wiener attack. The key generated is small so, the program runs faster and numbers can be treated with long long int data types. The private key generated

Instructions

Before running, the following libraries have to be installed:

  • gmpy2:
pip install gmpy2
  • Pycrypto:
pip install pycrypto