How is a digital signature created?
To create a digital signature, the sender takes the message and processes it with a hashing algorithm. The sender then encrypts this hash with their own private key, and delivers it along with the message. The receiver then takes the encrypted hash, and decrypts it with the sender’s public key. Then the receiver takes the original message and runs it through the same hashing algorithm. If the two hashes are identical, then the receiver knows the message was not altered during transmission. Since the matching hash was derived from the encrypted private key of the sender, the receiver trusts that only the sender could have been the author of this message.