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?