Frequently, we want to send messages that are (a) encrypted, so passive attackers can't discover the plaintext of the message, and (b) signed with a private-key digital signature, so active attackers can't make Alice think that a message came from Bob when it didn't.
Is it better to
- generate the digital signature from the (hashed) plaintext, and then encrypt a file containing both the plaintext message and the digital signature?
- encrypt the message first, and then generate a digital signature from the (hashed) encrypted file?
- combine encryption and public-key digital signatures in some other way?
A closely related earlier question ( Should we MAC-then-encrypt or encrypt-then-MAC? ) seems to focus on symmetric-key MAC authentication. As Robert I. Jr. asked earlier, Do do the same issues with (symmetric-key key) MAC-then-encrypt apply to (public-key key) sign-then-encrypt?