1, send a message
The sender uses a hash function to generate a message digest from the message text, and then encrypts the digest with its own private key. The encrypted digest will be sent to the receiver as the digital signature of the message.
Step 2 receive the message
The receiver first calculates the message digest from the received original message using the same hash function as the sender, and then decrypts the digital signature attached to the message using the sender's public key.
In this way, if the two digests are the same, the receiver can confirm that the digital signature belongs to the sender.
Extended data
Details of digital signature
Digital signature, also known as electronic signature, is to "sign" a digital document in some way by imitating the traditional handwritten signature, which has the same legal effect as the physical signature. Corresponding to the handwritten signature in the physical world, digital signature can be regarded as an electronic signature in the digital world, but at present, digital signature can only be realized by asymmetric cryptographic algorithm.
It is understood that the functions of digital signature mainly include:
1. The sender's signature can be recognized by the receiver, but it cannot be forged.
2. After the sender sends out the signature information, it is no good to deny it.
3. The receiver denies that the received signature information is unacceptable.
4. Once there is a conflict between the sender and the receiver, the arbitrator has enough evidence to make a judgment.
Baidu Encyclopedia-Digital Signature