4

This is very similar question to: If someone breaks encryption, how do they know they're successful?

Basically, the answers to that question is that an attacker doesn't know when decryption was successful.

So then how do encryption programs(e.g. gpg) know when you have decrypted something successfully? Do they have a magic value that is encrypted during encryption and makes sure that it decrypts to that value? If so, does that expose a vulnerability?

Kyle
  • 43
  • 3

2 Answers2

10

Generally speaking, the encryption is deemed successful if the result "makes sense". In the case of an encrypted disk, one can expect to find a properly structured filesystem after decryption, and a filesystem has a lot of recognizable features.

Also, many disk encryption softwares, which protect disks with a password, include an explicit "magic value" in order to promptly inform the user when he typed his password wrong. This is much better than trying to work with an improperly decrypted disk, which may result in data loss.

Thomas Pornin
  • 320,799
  • 57
  • 780
  • 949
  • If you use a magic value, does that make it easier for an attacker to decrypt? They could just keep trying keys and see if the magic value decrypts properly rather than having to figure out if it decrypted properly. (Doing this for the magic value may still take a lot of time though) – Kyle Oct 12 '11 at 22:05
  • 4
    @Kyle: a filesystem begins with a header which is full of equally magic values, so I would say that the encryption-specific magic value does not substantially help the attacker. – Thomas Pornin Oct 12 '11 at 22:19
1

That is not a problem for the encrypting system itself. There are none of the variables related to a decryption attack by an outsider present in the functioning of a system decrypting the files it encrypted. Rather it is just following a specific set of procedures.

The program does not need to test ("know") when it succeeds any more than a key need check to see if it pushed the tumblers correctly in a door lock. Instead it is just reporduces a specific set of procedures.

zedman9991
  • 3,377
  • 15
  • 22