liveBook · Manning

Bleichenbacher's e=3 forgery attack

As explained in Hacking Cryptography

Bleichenbacher's e=3 forgery attack is an RSA signature-forgery attack that exploits lax validation of PKCS #1 v1.5 signature padding when the public exponent is 3.

Bleichenbacher’s e=3 forgery attack creates RSA signatures without the private key when verification combines public exponent 3 with incomplete PKCS#1 v1.5 padding validation. Because verification computes a cube, the attacker searches for a signature whose cube has the required encoded prefix and digest suffix, while invalid bytes remain hidden between them. section 9.6 section 9.6.3

The attack proceeds by exploiting the structure of the encoded message:

  • Choose a target message whose digest satisfies the attack’s required suffix condition. section 9.3
  • Construct a prefix cube root whose cube begins with the required PKCS#1 v1.5 header and message information. section 9.6.3
  • Construct a suffix cube root whose cube ends with the required hash information, using bitwise adjustment. section 9.6.3

Prefix cube-root test

A Go test generates a random target, computes a prefix cube root, cubes it, and verifies that the leading bytes match. One run matches 0x6E46048A even though the remaining cubed bytes differ.

Suffix cube-root test

A second Go test adjusts bits of a candidate until its cube ends with a chosen random suffix. The displayed cube preserves the requested final bytes while allowing unrelated leading bytes.

How Hacking Cryptography covers it

How deep it goes
Implements prefix and suffix cube roots, combines their outputs, and stops at the padding-validation failure.
Examples
Uses Go tests that verify matching cubed prefixes and suffixes, plus bisection and bitwise-flipping procedures.
What it assumes
Assumes familiarity with RSA signatures and PKCS#1 v1.5 while making the exponent-three cube-root construction concrete.
What you can do after
Builds an exploit that produces valid-looking signatures for selected messages without recovering the private key.
How it connects
Connects RSA signatures with public exponents, PKCS#1 v1.5 padding, hash digests, cube roots, and signature forgery.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Hacking Cryptography. The section links point to the parts of the book it draws on.