Must blockchain be encrypted
in fact, blockchain uses the basic principles of modern cryptography to ensure its security mechanism. The knowledge system involved in the field of cryptography and security is very complicated. Here, I only introce the basic knowledge of cryptography related to blockchain, including hash algorithm, encryption algorithm, information digest and digital signature, zero knowledge proof, quantum cryptography, etc. Through this lesson, you can learn how to ensure the confidentiality, integrity, authentication and non repudiation of the blockchain using cryptography technology
basic course lesson 7 basic knowledge of blockchain security
1. Hash algorithm (hash algorithm)
hash function (hash), also known as hash function. Hash function: hash (original information) = summary information. Hash function can map any length of binary plaintext string to a shorter (generally fixed length) binary string (hash value)
a good hash algorithm has the following four characteristics:
1. One to one correspondence: the same plaintext input and hash algorithm can always get the same summary information output
2. Input sensitivity: even if the plaintext input changes slightly, the newly generated summary information will change greatly, which is greatly different from the original output
3. Easy to verify: plaintext input and hash algorithm are public, anyone can calculate by themselves, and whether the output hash value is correct
4. Irreversibility: if there is only the output hash value, the hash algorithm can never dece the plaintext
5. Conflict avoidance: it is difficult to find two plaintexts with different contents, but their hash values are the same (collision)
for example:
hash (Zhang San lent Li Si 100000 yuan for 6 months) = 123456789012
such a record as 123456789012 is recorded in the account book
it can be seen that hash function has four functions:
simplify information
it is easy to understand, and the information after hashing becomes shorter
identification information
you can use 123456789012 to identify the original information, and summary information is also called the ID of the original information
hidden information
the account book is a record like 123456789012, and the original information is hidden
verification information
if Li Si cheated that Zhang San only lent Li Si 50000 when repaying, both parties can verify the original information with the hash value of 123456789012 recorded before
hash (Zhang San lent Li Si 50000 for 6 months) = 987654321098
987654321098 is completely different from 123456789012, which proves that Li Si lied, Then the information can't be tampered
common hash algorithms include MD4, MD5 and Sha series algorithms, and Sha series algorithms are basically used in mainstream fields. Sha (secure hash algorithm) is not an algorithm, but a group of hash algorithms. At first, it was SHA-1 series, and now the mainstream applications are sha-224, SHA-256, sha-384 and sha-512 algorithms (commonly known as SHA-2). Recently, Sha-3 related algorithms have been proposed, such as keccak-256 used by Ethereum
MD5 is a very classic hash algorithm, but unfortunately, both it and SHA-1 algorithm have been cracked. It is considered by the instry that its security is not enough to be used in business scenarios. Generally, sha2-256 or more secure algorithm is recommended
hash algorithm is widely used in blockchain. For example, in blocks, the latter block will contain the hash value of the previous block, and the content of the later block + the hash value of the previous block will jointly calculate the hash value of the later block, which ensures the continuity and non tamperability of the chain< Encryption and decryption algorithm is the core technology of cryptography, which can be divided into two basic types: symmetric encryption algorithm and asymmetric encryption algorithm. According to whether the key used in the encryption and decryption process is the same or not, the two modes are suitable for different needs, just forming a complementary relationship, and sometimes can be combined to form a hybrid encryption mechanism
symmetric cryptography (also known as common key cryptography) has the advantages of high computational efficiency and high encryption strength; Its disadvantage is that it needs to share the key in advance, which is easy to leak and lose the key. The common algorithms are des, 3DES, AES and so on
asymmetric cryptography (also known as public key cryptography) is different from the encryption and decryption key, and its advantage is that it does not need to share the key in advance; Its disadvantage is that it has low computational efficiency and can only encrypt short content. Common algorithms include RSA, SM2, ElGamal and elliptic curve series. Symmetric encryption algorithm is suitable for the encryption and decryption process of a large number of data; It can't be used in signature scenario: and it often needs to distribute the key in advance. Asymmetric encryption algorithm is generally suitable for signature scenario or key agreement, but it is not suitable for large amount of data encryption and decryption< Third, information digest and digital signature
as the name suggests, information digest is to hash the information content to obtain a unique digest value to replace the original and complete information content. Information digest is the most important use of hash algorithm. Using the anti-collision feature of hash function, information digest can solve the problem that the content has not been tampered
digital signature is similar to signing on paper contract to confirm contract content and prove identity. Digital signature is based on asymmetric encryption, which can be used to prove the integrity of a digital content and confirm the source (or non repudiation)
we have two requirements for digital signature to make it consistent with our expectation for handwritten signature. First, only you can make your own signature, but anyone who sees it can verify its validity; Second, we want the signature to be only related to a specific file and not support other files. These can be achieved by our asymmetric encryption algorithm above
in practice, we usually sign the hash value of information instead of the information itself, which is determined by the efficiency of asymmetric encryption algorithm. Corresponding to the blockchain, it is to sign the hash pointer. In this way, the front is the whole structure, not just the hash pointer itself< Zero knowledge proof means that the verifier can make the verifier believe that a certain conclusion is correct without providing any additional information to the verifier
zero knowledge proof generally meets three conditions:
1. Completeness: authentic proof can make the verifier successfully verify
2. Soundness: false proof can not make the verifier pass the verification
3. Zero knowledge: if you get proof, you can't get any information other than the proof information from the proof process< With more and more attention paid to the research of quantum computing and quantum communication, quantum cryptography will have a huge impact on the information security of cryptography in the future
the core principle of quantum computing is that qubits can be in multiple coherent superposition states at the same time. Theoretically, a large amount of information can be expressed by a small number of qubits and processed at the same time, which greatly improves the computing speed
in this way, a large number of current encryption algorithms are theoretically unreliable and can be cracked, so the encryption algorithm has to be upgraded, otherwise it will be broken by quantum computing
as we all know, quantum computing is still in the theoretical stage, which is far from large-scale commercial use. However, the new generation of encryption algorithms should consider the possibility of this situation.
however, it's easy for people with an eye to see why there is no security layer? In fact, several key features of blockchain have already solved the security problem. First, the blockchain uses asymmetric encryption technology. In fact, encryption and decryption are different keys, namely public key and private key. In short, the public key is open to the public, while the private key is absolutely confidential
secondly, distributed bookkeeping is a way for blockchain to store data. It can also be understood as distributed storage, which is consistent with the concept of decentralization. In the form of ledger, there is no central ledger in the network, and the ledger is stored in each node. Each node is not only independent, but also can act as the central node. Therefore, the central node will not be attacked, leading to the loss of core books or data, and the whole network will not be paralyzed
moreover, tamper proof is the basic feature of blockchain. As long as the chain can not be modified, and can not be deleted. If it needs to be changed, based on the principle of transparency and openness, the whole network and all nodes need to be informed. Therefore, under the democratic mechanism, the possibility of tampering with data at will is very low. Therefore, blockchain technology is applied in various instries, such as finance, payment, traceability, games, etc., such as the network "universe", Tencent's "come together to catch the demon", and Zhongan Huanyu blockchain "Dr dragon hunt" are the safe and high-quality procts under the blockchain technology.
1.1. Introction
practitioners in the computer instry should be very familiar with the word hash. Hash can realize the mapping of data from one dimension to another, and hash function is usually used to realize this mapping. Generally, y = hash (x) is used in the instry. The hash function can calculate a hash value y by calculating X
hash function characteristics in blockchain:
function parameters are string type
fixed size output
is computationally efficient
collision free means that the conflict probability is small: X= y => hash(x) != Hash (y)
hide the original information: for example, the verification of transactions between nodes in the blockchain only needs to verify the information entropy of the transaction, and does not need to compare the original information. The nodes do not need to transmit the original data of the transaction, only the hash of the transaction, Common algorithms include Sha series and MD5
1.2. Hash is widely used in blockchain. One of them is called hash pointer
hash pointer, which means that the value of the variable is calculated from the actual data and points to the actual data location, That is, it can not only represent the actual data content, but also the storage location of the actual data. The figure below shows the schematic diagram of hash pointer

