Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A simple Python 3 script to perform Common Modulus attacks on RSA

License

NotificationsYou must be signed in to change notification settings

HexPandaa/RSA-Common-Modulus-Attack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

RSA-Common-Modulus-Attack is a Python 3 script to perform common modulus attacks on RSA. Given two ciphertext, encrypted with the same modulusN, but a different exponente, it is possible to recover the plaintext of the message.In order for this attack to work, the greatest common denominator of the two exponent should be 1 :gcd(e1, e2) = 1.

You can read more about this attack athttps://medium.com/bugbountywriteup/rsa-attacks-common-modulus-7bdb34f331a5

I relied onAshutosh Ahelleya's script for the math part :https://github.com/ashutosh1206/Crypton/blob/master/RSA-encryption/Attack-Common-Modulus/exploit.py

Installation

In order to run this script, you'll need to install some Python 3 modules.

git clone https://github.com/HexPandaa/RSA-Common-Modulus-Attack.gitcd RSA-Common-Modulus-Attackpip3 install -r requirements.txt

Usage

To run the script, simply type the following command.

python3 rsa-cm.py -c1<ciphertext1> -c2<ciphertext2> -k1<publickey1> -k2<publickey2>

The output should be like so :

# ./rsa-cm.py -c1 message1.b64 -c2 message2.b64 -k1 key1.pub.pem -k2 key2.pub.pem[+] Recovered message:6277601[...][+] Recovered bytes:b'Yeah man[...]'

And finally the help message.

# rsa-cm.py -husage: rsa-cm.py [-h] -c1 ciphertext1 -c2 ciphertext2 -k1 pubkey1 -k2 pubkey2                 [-o outfile]A simple script to perform RSA common modulus attacks.optional arguments:  -h, --help       show thishelp message andexit  -c1 ciphertext1  The first ciphered message  -c2 ciphertext2  The second ciphered message  -k1 pubkey1      The first public key  -k2 pubkey2      The second public key  -o outfile       Output fileMore info at https://github.com/HexPandaa/RSA-Common-Modulus-Attack/

Happy hacking!

About

A simple Python 3 script to perform Common Modulus attacks on RSA

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp