In this example of digitally signing a simple message sent by Alice to Bob, Alice signs a message—"Hello Bob!"—by appending to the original message a version of the message encrypted with her private key. Bob receives the original message and the cryptographic signature and, using Alice's public key, verifies the authenticity of the message, i.e. that the signature can be decrypted to match the original message using Alice's public key.
https://en.wikipedia.org/wiki/File:Private_key_signing.svg
FlippyFlink