Signature Verification Process
You'll learn how a recipient verifies a digital signature by reconstructing and comparing hashes.
How Verification Works
When you receive a digitally signed message, you need to confirm two things: that the message came from the claimed sender and that it wasn't altered. The verification process systematically checks both.
The recipient performs three precise steps:
Step 1: Compute the Message Hash
First, you independently hash the received message using the same hash function the signer used (SHA-256, SHA-3, etc.). This gives you a fresh digest of what actually arrived.
Step 2: Apply the Public Key
Next, you use the sender's public key to decrypt or "verify" the signature itself. Remember the hash-then-sign paradigm: the signature is essentially the hash encrypted with the sender's private key. Applying the public key reverses this, extracting the original hash value that the sender computed.
Step 3: Compare Results
Finally, you compare the hash you just computed (Step 1) with the hash you extracted from the signature (Step 2). If they match perfectly, the signature is valid. If they differ even slightly, either the message was tampered with or the signature is fraudulent.
Why This Works
This process relies on asymmetric cryptography: only the sender's private key could have created a signature that their public key successfully verifies. Since you computed the hash independently, you know the message content matches what was signed.
Think of it like checking a sealed envelope: you compute what the contents should produce, then use the sender's known "stamp" (public key) to confirm the seal is authentic.
Key Takeaway: Signature verification computes a fresh hash of the received message, applies the sender's public key to the signature to extract the original hash, and confirms both hashes match—proving authenticity and integrity.