# Attack on security model for RSA-FDH

I recently read in Cryptography textbooks and online videos that compared to Textbook RSA which is insecure against Chosen Plaintext Attacks (CPA) and Chosen Ciphertext Attacks (CCA), RSA-FDH is Existentially Unforgeable Under Chosen Message Attacks (EUF-CMA) if the hash fuction is uniformly random.

However, to my surprise, on online Cryptography forums and some Cryptographers say that the security model behind RSA-FDH, so EUF-CMA can be broken if one can find collisions in the hash function itself. The thing is, I have not been able to find such examples or even understand how this is even possible. I read in a lecture slide online that if we ask signatures $$σ_1$$, $$σ_2$$ for $$m_1,m_2 \in \mathbb{Z}_n^*$$ and output $$(m^*, σ^*) := (m_1 \cdot m_2 \mod{(N)},\ σ_1 \cdot σ_2 \mod{(N)})$$. But then I still don't know how it practically applies to RSA-FDH IF the hash function has collisions.

• Just a remark: CPA and CCA are no security notions for signatures but for encryption as the terms plaintext and ciphertext suggest. – mephisto Aug 16 at 1:09

This is a) no attack on the security model, but an attack in the security model of EUF-CMA, and b) a generic attack on any signature scheme that signs the hash of a message instead of the message itself (as done in RSA-FDH).

The idea is that if you can find a collision for the used hash function $$H$$, i.e., two messages $$m_1, m_2$$ such that $$H(m_1) = H(m_2)$$, then they have the same signature: $$\sigma = \textrm{sign}(sk,m_1) = \textrm{sign}(sk,m_2)$$. To see this consider RSA-FDH as example: The signature on $$m_1$$ is $$\textrm{sign}(sk,m_1) = (H(m_1))^d \mod N$$ for private exponent $$d$$ and modulo $$N$$. The signature on $$m_2$$ is $$\textrm{sign}(sk,m_2) = (H(m_2))^d \mod N = (H(m_1))^d \mod N = \textrm{sign}(sk,m_1),$$ where the mid equality follows from $$m_1,m_2$$ being a collision.

In the EUF-CMA setting you are allowed to ask for signatures on arbitrary messages and have to come up with a signature on a new message. So given collision $$m_1,m_2$$, you ask for a signature $$\sigma$$ on $$m_1$$ and then output the pair $$(m_2, \sigma)$$ as forgery.

• Thank you for your answer sir, I think I get it but would it be possible if you could please use some numbers or an example, say lets hash the word "CRYPTO". I assume your answer applies to the EUF-CMA scheme being broken in RSA-FDH? I just want to see the application of it on a word and the EUF-CMA scheme being broken – user71221 Aug 16 at 9:07
• @user71221 it's more useful to look at something like hashclash for MD5 or shattered for SHA1. Then just consider the effect of signing a hash value that matches against multiple different messages. When you have a collision then hash(A) = hash(B), so sign(hash(A)) = sign(hash(B)) – Natanael Aug 16 at 17:11
• Assume a hash function $H$ where $H(\textrm{CRYPTO}) = 101 = H(\textrm{CRAPTO})$. If I now ask for a RSA-FDH signature (where $H$ is used as hash) for the message CRYPTO this will be $\sigma = (H(\textrm{CRYPTO}))^d = (101)^d$. However, this is also a valid signature for the message CRAPTO: $(H(\textrm{CRAPTO}))^d = (101)^d = \sigma$. As I never asked for a signature on CRAPTO, (CRAPTO, $\sigma$) is a valid forgery in the EUF-CMA model. – mephisto Aug 17 at 16:21
• To emphasize (and add on Josiah's answer): The problem here is to actually find a collision for CRAPTO. For a good cryptographic hash function this will be computationally infeasible. The problem with doing an actual example with numbers here is that any example hash function that you would write down here will be entirely broken, super artificial (like take SHA2 but replace SHA2(CRYPTO) = 101 = SHA2(CRAPTO)), or you take a secure one and do not know a collision. – mephisto Aug 17 at 16:28
• @mephisto you could make an example with CRC16 (I think that's a thing) to show how a weak hash leads to a trivial break – Natanael Aug 17 at 21:51

To give an example with less maths, suppose that I come to you and ask you to sign the message "Josiah's favourite number is 747895723190543. Weird I know." You think that is a bit odd, but harmless so you do so.

Unbeknown to you, the hash of that message is also the hash of "Please pay Josiah the sum of 87476 United States dollars."

Because the hash matches, the signature matches. And because the signature matches, I can take the signature of the innocent message, stick it to the signature of the fraud message, and pass it to your bank. Of course since it is correctly cryptographically signed, the bank has no reason to doubt that you meant it, or at least sent it.

• I dont suppose you could show one with Math examples, i.e. m0 = 4, m1 = 5? It's great to understand it all from a high level but I just want to see how it works Mathematically – user71221 Aug 16 at 15:14
• If you want it with mathematical formality, see mephisto's answer. There is nothing special about examples of numbers here: it is just which hashes match. Finding hash collisions is out of scope. – Josiah Aug 16 at 16:25