Cryptography in Blockchain
Preface: Talking about blockchain is inseparable from cryptography. Generally speaking, blockchain technology uses block chain data structures to verify and store data, uses distributed node formula algorithms to generate and update data, uses cryptography to ensure the security of data transmission and access, and uses automated scripts to A new distributed infrastructure and computing paradigm for programming and manipulating data through smart contracts composed of code. The core of the blockchain is a chained data structure that combines data blocks in a sequentially connected manner in chronological order, and a cryptographically guaranteed non-tamperable and unforgeable distributed ledger. We make a summary of this, and we can find that there are four indispensable core technologies in the blockchain, namely distributed storage, consensus mechanism, cryptography principles and smart contracts. Today we will mainly talk about the origin of blockchain from the perspective of cryptography.
【Caesar Cipher】
Cryptography is an ancient discipline with a long and fascinating history. Its use to protect military and diplomatic correspondence dates back thousands of years to ancient times when writing was just being invented. For thousands of years, cryptography has been continuously advancing. With the rapid development of today's information age, the role of cryptography is becoming more and more important. It is not limited to military, political and diplomatic use, but is closely related to people's lives: if people are shopping online, communicating with businesses, using credit cards, etc., they all need the knowledge of cryptography to protect People's personal information and privacy, of course, for the blockchain technology we are concerned about, cryptography exists as its cornerstone.
Caesar was the first to use a substitution cipher for military use and to document it. In his Gala Gaul, which celebrates his exploits, Caesar describes sending secret letters to Cicero, who was under siege and on the brink of surrender. Caesar liked to use cipher text very much, and the "Biography of Caesar" of later generations recorded a kind of cipher text used by Caesar in detail. And this encryption method is still in use today.
The representation method of the Caesar cipher is: replace each letter with the letter three digits after the letter in the alphabet. It is a technique of substitution encryption. All letters in the plaintext are offset backwards (or forwards) by a fixed number on the alphabet and then replaced with ciphertext. For example, when the offset is 3, all letters A will be replaced with D, B with E, and so on. That is, the letter A is replaced by the letter D, and the letter B is replaced by the letter E. For example, Abroad, when Caesar wrote a letter in ciphertext, was replaced by Deurdg. In this way, the ciphertext that the enemy cannot understand is obtained.
If there is such a command:
RETURN TO ROME
Encrypted with the Caesar cipher, it becomes:
UHWXUQ WR URPH
If this instruction is intercepted by the enemy, it will not be leaked, because there is no meaning in the words.
Now it seems that this encryption method may be a little naive, but as the earliest case of using encryption keys recorded in history: the encryption key is shared by the sender and the recipient, marking the origin of modern cryptography. It can be said that from the Caesar cipher to the thousands of years before the public key was invented in the 20th century, the principles of cryptography are the same. The encryption method of Bitcoin and blockchain is different from the principle of Caesar cipher, that is, there are more public keys. To this day, when we watch many spy movies, we will find that many agents and spies still use this method to transmit information.
There are a few terms here that deserve special mention. Cryptographers usually refer to the alphabet used to write the original information, that is, the normal alphabet, as the plain code table; and the one used to replace the plain code letters is called the cipher table. This is where the word password comes from. Then move three bits back, and this "three" is called the key. Of course, anyone who has studied mathematics understands that there are 26 letters here. Just by moving them in order, each letter has 25 different alternatives, that is, 25 keys. too much. Algorithms are the process of deciphering codes through various attempts.
It is conceivable that around 100 BC, which is equivalent to the Western Han Dynasty in China, the possibility of deciphering Caesar's code was almost zero. In cryptography, the Caesar cipher is one of the simplest and best known encryption techniques. The Caesar cipher is also used in the modern ROT13 system. But like all encryption techniques that use alphabet substitution, the Caesar cipher is very easy to break, and it cannot guarantee communication security in practical applications.
[Multi-table substitution]
The earliest classical cryptosystems mainly include single-table substitution cryptosystems and multi-table substitution cryptosystems. As two important systems in classical encryption, it has been widely used in various regions of the world in ancient history. Caesar cipher is a typical single-table substitution cipher.
The single-table substitution cipher has been considered unbreakable for a thousand years, because there are a huge number of keys, which cannot be calculated by hand. However, with the development of society and the advancement of technology, the Arabs from the East found a newer technology and found a shortcut to crack this code that was considered unsolvable. , statisticians and religious scientists jointly completed the three.
This is also indirectly thanks to the invention of papermaking in China, and the rapid spread of Islamic civilization. Because the demand for books is soaring, someone needs to proofread it, and the most qualified person for this job is naturally a theologian. While proofreading, they are also counting the frequency of words used in the Revelation of Muhammad. If there are new words in this Revelation, then the year of its appearance must be later, and so on. In the process of combing, they also found that some letters appear more frequently than others.
We who have studied English know that the letter e is the most common, followed by the letters t and a. If it is encrypted according to the Caesar cipher, a password letter corresponds to a plain code letter, then the letter that appears most frequently in the password letter should correspond to the plain code letter E, and so on, it is easy to exclude a large number of keys, so as to quickly find correct deciphering method. It is impossible to verify who connected the frequency of letters with the deciphering code, but what is certain is that the Arabs were already very good at deciphering the Caesar code in the ninth century AD.
From the 7th century AD to the 12th century AD, the Arabs established a splendid civilization. In comparison, Europe was still an ignorant, backward and poor place at that time. The prosperity of Islamic civilization not only brought the prosperity of art, science and other cultures, but also the rule and management of society was very orderly and efficient. The managers at that time not only encrypted key government affairs, but also used cryptography when recording taxes. They were still discussing technical issues related to cryptography in management documents such as the "Minister's Handbook". It is precisely because of the huge demand and the advancement of science and technology that the Arabs finally have the opportunity to decipher the millennium problem of replacement codes.
The deciphering of the single-table substitution is very simple, because under the single-table substitution, except for the change of the letter name, the statistical characteristics such as the frequency of letters, the pattern of repeated letters, and the combination of letters have not changed. Relying on these unchanged statistical characteristics Single table substitution can be deciphered. Compared with single-table substitution, multi-table substitution ciphers are much more difficult to decipher.
Multitable substitution was invented around 1467 by the Florentine architect Alberti. Multi-table substitution ciphers are further divided into aperiodic multi-table substitution ciphers and periodic multi-table substitution ciphers. In a multi-table substitution cipher, multiple letters are used as the cipher. In order to speed up encryption or decryption, all letters are usually written on a form, which is called tableau in cryptography. This form is usually 26×26, because all 26 English letters can be put down in this way. The method of filling the form and selecting the letter to use next time is the definition between the different multi-letter substitution ciphers. Multi-letter substitution ciphers are more difficult to break than single-letter substitution ciphers because there are many substitution possibilities and the ciphertext needs to be longer.
The most famous of these is the Virginia cipher introduced by Bellazzo in 1585. It remained undeciphered until 1863. The French call it "the unbreakable cipher" (French: le chiffre indéchiffrable). This cipher was mistakenly believed to be created by Bryce de Virginia, so it is called the Virginia cipher.
In the Virginia cipher, only 26 letters need to be filled directly in the first line of the table, and then the letters in each following line are shifted to the left by one space. (This is called table traversing, and mathematically each column is congruent to 26.) To use this cipher, you need to use a keyword as the key. The keyword is repeated again each time it is used up. Assuming the keyword is "CAT", the first word of the plaintext is encrypted by "C", the second word is encrypted by "A", the third is encrypted by "T", and then back to C encryption, repeating all the time. Then encrypt according to the password table on the right. For example, when BALL uses CAT as a keyword, it will be encrypted to DAEN. It can be seen that even the same "L" will be encrypted to another letter. In reality, the keywords in the Virginia cipher are very long.
Aperiodic multi-table substitution cipher, which uses a different substitution table (or key) for each plaintext letter, is called a one-time pad cipher, as long as the encryption table is long enough, this is the only theoretically unbreakable password. This kind of cipher can completely hide the characteristics of the plaintext, but it is difficult to be widely used because the required key amount is the same as the length of the plaintext message.
In order to reduce the amount of keys, periodic multi-table substitution ciphers are often used in practical applications. In the 16th century, various multi-table autokey ciphers were used, most notably the Frenchhttp://B.deVigtnère's Vigenère cryptosystem. Well-known multitable substitution ciphers include Vigenère, Beaufort, Running-Key, Vernam, and rotor machine. Ciphertext-only analysis is feasible for single-table substitution and multi-table substitution ciphers. Both single-table substitution and multi-table substitution ciphers use a single letter as the substitution object, and each time multiple letters are substituted is a multi-letter substitution cipher. Around 1854, L.Playfair promoted the Playfair cipher in England, which was invented by British scientist C.Wheatstone. It was the first multi-letter substitution cipher, used by the British in World War I. The advantage of multi-letter substitution is that it is easy to conceal or even out the natural frequency of letters, which is beneficial to resistance to statistical analysis. This kind of password mainly includes Playfair password, Hill password and so on.
By the 1920s, various mechanical encryption devices were invented to handle encryption automatically. Most are based on the concept of a running wheel. In 1918, American EH Hebern created the first rotary machine, which was based on an early typewriter modified with a wired connection to produce a single-alphabet replacement, and the output was through the original light-up instructions. The most famous wheel device is Enigma, which was invented and manufactured by German Scherbius. It was used by the Germans in World War II. However, it was deciphered during World War II.
【Modern Cryptography】
Modern cryptography studies the safe transmission and safe storage of information from the source to the receiver, and is a science that studies "knowing yourself and the enemy". At its core are cryptography and cryptanalysis. The former is committed to establishing a secure password system that is difficult to be broken by the enemy or opponent, that is, "confidant"; the latter strives to decipher the existing password system of the enemy or opponent, that is, "know the enemy". Human recorded communication codes began in 400 BC. The ancient Greeks were the inventors of the permutation cipher. In 1881, the world's first telephone security patent appeared. The invention of the telegraph and radio made cryptography an unavoidable research topic in the field of communication.
In the early days of World War II, the German military used the "Enigma" cipher machine. The Allied forces were unable to do anything about the information encrypted by the German army for several years. The "Enigma" cipher machine seemed unbreakable. However, through the unremitting efforts of the Allied cryptanalysts, the "Enigma" cipher machine was broken, and the Allied forces mastered many secrets of the German army, but the German military knew nothing about it.
During the Pacific War, the U.S. military deciphered the cipher machine of the Japanese Navy, understood the orders issued by the commander of the Japanese fleet Fifty-Six Yamamoto to the commanders, and completely defeated the Japanese Navy at Midway Island, leading to a decisive turning point in the Pacific War. Soon after, Yamamoto Fifty-Six was killed. On the contrary, among the Axis powers, only Germany had a brilliant record in code breaking in the early days of World War II. Therefore, we can say that cryptography plays a very important role in warfare.
Encoding cryptography is mainly devoted to the research of information encryption, information authentication, digital signature and key management. The purpose of information encryption is to convert readable information into unrecognizable content, so that those who intercept the information cannot read it, and at the same time, the receiver of the information can verify whether the received information has been tampered with or replaced by the enemy; digital signatures are information. The recipient can determine whether the received message is indeed from the intended sender; key management is the hardest part of message encryption, because the security of message encryption lies in the key. Historically, the military intelligence agencies of various countries have been more successful in hunting other countries' key management methods than deciphering encryption algorithms.
Cryptanalysis is different from the method of coding. It does not rely on the invariable truth of mathematical logic, but must rely on experience and facts perceived by the objective world. Therefore, cryptanalysis requires the use of people's ingenuity and is more challenging.
Modern cryptography is a rapidly developing applied science. With the rapid popularization of the Internet, people rely on it to transmit a large amount of information, but the transmission of these information on the network is open. Therefore, information related to personal interests must be encrypted before it can be transmitted online, which will be inseparable from modern encryption technology.
In 1976, Diffie and Hellman proposed the famous DH key exchange protocol in "New Directions of Cryptography", which marked the emergence of public key cryptosystem. Diffie and Hellman proposed the key distribution not based on the secret channel for the first time, which is where the great significance of the DH protocol lies.
PKI (Public Key Infrastructure) is a universal security infrastructure that uses public key concepts and technologies to implement and provide security services. The main task of PKI public key infrastructure is to provide digital signature services for open businesses in an open environment.
The popularization of computer and communication systems since the 1960s and 1970s has driven personal demands for digital information protection and various security services. IBM's Feistel started his work in the early 1970s and reached its peak in 1977: his research results were adopted as the US Federal Information Processing Standard for encrypting non-classified information, namely the Data Encryption Standard DES, the most famous cryptographic system in history.
In 1977, the U.S. National Bureau of Standards announced the implementation of the "U.S. Data Encryption Standard (DES)". The monopoly of the military department on cryptography was broken, and civilian forces began to fully intervene in the research and application of cryptography. Civilian encryption products have been sold in large quantities in the market, and the encryption algorithms used include DES, IDEA, RSA, etc.
DES is still the standard method for many financial institutions in the world to conduct secure e-commerce, and it is the most widely used and popular block cipher algorithm in the world so far. However, with the development of computer hardware and the improvement of computing power, DES has become no longer safe. On July 22, 1997, the Electronic Frontier Foundation (EFF) used a $250,000 computer to decipher 56-bit DES in 56 hours. In December 1998, the United States decided not to use DES. The National Institute of Standards and Technology (NIST) has now enabled a new encryption standard, AES, which uses the Belgian research result "Rijndael". The encryption systems used in the above two stages are called symmetric encryption systems, because in these systems, the encryption key and the decryption key are the same, and entering the third stage of the development of cryptography, asymmetric encryption appears. Cryptosystem - public key cryptosystem.
There are tens of thousands of existing cryptosystems, all of which are different. But they can all be divided into private key cryptography (such as DES cryptography) and public key cryptography (such as public key cryptography). The encryption process of the former is the same as the decryption process, and the key used is also the same; in the latter, each user has a public secret key.
【Multi-chain and asymmetric encryption】
Symmetric encryption refers to the use of the same key for encryption and decryption, so it is called symmetric encryption. Symmetric encryption has only one secret key, which acts as the private key. Common symmetric encryption algorithms: DES, AES, 3DES, etc.
Asymmetric encryption means that encryption and decryption use different secret keys, one as a public public key and the other as a private key. Information encrypted with the public key can only be decrypted with the private key. Information encrypted with the private key can only be decrypted with the public key. Common asymmetric encryption algorithms: RSA, ECC.
Asymmetric encryption algorithm requires two keys: public key (publickey) and private key (privatekey). The public key and the private key are a pair. If the data is encrypted with the public key, only the corresponding private key can be used to decrypt it; if the data is encrypted with the private key, only the corresponding public key can be used to decrypt the data. decrypt. Because encryption and decryption use two different keys, this algorithm is called an asymmetric encryption algorithm. The basic process of asymmetric encryption algorithm to realize the exchange of confidential information is: Party A generates a pair of keys and discloses one of them as a public key to other parties; Encrypted and then sent to Party A; Party A then uses another private key saved by itself to decrypt the encrypted information.
On the other hand, Party A can use Party B's public key to sign the confidential information before sending it to Party B; Party B then uses its own private key to verify the data.
Party A can only use its private key to decrypt any information encrypted by its public key. The confidentiality of the asymmetric encryption algorithm is relatively good, and it eliminates the need for end users to exchange keys.
The characteristics of the asymmetric encryption system: the strength of the algorithm is complex, and the security depends on the algorithm and the key. However, due to the complexity of the algorithm, the speed of encryption and decryption is not as fast as that of symmetric encryption and decryption. There is only one kind of key in the symmetric encryption system, and it is non-public. If you want to decrypt it, you have to let the other party know the key. Therefore, to ensure its security is to ensure the security of the key. The asymmetric key system has two keys, one of which is public, so that it is not necessary to transmit the other party's key like a symmetric cipher. In this way, the security is much greater.
In EKT, we use the mechanism of asymmetric encryption and routing strategy combining public and private keys to achieve Byzantine fault tolerance. Our multi-chain of EKT adopts the new scheme of "multi-chain divide and conquer" to redesign a public chain that guarantees the normal operation of each contract. Asymmetric encryption is used to store user information. At the same time, the main chain and sub-chain Information is shared but functionally segregated. This innovation greatly simplifies the architecture, reduces the pressure of data processing, and ensures that the surge of traffic on one chain will not affect the efficiency of the other chain, and any business carried out on the chain will not receive other business interference, effectively Resource isolation is achieved.
In EKT, the Token chain is a parallel multi-chain structure, multi-chain and multi-consensus, sharing the user base. EKT's Token is an attribute on the chain, just like the chain utxo that uses the utxo model has other Tokens, our transfer events are also built-in.
In fact, one of the core problems that EKT solves is that the current difficulty of Dapp development is that if you use Ethereum’s Solidity to develop, you need to learn a whole set of logic in Ethereum, and you need to consider various optimization solutions when developing complex applications. The traditional C/S structure is written in one day, but it may take several weeks to write in Ethereum, which is very unfriendly to developers.
For example, for the C/S model, to write an asymmetric encryption service requires:
1. Design a server that can calculate a pair of secret keys pub/pri. Keep the private key secret and make the public key public.
2. When designing a client to request the server, get the public key pub of the server.
3. The client calculates the symmetric encryption key X through AES. X is then encrypted using pub.
4. The client sends the encrypted ciphertext to the server. The server obtains X through pri decryption.
5. Finally, the communication mechanism between the two sides is designed, and the symmetric key X is used to encrypt and decrypt using the symmetric encryption algorithm.
If this set of procedures is to be written by Dapp/public chain developers, it is bound to consume too much energy and resources by these tedious but common steps before the real development of blockchain functions.
The central idea of EKT is to design a community mechanism, so that developers can easily develop a main chain that can carry DAPP, and the rest is handed over to EKT. EKT's "one chain, one main currency, multi-chain, multi-consensus" mechanism It provides great convenience for the development of subsequent blockchain projects, and can be used in any applicable application scenarios of blockchain. EKT provides a set of underlying blockchain mechanisms, and other blockchain projects can easily deploy their own main chain based on EKT's main chain code. Blockchain projects written on EKT will not need to worry too much about security issues, because each interface is very simple and deployed and run on many parallel main chains. When deploying the main chain, you can flexibly issue tokens of your own main chain and choose a consensus algorithm. The newly deployed main chain can also join the entire ecology of the EKT multi-chain technology, share the user resources of the EKT ecology, and tokens can also be exchanged and circulated with the EKT main currency and tokens of other main chains.
The public key of each node on the EKT main chain is public. This is a solution that balances efficiency, security, and decentralization. Token is now generally defined as a smart contract, but if it is turned into an "object" with pre-defined events, this "object" can have its own parameters (such as total amount, consensus mechanism, etc.), it will bring Better security experience. There are two types of addresses that accept tokens: ordinary user addresses and contract addresses. After receiving tokens, contract addresses can execute non-Turing-complete contract languages for simple state calculations and token transfers.
The above are some of my thoughts on blockchain cryptography, and some considerations on building the bottom layer of asymmetric encryption when designing EKT's multi-chain and multi-consensus. Welcome to ask questions and discuss together.
【Failed SHA-1】
Blockchain players should be very familiar with a word - hash.
Hash, generally translated as "hash" in academia, directly transliterated as "hash" by programmers, its operation is to convert an input of any length (also called pre-mapping pre-image) into a fixed-length output through a hash algorithm , the output is the hash value. This conversion is a compression map, that is, the space of the hash value is usually much smaller than the space of the input, and different inputs may hash to the same output, so it is impossible to determine the unique input value from the hash value. Simply put, it is a function to compress a message of any length into a fixed-length message digest.
All hash functions have a fundamental property: if two hash values are not identical (according to the same function), then the original inputs for the two hash values are also not identical. This property is the deterministic result of the hash function, and the hash function with this property is called a one-way hash function. But on the other hand, the input and output of the hash function are not uniquely corresponding. If two hash values are the same, the two input values are likely to be the same, but they may also be different. This situation is called "hash collision". (collision)", which is usually two input values of different lengths that intentionally compute the same output value. Input some data to calculate a hash value, and then partially change the input value, a hash function with strong obfuscation properties will produce a completely different hash value.
The hash function needs to meet the following conditions:
a. Deterministic: The algorithm of the hash function is a deterministic algorithm, and the algorithm execution process does not introduce any random quantity. This means that the hash result of the same message must be the same.
b. Efficiency: Given any message m, HASH(m) can be quickly calculated.
c. Target collision resistance: given any message m0, it is difficult to find another message m1 such that HASH(m0)=HASH(m1)
d. Generalized collision resistance: It is difficult to find two messages m0 not equal to m1 such that HASH(m0) = HASH(m1).
In cryptography, it is generally believed that if the d condition is not satisfied, then the hash function is no longer safe. In practice, it is generally believed that if the c condition is not satisfied to some extent, then the hash function is no longer secure. Of course, if the c conditions are not satisfied at all, then this hash function is completely insecure and should be discarded directly.
The general practical application of hashing is called Secure Hash Algorithm (English: Secure Hash Algorithm, abbreviated as SHA), which is a FIPS-certified secure hash algorithm and a family of cryptographic hash functions. An algorithm that can calculate a fixed-length string (also known as a message digest) corresponding to a digital message. And if the input messages are different, the probability that they correspond to different strings is very high (it was previously considered to be infinitely close to 99.99999999%, why it was before, explained later).
Cryptography is an ancient discipline with a long and fascinating history. Its use to protect military and diplomatic correspondence dates back thousands of years to ancient times when writing was just being invented. For thousands of years, cryptography has been continuously advancing. Starting from the Caesar cipher, people are also tirelessly cracking the existing cryptographic algorithms when developing new cryptographic algorithms, because for crackers, the higher the difficulty of the password, the greater the value of the secret behind it. The five algorithms of the SHA family are SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512, and the latter can also be collectively referred to as SHA-2, which is established by the US National Security Agency (NSA) Designed and published by the National Institute of Standards and Technology (NIST); is a U.S. government standard. It is also the key gatekeeper of many Internet and electronic products.
The SHA series Hash function family is the most well-known Hash function family. MD5, SHA-1 and SHA-2 have been widely used. Bitcoin uses the SHA-256 hash algorithm belonging to the SHA-2 series. The MD4 algorithm was proposed in 1990, but serious security problems were quickly discovered, and it was replaced by the MD5 algorithm in 1992. The MD5 algorithm was widely used in the software industry for more than ten years. Until 2004, Chinese cryptographer Wang Xiaoyun demonstrated the collision of the MD5 algorithm at the International Cryptography Conference (CRYPTO) and gave the first example. The attack complexity is very low and only takes a few seconds on an ordinary computer. In 2005, Professor Wang Xiaoyun and his colleagues proposed a collision algorithm for the SHA-1 algorithm (Finding Collisions in the Full SHA-1, CRYPTO 2005), but the computational complexity is 2 to the 69th power, which is difficult to implement in actual situations.
Until February 24th of last year (2017), Google released their amazing experimental results-announcing the first example of SHA-1 hash collision. The result of his thesis revision was delayed by 19 hours. Because in simple terms, Google's work basically pronounced SHA-1's death sentence. Before the publication of this work, the certificates of most website https involved the use of the SHA-1 algorithm. Many version control tools including GitHub and various cloud synchronization services used SHA-1 to distinguish files. Many security certificates or Yes signatures also use SHA-1 to guarantee uniqueness. For a long time, people have believed that SHA1 is very safe, at least we have not found a collision case, but now we have to start upgrading to SHA-2 or other algorithms for user safety considerations.
Researchers at CWI and Google managed to find an example of a SHA1 collision, and amazingly, two real, readable PDF files collided. The content of these two PDF files is different, but the SHA1 value is exactly the same.
Why is the publication of this research so compelling? It's because everyone knows that hashing algorithms can have collisions, but as long as the collisions are hard to create, the system underpinned by the hashing algorithm is secure -- and it was previously thought that Collision cases for SHA1 are hard to implement. Google proves that this statement is untenable, especially now that GPU parallel computing is widely used. Google used 110 GPUs, and after a year of calculations, a total of 9 exascale calculations (a total of 9,223,372,036,854,775,808 times) were used to create this collision case-the time overhead of this calculation process is huge, but it is very common now For large-scale computing centers, it is not difficult to achieve. This means that the current implementation of the collision attack on SHA1 still requires a huge amount of computing time.
Although MD5 and SHA-1 are not recommended to be used, it does not mean that they are completely obsolete. In fact, various existing better cryptographic algorithms are established on the basis of old algorithms, and the old algorithm systems are often not abandoned because of inherent loopholes—the rapid development of computing power leads to Our basic algorithm must be continuously improved to adapt to the needs of the production environment while avoiding potential security risks. We must also keep looking at and handling work with the latest vision, pay attention to new technological breakthroughs in a timely manner, and never stick to the rules and stand still. SHA-1 and SHA-2 are two different versions of the SHA algorithm. Their construction and signature length are different, but SHA-2 can be understood as the successor of SHA-1. The SHA-256 used by Bitcoin belongs to the 256-bit usage of SHA-2. When Satoshi Nakamoto wrote Bitcoin in 2008, he never considered that the SHA algorithm could be cracked so quickly, but fortunately, various digital currencies later More and more difficult-to-crack encryption algorithms are adopted. For details, you can read back the series of "How to Encrypt Cryptocurrency" I wrote before. However, judging from the breach of SHA-1 by Google, all cryptocurrencies with huge market capitalization should be alerted, because the maintenance of mutual benefit consensus must still be based on the cornerstone of encryption algorithms.
[The Hidden Worry of Quantum Computing]
But if all existing encryption methods fail, what will the digital currency world look like?
This idea that sounds a bit far-fetched is actually not far away from us. When practical quantum computers appear more than ten years later, and the computing power is greatly improved, the existing asymmetric key encryption methods that rely on mathematical complexity to ensure security are likely to all fail. Academician Guo Guangcan mentioned in his speech that a quantum computer based on 2000qubit can use the Shor algorithm to complete the large number decomposition calculation that the security of the RSA algorithm depends on in 1s.
First, let’s briefly talk about what quantum computing is. A qubit can be prepared in a coherent superposition of two logic states 0 and 1, in other words, it can store both 0 and 1 at the same time. Consider a memory with N physical bits, if it is a classical memory, it can only store any one of 2^N possible data, if it is a quantum memory, it can store 2^N numbers at the same time, and any As N increases, its ability to store information will increase exponentially. For example, a 250-qubit memory (composed of 250 atoms) may store a number up to 2^250, which is more than the number of all atoms in the known universe. need more. Since mathematical operations can be performed on all the data in the memory at the same time, a quantum computer can perform mathematical operations on 2^N input numbers at the same time in one operation. The effect is equivalent to a classical computer repeating the operation 2^N times, or using 2^N different processors to perform parallel operations. It can be seen that quantum computers can save a lot of computing resources (such as time, memory units, etc.).
A quantum computer is not a faster computer. It is fundamentally different from classical computers in terms of logic and output methods, the most essential of which is the existence of quantum entanglement. From the perspective of quantum information science, quantum entanglement is a natural resource alongside matter, energy, and information. Making good use of this resource can make quantum computers exert great power. However, how to use it to design a faster algorithm is a great challenge in theory. At present, for most computing problems, theorists have not found quantum algorithms that surpass classical algorithms; but new discoveries have indeed been made on some special problems. What questions? There are two main types of the earliest discoveries: one can be attributed to prime factorization (Shor's algorithm), which has exponential acceleration (accurately speaking, super polynomial acceleration) than the known fastest classical algorithm; the other can be attributed to unordered search ( Grove's algorithm), which has a polynomial speedup over classical algorithms.
Shor's algorithm and Grove's algorithm were proposed in 1994 and 1996 respectively. It can be said that their discovery has aroused the scientific community's real attention to quantum computing. Although the initial concept of quantum computing has appeared in the early 1980s, more than a dozen For many years it was only a theoretical game in a small circle, which was considered to be neither realizable nor useful; Shor's algorithm and Grove's algorithm finally found a possible practical application for quantum computers. Among them, the impact of Shor's algorithm is particularly great-in modern cryptography, the basic encryption principle of several commonly used public key systems including RSA (Rivest–Shamir–Adleman) and ECC (elliptic-curve cryptography) is that the calculation of large number decomposition is complex Spend. Therefore, once a quantum computer appears, it will pose a huge threat to existing information security, and almost all existing algorithms of cryptocurrencies are vulnerable. By the way, ECC is the encryption method used by Bitcoin.
Michele Mosca, co-founder of the School of Quantum Computing at the University of Waterloo (and a researcher at the Perimeter Institute for Theoretical Physics), reckons that some of the encryption tools we use today will have a 1 in 7 chance of being cracked by 2026; It will rise to 50% again. That is to say, by that time, if we are still using the current encryption mechanism, even if the data transmitted over the network is encrypted, it can be decrypted through brute force cracking-this is also the "convenience" that quantum computing can bring.
【Thinking of EKT】
【Thinking of EKT】
In the 1970s, researchers in British intelligence services and academic institutions independently invented asymmetric encryption methods. It uses two different keys: a public key and a private key. During the encryption of a transaction, both keys are required. For example, when shopping online, the supplier's server sends the public key to the consumer's computer. This key is public and can be obtained and used by all consumers. The consumer's computer encrypts a secret key with this public key, which will serve as a symmetric key shared with the supplier. After receiving the encrypted symmetric key, the provider's server will decrypt it with its own unique private key. Once the two parties securely share the symmetric key, it can be used to complete the encryption and decryption of subsequent transactions.
Asymmetric encryption algorithm requires two keys: public key (publickey) and private key (privatekey). The public key and the private key are a pair. If the data is encrypted with the public key, only the corresponding private key can be used to decrypt it; if the data is encrypted with the private key, only the corresponding public key can be used to decrypt the data. decrypt. Because encryption and decryption use two different keys, this algorithm is called an asymmetric encryption algorithm. The basic process of asymmetric encryption algorithm to realize the exchange of confidential information is: Party A generates a pair of keys and discloses one of them as a public key to other parties; Encrypted and then sent to Party A; Party A then uses another private key saved by itself to decrypt the encrypted information.
On the other hand, Party A can use Party B's public key to sign the confidential information before sending it to Party B; Party B then uses its own private key to verify the data. Party A can only use its private key to decrypt any information encrypted by its public key. The confidentiality of the asymmetric encryption algorithm is relatively good, and it eliminates the need for end users to exchange keys.
In EKT, we use the mechanism of asymmetric encryption and routing strategy combining public and private keys to achieve Byzantine fault tolerance. Our multi-chain of EKT adopts the new scheme of "multi-chain divide and conquer" to redesign a public chain that guarantees the normal operation of each contract. Asymmetric encryption is used to store user information. At the same time, the main chain and sub-chain Information is shared but functionally segregated. This innovation greatly simplifies the architecture, reduces the pressure of data processing, and ensures that the surge of traffic on one chain will not affect the efficiency of the other chain, and any business carried out on the chain will not receive other business interference, effectively Resource isolation is achieved.
In fact, one of the core problems that EKT solves is that the current difficulty of Dapp development is that if you use Ethereum’s Solidity to develop, you need to learn a whole set of logic in Ethereum, and you need to consider various optimization solutions when developing complex applications. The traditional C/S structure is written in one day, but it may take several weeks to write in Ethereum, which is very unfriendly to developers. If this set of procedures is to be written by Dapp/public chain developers, it is bound to consume too much energy and resources by these tedious but common steps before the real development of blockchain functions.
In fact, one of the core problems that EKT solves is that the current difficulty of Dapp development is that if you use Ethereum’s Solidity to develop, you need to learn a whole set of logic in Ethereum, and you need to consider various optimization solutions when developing complex applications. The traditional C/S structure is written in one day, but it may take several weeks to write in Ethereum, which is very unfriendly to developers. If this set of procedures is to be written by Dapp/public chain developers, it is bound to consume too much energy and resources by these tedious but common steps before the real development of blockchain functions.
The token chain is a chain specially used to process token transactions. In view of the various vulnerabilities constantly exposed by ERC20 tokens (although the generation of vulnerabilities is the problem of smart contract developers, we believe that there is a better solution to achieve it) , the token object is built-in on EKT, and developers only need to define the number of tokens they want to send. In addition, EKT's token chain is a multi-chain and multi-consensus structure, which means that different tokens can be packaged on different token chains, and multi-chain parallelism greatly improves transaction processing speed.
The token chain is a chain specially used to process token transactions. In view of the various vulnerabilities constantly exposed by ERC20 tokens (although the generation of vulnerabilities is the problem of smart contract developers, we believe that there is a better solution to achieve it) , the token object is built-in on EKT, and developers only need to define the number of tokens they want to send. In addition, EKT's token chain is a multi-chain and multi-consensus structure, which means that different tokens can be packaged on different token chains, and multi-chain parallelism greatly improves transaction processing speed.
EKT's DApp chain is a chain for different developers to develop DApps. We optimized it from three aspects: smart contract development language, data storage (with Merkle proof and private storage space without Merkle proof), and efficiency. EKT's DApp chain can basically achieve the same or even faster development speed as the current Internet application, and the achievable functionality is not much different from that of the Internet application. Most importantly, we can achieve 1-second execution of most events And confirmation, events with relatively high security requirements can be confirmed in 3 seconds.
The central idea of EKT is to design a community mechanism, so that developers can easily develop a main chain that can carry DAPP, and the rest is handed over to EKT. EKT's "one chain, one main currency, multi-chain, multi-consensus" mechanism It provides great convenience for the development of subsequent blockchain projects, and can be used in any applicable application scenarios of blockchain. EKT provides a set of underlying blockchain mechanisms, and other blockchain projects can easily deploy their own main chain based on EKT's main chain code. Blockchain projects written on EKT will not need to worry too much about security issues, because each interface is very simple and deployed and run on many parallel main chains. When deploying the main chain, you can flexibly issue tokens of your own main chain and choose a consensus algorithm. The newly deployed main chain can also join the entire ecology of the EKT multi-chain technology, share the user resources of the EKT ecology, and tokens can also be exchanged and circulated with the EKT main currency and tokens of other main chains.
When designing the encryption system of EKT, our team also seriously considered the impact of SHA-1 cracking and the development of quantum computing technology on the blockchain world in the future, and even wanted to implement this seemingly fancy function immediately. However, after careful consideration, our team decided to devote the current limited resources to the development of the platform as much as possible. At the same time, several colleagues and I will pay close attention to the progress of cryptocurrency security, and keep up with the latest and most secure ones for reference. New trends in academia.
The above are some of my thoughts on blockchain cryptography, and some considerations on building the bottom layer of asymmetric encryption when designing EKT's multi-chain and multi-consensus. Welcome to ask questions and discuss together.







