RSA tool for ctf – retreive private key from weak public key and/or uncipher data.

RSA tool for ctf – uncipher data from weak public key and try to recover private key Automatic selection of best attack for the given public key

Attacks :
– Weak public key factorization
– Wiener’s attack
– Hastad’s attack (Small exponent attack)
– Small q (q<100,000)
– Common factor between ciphertext and modulus attack
– Fermat’s factorisation for close p and q
– Gimmicky Primes method
– Past CTF Primes method
– Self-Initializing Quadratic Sieve (SIQS) using Yafu – NEW
– Common factor attacks across multiple keys – NEW

Rsa Ctf Tool

Requirements:
* GMPY
* libnum (https://github.com/hellman/libnum.git)

Todo
+ Implement multiple ciphertext handling for more attacks
+ Implement ECM factoring
+ Implement support for MultiPrime RSA (see 0ctf 2016)
+ Possibly implement Msieve support…
+ Some kind of polynomial search…

Usage:

git clone https://github.com/hellman/libnum.git && cd libnum
python setup.py install

git clone https://github.com/Ganapati/RsaCtfTool && cd RsaCtfTool
python RsaCtfTool.py --publickey ./key.pub --private

Example:
./RsaCtfTool.py --createpub --n 782837482376192871287389789773981723...12839802 --e 768557

Source: https://github.com/Ganapati

Source: Security List Network™ @ May 2, 2017 at 09:42PM

0
Share