An additional use of RSA is in digital signatures , which involves swapping the role of the private and public keys. If a sender encrypts a message using their private key, everyone can decrypt the message using the sender's public key. A successful decryption implies that the sender, who is the only person in possession of their private key, must have sent the message. This also prevents repudiation , that is, the sender cannot claim that they did not actually send the message. A piece of data encrypted with a private key is called a digital signature.
Common practice is to use a message digest as the item of data to be encrypted.
A message digest is a digital fingerprint of a message, derived by applying a mathematical algorithm on a variable-length message. This is known as being a one-way hash function . The algorithm is relatively simple, so when computerized it is not CPU-intensive. You can use message digests to guarantee that no one has tampered with a message during its transit over a network. Any amendment to the message will mean that the message and digest will not correlate.