Current location - Quotes Website - Signature design - How to generate keys, private keys and signatures
How to generate keys, private keys and signatures
Digital signature mainly goes through the following processes: information sender uses one-way HASH function (hash function) to generate information digest; The message sender signs the message digest with his own private key; The message sender sends the message itself and the signed message digest together; 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. Digital encryption mainly goes through the following processes: when the sender of information needs to send information, he creates a symmetric key and uses this symmetric key to encrypt the message to be sent; The information sender encrypts the symmetric key with the public key of the information receiver; The information sender combines the results of the first step and the second step and sends them to the information receiver, which is called a digital envelope; The information receiver decrypts the encrypted symmetric key with his own private key, and then the sender decrypts the encrypted ciphertext with this symmetric key to get the real original text. 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, digital signature only uses asymmetric key encryption algorithm, which can ensure the integrity, identity authentication and non-repudiation of transmitted information, while digital encryption adopts the method of combining symmetric key encryption algorithm and asymmetric key encryption algorithm, which can ensure the confidentiality of transmitted information.