Signing vs Verification
Signing and Verification are two halves of the same coin. The Sender uses their Private Key to 'Lock' the identity, and the Receiver uses the Sender's Public Key to 'Unlock' and confirm it.
Analogy
"Signing is like writing a check with a secret pen. Verification is like a bank teller using a special light to prove the signature is genuine."
Key Properties
- Signing: Hash(Data) + Private Key = Signature.
- Verification: Signature + Public Key = Original Hash.
- Final Check: If the 'Verified Hash' matches the 'Received Data Hash', it's valid.
Real World
In Bitcoin, when you 'Send BTC', you are actually providing a Digital Signature. Miners verify your signature using your Public Key to authorize the move.
Interactive Simulation
The Asymmetric Handshake
Signing happens in Private. Verification happens in Public. Bob can verify the signature using Alice's Public Key without ever knowing her Private Key. This is the fundamental breakthrough of modern cryptography.
Bob uses the Public Key (available to everyone) to run the math against the signature.
Technical Logic for Senior Devs
We don't sign the message itself (too slow). We sign the small Hash. If the message changes by one bit, the hash changes, and the signature will no longer match.
Bob decrypts the signature to see the original hash. He then calculates the hash of the message he received. If Calculated_Hash === Decrypted_Hash, the message is 100% authentic.