When using gpg --symmetric
to encrypt a file/message with a passphrase, is there any cryptographic integrity check to prevent an attacker from modifying the ciphertext? E.g. does gpg
(or any other common implementation of OpenPGP) include, and require, an HMAC or similar? (Obviously it can digitally sign the message, but only if you use your private key.)
The OpenPGP message format does include a CRC, but those are not cryptographically secure and I don't think it's even keyed (that is, if you modify the ciphertext I can just modify the CRC). However, doing so decrypts "successfully" (tampered with) but also produces the message WARNING: encrypted message has been manipulated!
Where is it getting that from? Is there some other protection? I first thought block cipher padding, but it's using AES256-CFB, which doesn't have padding to check.