Git Product home page Git Product logo

bleichenbachersignatureforger's Introduction

BleichenbacherSignatureForger

Forge PKCS1v1.5 signature for questionable implementation of verification algorithms...

Intro

This repository contains a Python 2 implementation of the Bleichenbacher signature forgery attack. Having seen this variant of the attack multiple times during the last year both in CTFs and in real implementations showed the need for a more general solution than the hacky frankenstein scripts I have laying around.

Attack

PKCS1v15 is defined in https://www.ietf.org/rfc/rfc3447.txt. If the verification algorithm is trying to parse the result of the public key operation instead of building the expected data and comparing it to the result of the public key operation there is a possibility that it might be vulnerable to this attack.

Two variants of the attack is supported:

  1. The length is not checked and a the padding is on the form 0001FFFFFFFFFFFFFFFF00 | DigestInfo | garbage
  2. The filler (PS) is not checked - 0001FFFFFFFFFFFFFFFF | garbage | 00 | DigestInfo

More info on variant 1. can be found at: https://www.ietf.org/mail-archive/web/openpgp/current/msg00999.html

Credit for variant 2. goes to Fillipo Valsorda (https://blog.filippo.io/bleichenbacher-06-signature-forgery-in-python-rsa/)

Usage

usage: Forge.py [-h] [-k KEYSIZE] [-ha {SHA-384,SHA-256,SHA-512,SHA-1,MD5}]
                [-m MESSAGE]

Signature forger for RSA PKCS1v1.5 given that the exponent 3 is used and the
verification algorithm is not implemented properly

optional arguments:
  -h, --help            show this help message and exit
  -k KEYSIZE, --keysize KEYSIZE
  -ha {SHA-384,SHA-256,SHA-512,SHA-1,MD5}, --hashalg {SHA-384,SHA-256,SHA-512,SHA-1,MD5}
  -m MESSAGE, --message MESSAGE

Will update SoonTM

plz use PSS

bleichenbachersignatureforger's People

Contributors

hoeg avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.