Skip to content

Commit

Permalink
Package on pypi (#28)
Browse files Browse the repository at this point in the history
* Remove requirements.txt

* Add setup.py

* Remove structlog as dep

* Rename PadDown to Paddown
  • Loading branch information
theilgaard authored Mar 1, 2020
1 parent d60a5b7 commit e34a540
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 14 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# PadDown
PadDown is an AES CBC PKCS7 [Padding Oracle Attack](https://en.wikipedia.org/wiki/Padding_oracle_attack) engine. It simplifies performing [Padding Oracle Attack](https://en.wikipedia.org/wiki/Padding_oracle_attack) on a vulnerable encryption service. This is useful for both CTF and real-world attacks, where you are in possession of a ciphertext, and have a so called Padding Oracle available.
# Paddown
Paddown is an AES CBC PKCS7 [Padding Oracle Attack](https://en.wikipedia.org/wiki/Padding_oracle_attack) engine. It simplifies performing [Padding Oracle Attack](https://en.wikipedia.org/wiki/Padding_oracle_attack) on a vulnerable encryption service. This is useful for both CTF and real-world attacks, where you are in possession of a ciphertext, and have a so called Padding Oracle available.

## Usage
* Using PadDown is as easy as subclassing the `Paddown` class overwriting the ``hasValidPadding(...)`` method retuning a `bool`. As argument it takes ciphertext to test against the Padding Oracle. Have your implementation return ``True`` if you receive no padding error and ``False`` otherwise.
* Using Paddown is as easy as subclassing the `Paddown` class overwriting the ``hasValidPadding(...)`` method retuning a `bool`. As argument it takes ciphertext to test against the Padding Oracle. Have your implementation return ``True`` if you receive no padding error and ``False`` otherwise.

* Now you are ready to call `.decrypt()` on your class and start decrypting your ciphertext.

Examples can be found in the `PadDown/examples` directory.
Examples can be found in the `./examples` directory.

## Development

Expand Down
5 changes: 2 additions & 3 deletions paddown.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import logging
from abc import ABC, abstractmethod

import structlog

logger = structlog.get_logger(__name__)
logger = logging.getLogger(__name__)


class PaddownException(Exception):
Expand Down
5 changes: 0 additions & 5 deletions requirements.txt

This file was deleted.

3 changes: 1 addition & 2 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
pycryptodome==3.9.0
structlog==20.1.0
.
27 changes: 27 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import setuptools

with open("README.md", "r") as fh:
long_description = fh.read()

setuptools.setup(
name="Paddown",
version="0.1.0",
author="EPAD",
author_email="[email protected]",
description="CBC PKCS7 Padding Oracle Attack engine",
long_description=long_description,
long_description_content_type="text/markdown",
py_modules=["paddown"],
install_requires=["pycryptodome==3.9.0"],
entry_points="""
[console_scripts]
paddown=paddown:paddown
""",
url="https://github.com/epadctf/Paddown",
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires=">=3.7",
)

0 comments on commit e34a540

Please sign in to comment.