# oWiener
[![Test](https://github.com/orisano/owiener/actions/workflows/test.yml/badge.svg)](https://github.com/orisano/owiener/actions/workflows/test.yml)
[![PyPI version](https://badge.fury.io/py/owiener.svg)](https://badge.fury.io/py/owiener)
[![Python Versions](https://img.shields.io/pypi/pyversions/owiener.svg)](https://pypi.org/project/owiener/)

A Python3 implementation of the Wiener attack on RSA.

## Installation
```bash
python3 -m pip install owiener
```
or
```bash
curl -O https://raw.githubusercontent.com/orisano/owiener/master/owiener.py
```

## Example
```python
import owiener

e =  
n =  
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
