I'm learning about signatures using RSA and DSA, I've come across this little fact:

RSA can recover the message digest from the signature, whereas in DSA this isn’t possible – you have to have the original message too in order to determine the digest.

What are the implications of this? - Is the fact you can recover the message digest from the RSA signature a 'bad' thing for security?


It's really pretty much irrelevant. Message digests are done using a preimage-resistant hashing algorithm, which means that knowing the hash doesn't help you find anything that hashes to that value faster than brute force. But the attacker could also do the brute-force attack directly on the signature -- with both RSA and DSA, an attacker can see if the signature is a valid signature for a candidate message. This is inherent to all public-key signature algorithms; it means that if the attacker has a (not very long) list of possible messages, they can fairly quickly see if one of them was the thing the signature is for.

The one thing I can think of that might be different is that textbook RSA signatures and signatures using the old PKCS 1.5 padding will let someone tell whether two signatures are for the same message, without knowing the message, even if the signatures are with different keys (if they're the same key, the signatures themselves are the same, since both methods are deterministic).

RSA-PSS (the newer, randomized signature padding scheme for RSA) doesn't actually have message digest recovery, because it actually computes H(0..0||H(m)||S), where S is a random salt, and then uses that in the rest of the signature. It doesn't have the property above; without knowing the message, you can't easily tell if two signatures were for the same message. So, message digest recovery depends on padding.

Really, though, signatures in general are not designed to provide confidentiality. Anyone can confirm a guess about what your message is if they have a signature for it, so you should give your signatures as much confidentiality as you want for your message.

Your Answer

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

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