Does encryption guarantee integrity?

berkay picture berkay · Sep 7, 2010 · Viewed 22.1k times · Source

To build a secure system, can we assume that encryption guarantees integrity is true before starting a secure programming?

  • Both in symmetric and public-key encryption, is my question well-proofed ?
  • If no, what are the vulnerabilities, can you give an example?

Answer

Matthew Flaschen picture Matthew Flaschen · Sep 7, 2010

No. This is easy to see if you consider the one-time pad, a simple (theoretically) perfectly secure system.

If you change any bit of the output, a bit of the clear text will change, and the recipient has no way to detect this.

This is an obvious case, but the same conclusion applies to most encryption systems. They only provide for confidentiality, not integrity.

Thus, you may want to add a digital signature. Interestingly, when using public key cryptography, it is not sufficient to sign then encrypt (SE), or to encrypt then sign (ES). Both of these are vulnerable to replay attacks. You have to either sign-encrypt-sign or encrypt-sign-encrypt to have a generally secure solution. This paper explains why in detail.

If you use SE, the recipient can decrypt the message, then re-encrypt it to a different recipient. This then deceives the new recipient about the sender's intended recipient.

If you use ES, an eavesdropper can remove the signature and add their own. Thus, even though they can't read the message, they can take credit for it, pretending to be the original sender.