Blockchain digital signatures and hashing algorithms

The 5th World Internet Conference will be held in Wuzhen, and the theme of the conference is "Creating a Digital World of Mutual Trust and Governance - Working Together to Build a Community of Destiny in Cyberspace". New technologies represented by "ABCDEHI5G" (artificial intelligence, blockchain, cloud computing, big data, edge computing, smart home, Internet of Things and 5G) are flourishing and are profoundly changing the way of production, life and thinking of human beings and the process of human civilization.

Blockchain development enters a winter period, focus on doing things, come together to learn more about blockchain digital signatures and hashing algorithms. To prevent malicious forgery and tampering of sending node information and data, blockchain also introduces digital signature technology.

I. Transaction process

The blockchain transaction process is as follows, as shown in Figure 1 below.

1 The encryptor generates the public-private key pair.

2 The cryptographer is interested in** information**Performing hash operations to generate summaries， Digital signature generation by digest processing using the cryptographer's private key information。

3 Encrypted digital signature information harmony information Send to the recipient along with the public key three。

4 The recipient decrypts the encrypted hash value by the sender's public key and restores the hash value.

5 countersign information carry out verification。

Figure 1 Blockchain data layer transaction process schematic

** In blockchain, digital signature technology consists of two computing algorithms: signature and verification**。

information Hashing of data， also known as“ summary”， whether information how big is it?， Both can generate a fixed-length summary， The summary can be calibrated information Whether it has been tampered with， As long as the message is modified by any byte， The checksums for the summaries all fail。

** Signing is done using the private key and information The hash value of the generated signature；**

delivery node information The data is passedHash Encrypted generation of abstracts， The digest is then digitally signed using the private key of the sending node， The sending node puts the information data／ digital signature／ The sending node public key is broadcast together to the receiving node network-wide。

Figure 2 Schematic diagram of digital signature and Hash encryption

** Authentication is the use of a public key to verify the authenticity of a signature**。

The receiving node takes the incoming data information Perform hash encryption to get the hash value， Checks against the hash value obtained by decrypting the digital signature sent by the sending node， If the same is valid in the signature， Then the data is correct。

Figure 3 Diagram of digital signature verification

** The role of digital signature technology is to ensure that the sending information It will not be tampered with。**

II Hashing algorithm and advantages and disadvantages

** The hashing algorithm solves the problem of putting information Questions that are simple and efficient to code and allow participants to authenticate safely and quickly。**

** Both ethereum and bitcoin use EC****DSA**** algorithm, the only difference being that the hash functions are different; Bitcoin's hash algorithm uses SHA2-256 and Ether's uses the new SHA3-256.**

One of the earliest Hash algorithm standards is also the MD5 hash algorithm, which outputs a fixed 128-bit string that is easy to break and vulnerable to attacks because of the short length of the string and the simplicity of the operation.

SHA1 is an increase in output length from MD5, outputting a 160-bit fixed-length string, and does not fundamentally improve its ability to withstand more powerful machines.

Unlike SHA1/SHA2, SHA3 does not simply expand the byte count, but uses the new Keccak algorithm. SHA1 has now been breached, and it is only a matter of time before SHA2 is breached. SHA3 of the same byte width is more secure than SHA2.

SHA3 is a new standard that fundamentally replaces SHA2, with a completely different internal algorithmic mechanism. SHA3 has a sponge structure mechanism that allows the use of random permutations to absorb and output data, while also providing a random source for bitwise future input values.

Although SHA3 is now available, and quantum computing has developed as computer computing power has increased, the Hash algorithm still faces the following two problems.

** (1) Hash function internal complexity is not high enough**

** (1) Hash function generated by the value of the length is not long enough**

III Digital signature techniques and their advantages and disadvantages

digital signature， Also known as public key digital signatures， It is a type of digital authentication by public key encryption information promotion of the method。 Based on this technology information The sender can send a string of numeric characters that no one else can forge by sending， It is also possible to prove that sending information truthfulness。

Modern cryptography is divided into two categories according to the key: symmetric and asymmetric encryption algorithms:

A Symmetric encryption is as long as there is one key, and the same key is used for both encryption and decryption.

B The asymmetric encryption key and the decryption key are different.

Asymmetric encryption has the advantage of not requiring the encryption key to be exposed on the network, which is more secure mechanically. Disadvantages Encryption efficiency is much lower than symmetric encryption, so asymmetric encryption is generally only used in cryptographic operations with small data volumes like digital signatures.

Blockchain public key cryptosystem uses is asymmetric cryptographic algorithm. The more commonly used encryption algorithms are public key encryption algorithms, such as**DSA**、RSA、PGP、ecc。

** The current digital signature algorithm commonly used in blockchain is the elliptic curve signature algorithm ECDSA. Both Ether and Bitcoin use the ECDSA algorithm; EOS uses a multi-signature algorithm. The net banking system uses the RSA algorithm.**

In the ecsDA algorithm, the simulation of the Digital Signature Algorithm (DSA) using Elliptic Curve Cipher (ECC). ECC creates public/private key pairs based on the use of points on an elliptic curve to be defined, which are difficult for hackers to break using the commonly used brute-force cracking methods, and is an encryption algorithm that provides faster encryption with less computational power than the RSA encryption algorithm.

** Major disadvantages of ECC.**

** 1) Significantly increase the size of the encrypted message over RSA encryption.**

** 2) The ECC algorithm is more complex and difficult to implement than RSA, which reduces the security of the algorithm.**

IV The future

As digital computing rapidly evolves, quantum computing will break RSA encryption algorithms as well as brute force Hash algorithms, and whatever algorithm is chosen will sail to a future where computing is more efficient, and every effort must be made to pick good algorithms that will stand the test of time.

If a person is all information All confined to his field of work， Then he won't do his job very well。 A man must have sunshine， He could look at books or people- It's best to cultivate an eye for both。

-Harvey. Fahrenheit (name)

** Welcome to share**

Netease Lede DBA group is responsible for the daily operation and maintenance of Netease Lede e-commerce, Netease mailbox, Netease technical department database, responsible for the development and maintenance of database private cloud platform, responsible for the development and testing of database and database middleware, etc. Share the most cutting-edge practical database dry goods, focus on Netease Lede DBA, refine database skills.

Follow NetEase's Leeds DBA

Understanding cutting-edge database technology