2
$\begingroup$

Is it possible to check if a PGP signed message has been modified when the public key of the signer is not available?

Like, is there a message digest (hash) that can be checked without knowing the public key of the signer?

Note that I am aware that, even if the message digest is okay, it is not possible to prove authenticity. However, what I am asking is if I can discover just the case that the message has been modified (more accidentally than intentionally tampered with).

Basically, I'm asking if I can technically detect a modification of a signed message without the signer's public key.

The reason why I am asking is this scenario:

  • I get a message that is signed
  • I don't have the signer's public key
  • My app tells me that the signer cannot be verified

Now I modify one byte of the message and try again, then

  • My app still tells me that the signer cannot be verified

while I would think that, in this scenario, it would be more important to know that the message has been modified.

$\endgroup$
3
  • $\begingroup$ If you are not able to verify the authenticity of a message, how can you trust any calculation of its integrity? Or to put it another way, if I have maliciously modified a signed message, couldn't I just as easily maliciously modify the checksum? $\endgroup$
    – jamesbtate
    Jun 6, 2023 at 3:00
  • 1
    $\begingroup$ Tampered with explicitly indicates intentional modification, and that's not limited to cryptography. Further, in a cryptographic context, altered also at least includes the possibility of intentional modification. If you are limited to accidental modification (as I now think you are), that should be more explicit in the question; the added "think of: " still does not make it clear enough. $\endgroup$
    – fgrieu
    Jun 6, 2023 at 6:00
  • 1
    $\begingroup$ @fgrieu Thanks for the pointer. I'm not a native speaker, so perhaps that's why I wasn't aware of the narrow meaning of tampered with. I've updated the question accordingly. $\endgroup$
    – not2savvy
    Jun 6, 2023 at 9:04

1 Answer 1

3
$\begingroup$

There is no cryptographically sound method to check if a PGP signed message has been tampered with† when the public key of the signer is not available.

Argument: an adversary can craft any message they like, sign it with a private key of their choice, and if encryption is used encipher it with the public key of the intended recipient(s), which by the standard definition of public is assumed available to adversaries.


There are several ways in which many (and for large messages at least, most) accidental alterations of the message can be detected (at least with knowledge of the public key of a recipient, or of the password for symmetrically encrypted data), including

  • A 16-bit field of a signature packet version 4 (or 3) designed specifically for this purpose.
  • The Modification Detection Code which is designed for that purpose.
  • The (little) redundancy built into the compression that is optionally used.
  • And of course the redundancy in the message itself.

† The standard meaning of that is that an intentional modification has been applied. Further, in a cryptographic context, the default is to assume that alterations are deliberately made by intelligent adversaries.

$\endgroup$
2
  • $\begingroup$ Thanks for your answer. However, as I said in my question, I am aware of the fact that any signer could have signed the message after having modified it. Yet, that's not what I'm after. I'm asking if I can detect a modification of the message without the signer's public key. I edited my question in the hope to make that clearer. $\endgroup$
    – not2savvy
    Jun 5, 2023 at 23:51
  • 2
    $\begingroup$ @not2savvy: The signing blob contains the first 16 bits of the hash of the message. This usually fast-rejects damaged messages. $\endgroup$
    – Joshua
    Jun 6, 2023 at 3:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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