Signing For A Gabled Message — The Blinding attack
Signing For A Gabled Message — The Blinding attack
So can Eve get Bob to sign for something that actually gives away his private? This is known as the blinding attack, and where we get Bob to sign for a message that is garbled.
Eve starts by creating a message (M — “Pay Eve $1 million”) and then creates another message:
M′=rᵉ M (mod N)
where e is Bob’s encryption key exponent and r is a random number. Eve then gets Bob to sign for this. The signature is then:
S′=(M′)ᵈ (mod N)
Bob gives S’ to Eve, and she just divides by r to get the signature for the original message:
So Eve takes Bob signature and adds it to the original message that Bob wouldn’t sign, and she can prove that Bob signed it. If she is sending to Alice the Banker, she would take the message:
"Pay Eve $1 million"
and add Bob signature for the message (S′/r), and then encrypt everything with Alice the Banker’s public key. Alice will get the encrypted message and decrypts with her private key, and reads the message:
"Pay Eve $1 million"
and she then looks at the signature, and gets Bob’s public key and checks the signature. It will match, so she will pays Eve one million dollars from Bob’s account. So here are the basic steps:
A sample of this method is here.
Coding
In this case we take the salted MD5 hash of the message and then take mod N of it. An outline of the code is [demo]:
Conclusions
In this case we tricked Bob into signing for a message in which Eve put a backdoor into the garbled message.
Key calculation
Let’s select:
P=47 Q=71
The calculation of n and PHI is:
n=P × Q = 13 × 11 = 3337
PHI = (p-1)(q-1) = 3220
We can select e as:
e = 79
Next we can calculate d from:
(79 × d) mod 3220 = 1 [Link]
d = 1019
Encryption key [3337,79]
Decryption key [3337,1019]
Then, with a message of 688, we get:
Cipher=(688)⁷⁹ (mod 3337)=1570
Decoded=(1570)¹⁰¹⁹ (mod 3337)=688