RSA Blinding Attack (Signature Malleability)
- •
What it is
- •
Textbook RSA signing is multiplicatively homomorphic: . This lets an attacker get a forbidden message signed indirectly: multiply it by a random "blinding factor" before submitting for signing (disguising its raw bytes so a content filter doesn't recognize it), receive back a signature over the disguised value, then multiply that signature by to strip the blinding factor out and recover a valid signature over the original, forbidden message — one the server would have refused to sign directly.
- •
- •
When to apply
- •
A signing service checks the raw content of a message before signing it (e.g. rejecting anything containing a specific forbidden substring) but doesn't defend against the message being multiplicatively disguised first — textbook (unpadded) RSA signing is the giveaway, since real padding schemes (PSS) break this homomorphism.
- •
- •
Math
- •
; server returns (since ); unblind via .
- •
- •
Worked example
- •
Blinding a "forbidden" integer with a small random factor before requesting a signature, then unblinding the returned signature with , produced a signature that verified correctly against the original forbidden message.
- •
- •
Python
- •
r = 2 m_prime = (m_forbidden * pow(r, e, N)) % N S_prime = sign(m_prime) # server signs the disguised value S = (S_prime * pow(r, -1, N)) % N # unblind assert pow(S, e, N) == m_forbidden
- •
- •
Related
- •
Cards
- •
What algebraic property of textbook RSA signing does the blinding attack exploit?
- •
Multiplicative homomorphism: Sign(m1)·Sign(m2) ≡ Sign(m1·m2) (mod N).
- •
- •
Why does content-based filtering on the raw message fail to stop this attack?
- •
The blinded message m·r^e has completely different raw bytes from the forbidden message, so a filter checking for a specific substring/value doesn't recognize it — yet the blinding factor cancels out cleanly afterward.
- •
- •