The information sender uses a one-way HASH function (hash function) to generate an information digest of the information; The message sender signs the message digest with his own private key; The message sender sends the message itself together with the signed message digest.
The information receiver generates a new message digest by using the same one-way HASH function as the information sender, and then verifies the message digest by using the public key of the information sender to confirm the identity of the information sender and whether the information has been modified.
Brief introduction of digital signature
Although both digital signature and digital encryption process use public key system, the implementation process is just the opposite, and the key pairs used are also different. Digital signature uses the sender's key pair, the sender encrypts with his own private key, and the receiver decrypts with the sender's public key. This is a one-to-many relationship, and anyone with the sender's public key can verify the correctness of the digital signature.
Digital encryption uses the key pair of the receiver, which is a many-to-one relationship. Anyone who knows the receiver's public key can send encrypted information to the receiver, and only the only person who owns the receiver's private key can decrypt the information. In addition, the digital signature only uses asymmetric key encryption algorithm.
It can ensure the integrity, authentication and non-repudiation of the sent information, while digital encryption can ensure the confidentiality of the sent information by combining symmetric key encryption algorithm and asymmetric key encryption algorithm.