GithubHelp home page GithubHelp logo

miha-stopar / matasano-challenges Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 0.0 131 KB

Solutions for Matasano challenges (and some extensions like implementation of the improvements of the original Bleichenbacher)

Ruby 37.93% Python 62.07%

matasano-challenges's Introduction

Matasano challenges

The first 46 challenges are in Ruby as I wanted to learn the language. For the Bleichenbacher attack (challenges 47 and 48) I switched to Python.

The code is not optimized in any way and is far from being cleaned. I left all sort of unused code in there which I used for debugging.

Besides regular solutions to the challenges, I found the Bleichenbacher attack (challenges 47 and 48) so impressive that I implemented some more recent improvements as well (see below). Wang attack [1] (challenge 55) to find MD4 collisions is also impressive, but the implementation is somehow tiresome.

Bleichenbacher attack (challenge 48)

In addition to the original Bleichenbacher's attack [2], this implementation contains parallel threads method [3] and trimming and skipping holes technique from [4]. While skipping holes is pretty obvious and it is somehow surprising it was not used from the beginning, trimming is really a fascinating improvement over the original attack.

Note that the results (the number of required oracle calls to decrypt the ciphertext) of this implementation are slightly worse than those reported in [4]. I asked the authors of the paper for the code and tried to reproduce all their features, but the difference was still there (with there code also). There are two possible explanations - the number of repetitions they used was too small to get a realistic average or I didn't find the optimal configuration (there are many possible configurations for trimmer). I assume the latter even if I tried pretty hard to find it.

I attempted to make some improvements myself, but was unsuccessful except for TTT oracle (see [4]) which is the strongest oracle that probably never appears in a real world (when a message is not conformant, you can compute where outside the conformant interval the message lies), but even here the results were not too significant because the most oracle calls are needed to find s1 where this technique cannot be used.

[1] X. Y. Wang, X. J. Lai, D. G. Feng, H. Chen, X. Y. Yu. Cryptanalysis for Hash Functions MD4 and RIPEMD. Advances in Cryptology–Eurocrypt’05, pp.1-18, Springer-Verlag, May 2005.

[2] D. Bleichenbacher. Chosen ciphertext attacks against protocols based on the RSA encryption standard. In Advances in Cryptology: Proceedings of CRYPTO ’98, volume 1462 of LNCS, pages 1–12, 1998.

[3] T. Rosa V. Klima, O. Pokorny. Attacking RSA-based sessions in SSL/TLS. In 5th International Workshop on Cryptographic Hardware and Embedded Systems (CHES 2003), pages 426 – 440. Springer-Verlag, 2003.

[4] R. Bardou, R. Focardi, Y. Kawamoto, L. Simionato, G. Steel, and J.-K. Tsay. Efficient padding oracle attacks on cryptographic hardware. In CRYPTO, pages 608–625, 2012

matasano-challenges's People

Contributors

miha-stopar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.