This repo contains two python projects to demonstrate Daniel Bleichenbacher's million message attack against RSA encryption and PKCS #1 padding.
The bleichenbacher oracle is implemented in Bleichenbacher_Oracle
.
The effects of leaking the LSB (the Parity-Bit) of an RSA plaintext is demonstrated via Parity_Oracle
.
The code is mostly taken from Practical-Padding-Oracle-Attacks-on-RSA. Since we find it very helpful to understand the Bleichenbacher oracle, it is included here as well.
- The
python-crypto
package is needed. Please install it. - Text in Python 3 is always Unicode and represented by the
str
type. Binary data is represented by thebytes
type. Please see http://eli.thegreenplace.net/2012/01/30/the-bytesstr-dichotomy-in-python-3 for further information. - We had some trouble with type errors during development. Thus, many functions are type-checked via a custom decorator and special annotations. (We found this pattern to be very useful in many scenarios.)
- "Chosen Ciphertext Attacks Against Protocols Based on the RSA Encryption Standard PKCS #1" by Daniel Bleichenbacher.
- Practical-Padding-Oracle-Attacks-on-RSA