In public key cryptography, each user has a pair of keys: a public key and a private key. The public key is used for encrypting messages, and the private key is used for decrypting messages and creating signatures. When a sender wants to send a message, they use their private key to create a digital signature of the message. The signature is a mathematical function that transforms the message into a unique code and is sent along with the message. The recipient can validate the signature by using the sender's public key to decrypt the signature and obtain the original code that was used to create it and then using the same mathematical function to create a new code from the received message. If the code obtained from the signature and the code obtained from the message are the same, it means the signature is valid and the message is authentic.
spam quality