I'm a bit of mixed up on this subject. Does asymmetric encryption like in RSA, ensure message integrity without hashing the message with an HMAC, nothing else is required, or is hashing necessary only when utilizing symmetric encryption?

up vote 1 down vote accepted

No, RSA by itself definitely does not ensure integrity. (i.e. it's malleable.)

If the ciphertext c = me (mod n) is modified to c1 = c * t (multiplication), where t = xe, then the decryption of c1 will be

c1d = (c t)d = (me xe)d = ((mx)e)d = mx (mod n)

so the original message got multiplied with a number controlled by the attacker.

A robust system will use something like OAEP padding with RSA to protect against that. Also see here.

  • so let's say I want to send an encrypted email thus I sign it with the receiver's public key. The receiver uses its private key to decrypt it. If someone tampers the message in between then wouldn't the decryption process fail since the message is malformed? – microwth Sep 10 '16 at 17:52
  • @microwth : ​ Signing "it with the receiver's public key" would be quite a trick. ​ ​ ​ ​ – user49075 Sep 10 '16 at 21:01
  • oops, I must edit the question! – microwth Sep 13 '16 at 9:01

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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