Digital signature and verification: When sending a message, the sender uses a hash algorithm to generate a message digest with a fixed length from the message, and then encrypts the digest with its own private key. This process is called signing. The encrypted digest is sent to the receiver together with the message as the digital signature of the message. The receiver decrypts the encrypted digest (digital signature attached to the message) with the sender's public key to get the result A, and then uses the same hash algorithm as the sender to calculate the message digest B from the received original message. Finally, compare a and B. If they are the same, the receiver can confirm that the digital signature belongs to the sender. Encryption and decryption: the sender encrypts the plaintext to be sent with the public key of the receiver, and the receiver decrypts it with its own private key, where the public key and the private key are opposite, and one is used as the public key and the other as the private key.
2, the function of digital signature:
A) authenticating the signer;
B) Ensure the integrity of the information (it has not been tampered with during the transaction)
C) prevent denial in the transaction (the signer cannot deny that the information was sent by himself)
The function of encryption:
A) The focus is on "data security", which can prevent data from being intercepted.