liveBook · Manning

Existential forgery attack

As explained in Hacking Cryptography

An existential forgery attack produces at least one valid message-signature pair without the attacker needing to choose the message in advance or possess the signing secret.

An existential forgery attack creates at least one message–signature pair that verifies without possessing the private signing key. The attacker does not choose the message beforehand; any valid pair is sufficient. section 9.3

Schoolbook RSA makes the failure concrete. A signer computes s = m^d mod n, and verification checks s^e mod n = m. An attacker can instead choose a random signature s, calculate m = s^e mod n, and submit the resulting pair. Verification reproduces the same m, so the pair appears authentic. section 9.4

The attack and its defenses follow a short sequence:

  • Choose a candidate signature value without first selecting a message. section 9.4
  • Compute the corresponding message with the public operation m = s^e mod n. section 9.4
  • Submit the calculated message and signature as a valid-looking pair. section 9.3
  • Enforce padding and formatting rules so randomly inverted messages almost never have an acceptable encoding. section 9.4
Equation 9.3
\[\begin{aligned} \begin{aligned} s\prime &= \text{Verify}(m, s, \text{PubKey}_{\text{Alice}}) \\ s\prime &= s^e \bmod n \\ s\prime &= (m^d)^e \bmod n \\ s\prime &= m \bmod n \end{aligned} \label{equation:alice-rsa-verify} \end{aligned}\]

Follow the RSA verification equation to see why applying the public exponent to the attacker’s chosen signature reconstructs the calculated message. section 9.4

How Hacking Cryptography covers it

How deep it goes
Derives the attack through schoolbook RSA equations and stops at padding and formatting defenses.
Examples
Uses a randomly chosen RSA signature and its public-exponent image as the forged pair.
What it assumes
Assumes public-key RSA notation while deriving signing and verification operations explicitly.
What you can do after
Diagnose schoolbook RSA implementations and apply padding or formatting validation to block random-message inversion.
How it connects
Connects digital signatures with RSA, padding, universal forgery, and selective 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.