Current location - Quotes Website - Signature design - What you must understand is the blockchain digital signature mechanism.
What you must understand is the blockchain digital signature mechanism.
Blockchain uses hash function to realize that transaction information and address information can't be tampered with, which ensures the integrity of data transmission, but hash function can't realize the non-repudiation of transaction information (also known as denial and non-repudiation, which refers to the information provided by both parties in network communication when they are convinced of the true identity of participants and information interaction, that is, all participants can't deny or deny their true identity, as well as the authenticity of the information provided and the completed operations and commitments). Blockchain uses digital signature mechanism in public key encryption technology to ensure the non-repudiation of information.

Digital signature mainly includes signature algorithm and verification algorithm. In the signature algorithm, the signer signs the electronic file with his own private key, thus obtaining the signature ciphertext of the electronic file; In the verification algorithm, the verifier uses the signer's public key to verify the signature ciphertext of the electronic file, and judges the legality of the signed file according to the results of the verification algorithm. In the process of signing, only the signer knows his private key, and anyone who doesn't know his private key can't forge or sign the electronic document correctly. In the verification process, only legally signed electronic files can effectively pass the verification, and any illegally signed files can not meet its verification algorithm.

Commonly used digital signature algorithms include RSA digital signature, DSA digital signature, ECDSA digital signature, Schnorr digital signature and so on.

? Introduce RSA digital signature first: Maybe someone will ask what's the difference between RSA signature and encryption? Encryption and signature are both for security reasons, but they are slightly different. People often ask whether to use private key or public key for encryption and signature. In fact, they all confuse the functions of encryption and signature. Simply put, encryption is to prevent information from being leaked, while signature is to prevent information from being tampered with.

? Example: After receiving the message sent by B, A needs to reply "Received"-RSA signature process:

? First: A generates a pair of keys (public key and private key), the private key is not public, and A keeps it. The public key is public and can be obtained by anyone.

? Then: A signs the message with its own private key to form a signature, and passes the signed message and the message itself to B. ..

? Finally, after receiving the message, B obtains A's public key for signature verification. If the content of the verification is consistent with the message itself, it is proved that the message is made by ..

In this process, there are only two delivery processes. The first is that A delivers the signed message and the message itself to B, and the second is that B obtains A's public key. Even if both are intercepted by the enemy, there is no danger, because only A's private key can sign the message, and even if you know the message content, you can't forge a signature reply to B, thus preventing the message content from being tampered with.

To sum up, from books and the Internet, we have an intuitive understanding.