Introduction
Imagine sending an important letter and wanting the receiver to be sure it really came from you and wasn't changed on the way. Digital signatures solve this problem for electronic messages and documents.
Imagine signing a paper letter with a unique pen that only you own. The receiver can check your signature to be sure the letter is really from you and that no one erased or changed your words.
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
│ Sender │ │ Message │ │ Receiver │
│ (Private Key) │──────▶│ + Signature │──────▶│ (Public Key) │
└───────────────┘ └───────────────┘ └───────────────┘
│ │ │
│ Create hash │ │
│ Sign hash │ │
│ │ │
│ │ Verify signature │
│ │◀──────────────────────┤
│ │ │
│ │ Check hash matches │
│ │ │