A Python3 implementation of the Wiener attack on RSA
Project description
oWiener
A Python3 implementation of the Wiener attack on RSA.
Installation
python3 -m pip install owiener
or
curl -O https://raw.githubusercontent.com/orisano/owiener/master/owiener.py
Example
import owiener
e = 30749686305802061816334591167284030734478031427751495527922388099381921172620569310945418007467306454160014597828390709770861577479329793948103408489494025272834473555854835044153374978554414416305012267643957838998648651100705446875979573675767605387333733876537528353237076626094553367977134079292593746416875606876735717905892280664538346000950343671655257046364067221469807138232820446015769882472160551840052921930357988334306659120253114790638496480092361951536576427295789429197483597859657977832368912534761100269065509351345050758943674651053419982561094432258103614830448382949765459939698951824447818497599
n = 109966163992903243770643456296093759130737510333736483352345488643432614201030629970207047930115652268531222079508230987041869779760776072105738457123387124961036111210544028669181361694095594938869077306417325203381820822917059651429857093388618818437282624857927551285811542685269229705594166370426152128895901914709902037365652575730201897361139518816164746228733410283595236405985958414491372301878718635708605256444921222945267625853091126691358833453283744166617463257821375566155675868452032401961727814314481343467702299949407935602389342183536222842556906657001984320973035314726867840698884052182976760066141
d = owiener.attack(e, n)
if d is None:
print("Failed")
else:
print("Hacked d={}".format(d))
# Hacked d=4221909016509078129201801236879446760697885220928506696150646938237440992746683409881141451831939190609743447676525325543963362353923989076199470515758399
References
Cryptanalysis of Short RSA Secret Exponents:
https://www.cits.ruhr-uni-bochum.de/imperia/md/content/may/krypto2ss08/shortsecretexponents.pdf
pablocelayes/rsa-wiener-attack:
https://github.com/pablocelayes/rsa-wiener-attack
wihoho/Wiener-s-Attack:
https://github.com/wihoho/Wiener-s-Attack
Author
Nao Yonashiro (@orisano)
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for owiener-1.0.8.macosx-10.9-universal2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89fb5f2949a15e357ea6176bff6400cd0ea1e7ebb1fd55d00b31d0bcf98b9885 |
|
MD5 | ae39360dd05d54f091eb0bd3a810d612 |
|
BLAKE2b-256 | d90c68f1362b75232fbf00dab38ae490c546a231365fa11470320386f70859d7 |
Close
Hashes for owiener-1.0.8-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50a847193ecf15b90fd40b4db5e253e70b10485df6c442310719089bddc469cd |
|
MD5 | 4047cd6f3ad03b991352480bab563f9a |
|
BLAKE2b-256 | c6cc975c4859a4dcd380a9c38fadd9ae884df181bceeccfa46d6d9d2de84f7d0 |