Hash, also known as hash, is just a function that compresses messages of arbitrary length into message digests of fixed length.
So how to ensure that the original text is useless and tampered with by a third party? The answer is digital signature.
This is similar to the signature in reality, that is, a paragraph is added after the message as the proof of the sender to prove that the message has not been tampered with.
As shown in the above figure,
Analysis: Suppose C intercepts information, and he wants to tamper with the content. First of all, the signature can't be tampered with because it doesn't have the sender's private key. If he signs with his own private key, the receiver cannot decrypt it with the sender's public key. So he can only tamper with the ciphertext. However, the digest obtained by the receiver after decrypting and hashing the ciphertext must be different from the original digest, and the digest obtained by decrypting the signature with the sender's public key will certainly not be tampered with, so there will be inconsistencies between the two digests, which can confirm that the content has been tampered with.
Asymmetric encryption and digital signature are a bit of a detour, but you will definitely say: Satoshi Nakamoto 666! ! !
to be continued ...