How to digitally sign a message
1. The message is 'Hashed' to produce the message digist (mini version)
2. The Digest is encrypted using the senders private key which becomes 'The signature'
3. The Signature is appended(attached) to the message
4. The entire message is encrypted using the recipients public key.
5. Message gets sent!
How to check the authenticity of a message
1. The RECIPIENT decrypts the message using their PRIVATE KEY
2. They then decrypt the signature using the SENDERS PUBLIC KEY to get the message digest
3. The decrypted message is then hashed again to reproduce the message digest
4. The reproduced digest is checked against the original to check it hasn't been tampered with.
5. If they differ its been changed in some way, if not, then its ok