Skip to content

Demonstration of the Hastad's RSA Broadcast message recovery method using Python 3

License

Notifications You must be signed in to change notification settings

maximmasiutin/rsa-hastad-broadcast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RSA Hastad Broadcast

Copyright (c) 2022 Maxim Masiutin
Copyright (c) 2018 Ashutosh Ahelleya

In 1988, Johan Hastad proposed a method to decrypt an RSA message without a private key, if that same message was encrypted unmodified to several recipients, and their keys have the same public exponent, such as 3 or 5.

The number of recipients should not be less than the value of the public exponent, i.e., with the exponent of 5, you need the same message to be encrypted to 5 different public keys.

This method was published as https://doi.org/10.1137/0217019 and it became known as Hastad's broadcast attack.

This Python 3 script can be used as a CTF (capture the flag) tool to solve chellenges based on the Hastad's broadcast attack.

Version istory

2.0 (June 20, 2022)

  • Ported to Python 3

1.0 (October 23, 2018)

Usage

To use this software, modify the immediate values in hastad-immval.py and run this file which also serves as an example on how to use this attack with the public exponent of 5 (5 encrypted messages): n1, n2, n3, n4 and n5 values are modulus; and the c1, c2, c3, c4 and c5 values are the ciphertexts.

About

Demonstration of the Hastad's RSA Broadcast message recovery method using Python 3

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published