Skip to content

Read and perform a Wienner Attack on a public key

Notifications You must be signed in to change notification settings

msoto5/cs42_coRSAir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

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

About

Read and perform a Wienner Attack on a public key

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published