blockchain technology originates from bitcoin, and its essence is to create a decentralized digital currency system by using computer algorithm and cryptography technology, so as to realize the functions of currency issuance and transaction
characteristics of blockchain Technology:
1. Decentralized: there is no centralized hardware or management organization in the whole network, the rights and obligations of any node are equal, and the damage or loss of any node will not affect the operation of the whole system. Therefore, it can also be considered that the blockchain system has excellent robustness
2. Trustworthiness: there is no need to trust each other when participating in the data exchange between each node in the whole system. The operation rules of the whole system are open and transparent, and all data contents are also open. Therefore, in the specified rule range and time range of the system, nodes can not and cannot cheat other nodes
3. Collective maintenance: data blocks in the system are jointly maintained by all nodes with maintenance function in the whole system, and these nodes with maintenance function can be participated by anyone
4. Reliable database: the whole system will enable each participating node to obtain a of the complete database in the form of sub databases. Unless more than 51% of the nodes in the whole system can be controlled at the same time, the modification of the database on a single node is invalid, and the data content on other nodes cannot be affected. Therefore, the more nodes and computing power in the system, the higher the data security in the system
the other two features are derived from the four features:
5. Open source: because the operation rules of the whole system must be open and transparent, the whole system must be open source for the program
6. Anonymity: since there is no need to trust each other between nodes, there is no need to disclose the identity between nodes, and each participating node in the system is anonymous< EGD: e-gold coin, or EGD for short, is a network encrypted digital asset based on peer-to-peer Internet open source protocol, which circulates in a decentralized network system. EGD, as a kind of consumer asset given by global commercial consumers from businesses, is used to replace the points issued by businesses in traditional commercial society, realizing the networking, integration and capitalization of global commercial points
EGD, namely network gold, is an encrypted digital asset based on decentralized digital encryption technology. EGD was born in January 2014. It was developed by a team of 17 technical experts from seven countries around the world, led by former Microsoft engineers. EGD introces the technology of encrypted digital assets into the field of global business integration points, which enables global consumers to continuously share the profits of commercial society through the circulation and value-added of EGD business points, and create a win-win economic model for businesses and consumers
features of customized EGD:
with customized technology, we can easily build all kinds of intelligent assets based on EGD protocol, including stocks, bonds, or various derivative points
more importantly, customization technology not only expands the application scope of EGD, but also retains the characteristics of clear property rights and decentralization of EGD. Moreover, e to the limited number of customized points, customized points are more scarce.
jinwowo will use blockchain technology to promote the legalization of big data business. The encryption of blockchain technology can ensure that the privacy of data sources can be better protected while big data is called.
the details of these two digital assets are as follows
bitcoin (bitcoin: bitcoin) was originally a kind of network virtual currency, which can buy real-life goods. It is characterized by decentralization, anonymity, and can only be used in the digital world. It does not belong to any country or financial institution, and is not subject to geographical restrictions. It can be exchanged anywhere in the world. Therefore, it is used as a money laundering tool by some criminals
the full name of NMC is "new media chain", the Chinese name is media chain, and the former domain name currency (also referred to as NMC) is two completely different currencies. NMC is the circulating currency of three decentralized application platforms: coin call [blockchain information community portal], coin search [blockchain network query tool], ncoin [digital currency exchange]. However, the prices of these two kinds of digital currencies will fluctuate with the market, which can not guarantee a development prospect. If the current price is concerned, bitcoin will be a bit higher.
in the future, blockchain encryption can be said to be cracked. Of course, it's not the current computer system, it's the quantum computer. Once this thing is mass proced, the blockchain will be abandoned.