Really, I'm asking how do you know who sent it?

My confusion has arisen from the following scenario...

Problems with Signing-then-encrypting.

If Alice digitally signed some data and then encrypted the data and the digital signature using Bob's public encryption key,

Bob could behave maliciously and...

1. decrypt and recover the data and the digital signature;

2. encrypt the data and the digital signature using Charlie's public encryption key;

3. send this ciphertext to Charlie, who decrypts it and verifies Alice's digital signature.

So Charlie can decrypt the message using his private key but how does he know what to do with the digital signature? How would he know what verification algorithm to use? How would he know who signed it?

  • $\begingroup$ format encoding. S/MIME automatically adds the certificate (which tells you the raw method and the public key) to messages AFAICT and most decent schemes will also encode the details somewhere (RSA-PSS does this). $\endgroup$
    – SEJPM
    Apr 2, 2016 at 19:33
  • 1
    $\begingroup$ @SEJPM CMS-thus-S/MIME always has signer identifier (in SignerInfo.sid) but formally the cert is optional and may be omitted if 'it is expected that recipients have an alternate means of obtaining' it; in practice it is usually if not always present. RSA-PSS does not encode anything about the signer, nor even its own (MGF) parameters nor the data hash used -- which latter its predecessor RSASSA-PKCS1-v1_5 does. In contrast PGP includes the keyid of the signer, but rarely if ever the signer's actual signed-publickey. Both do, always, have metadata identifying the algorithm (and parameters). $\endgroup$ Apr 3, 2016 at 1:18
  • $\begingroup$ @dave_thompson_085, sounds like you know CMS and PGP very well. Would you mind writing a full answer then (explaining what you can recover from signatures, what not and how the situation is for CMS and PGP, the two most common schemes)? $\endgroup$
    – SEJPM
    Apr 3, 2016 at 12:07


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.