0

Why RSA signatures based on the hash of the message rather than the message itself?

closed as unclear what you're asking by Adi, Xander, AviD Jun 17 '14 at 20:18

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • You mean the digital signature? – schroeder Jun 17 '14 at 18:36
  • yeah RSA signatures – Zonik Jun 17 '14 at 18:38
  • 1
    Please tell us what you have researched so far. Looks like an exam question. – Deer Hunter Jun 17 '14 at 18:46
1

The hash acts as a measure to determine if the message has been changed since it was signed. That way the recipient knows that the message is the same as when it was signed (integrity).

  1. Message is composed

  2. Message is hashed

  3. Hash is encrypted with sender's private key

  4. The resulting signature accompanies the message

The recipient can use the sender's public key to check the hash, thereby confirming the integrity of the message and that the sender was the one who signed it (non-repudiation). A digital signature means that the message is as intended and sent by a confirmed source.

Applying the private key to the hash is more computationally efficient (smaller thing to encrypt), and encrypting the message may not be necessary if confidentiality is not required/desired.

2

Technically, the signature works over the message; it so happens that the first step of the signature generation algorithm is to hash the message with a hash function, and the hash value is used afterwards.

Using a hash function is necessary because the RSA algorithm relies on integers modulo a given integer (which is part of the public key), so it cannot work with values which do not fit in that limited range. The hash function is also needed to ensure non-malleability (a rather technical internal characteristic). Using a hash function is sufficient because of the properties of cryptographic hash functions; namely, the resistance of hash functions to collisions and preimages really means that signing a hash is "as good" as signing the original message.

Not the answer you're looking for? Browse other questions tagged or ask your own question.