I've been diving into cryptography concepts, and I'm confused about signed messages. Sites say they help us: 1) identify the sender, and 2) check if the message was tampered with. But can't we do that with just an encrypted message without a digest? If we decrypt a message with someone's public key, we know who sent it, right? And if the message is tampered with, wouldn't it just come out corrupted when decrypted? How would someone tamper meaningfully? Would they just brute force it until the ciphertext matches what they want? I'd love some clarity!
5 Answers
Cryptography is complex! Remember the CIA triad: Confidentiality, Integrity, and Availability. Signatures ensure integrity, while encryption ensures confidentiality. If you encrypt but don't check for integrity, you may still flip bits without corruption. Attackers can manipulate certain encrypted data without compromising the whole thing! So, signatures add a layer of protection that just encryption doesn’t cover well.
If you swap a message with another encrypted one, it won't corrupt. It decrypts just fine, which is a potential issue in some protocols with similar messages. So while some tampering might not show corruption, it can still alter the message meaningfully. This means you can't always rely only on decryption to check integrity!
Isn't that a replay attack? And couldn’t the same happen with a signed message too?
I think there's confusion around signing and encryption. Signing is about creating a digest (hash), while encryption is reversible by design—so they aren't the same! Signing verifies the sender when encrypted with a private key and decrypted with a public key, but it's not merely that simple.
Seems really different. Thanks for clearing that up!
You're mixing encryption with signing; they're different. Signing a message keeps it in plain text, just attaching a hash to confirm it hasn't changed. The sender makes a hash, encrypts it with their private key (that's the signature), and sends both the message and signature. The receiver decrypts the signature with the public key, checks the hash, and compares it to a new hash of the message. If they match, the message is untampered!
OK that makes sense, thanks 🙂
To clarify, if a public key can decrypt a message, the encryption isn't very secure. Proper encryption keeps the messages safe from tampering and ensures integrity. Even if you know the expected format, verifying automatically can be tricky, so someone could still replace a message with something that looks fine at a glance.
Right, and it shows how important the hash is!

That makes sense! Flipping bits feels tricky, but I guess with the right intent, it can happen.