阿巴这两天在忙碌中,因为家中增加了一个小千金,还有其他琐事,不过抽空还是要去谈谈自己对于区块链的认识。今天浅浅的谈一下区块链中的加密技术,很多专家认为区块链技术一点都不新颖是因为他们认为区块链技术只是把以前很多已经存在的技术综合在一起了,比如分布式存储、共识机制和密码学,这些技术以前就有,但是有人偏偏把这些技术综合起来创造出了一个甚至可以颠覆时代的技术。
Abba has been busy these past two days, with a small sum of money added to his home and other chores, but he wants to talk about his own knowledge of the chain of blocks. Today, as we speak lightly about encryption in the chain of blocks, many experts believe that the technology of the chain of blocks is not new because they think that it is only a combination of many of the technologies that existed before, such as distribution storage, consensus mechanisms and cryptography, which existed before, but some prefer to combine them to create a technology that could even destabilize the times.
回顾一下,在很久以前,人们还在使用金银作为货币的时候,如果你是山东的商家想去广东批发布匹,这个过程你要把钱从山东转给广东,然后把货从广东运到山东,你需要镖局押镖,耗费人力、物力搬运过去,然后镖局再回来。大资金的跨区域支付,需要镖局,拉着马车一堆堆的金银。人们发现金银货币携带确实不方便,后来出现了纸币,伴随纸币的出现产生了银行,伴随着互联网的发展,纸币数字化可以使用手机银行或网上银行实现转账,这个时候银行替代了以前的镖局,但银行需要大量的人力,不过比以前的镖局节约了很多成本,也快捷了许多。随着时间的推移,人们转账不再是单单的国内转账,需要跨国转账了,因为世界化的进程日益加快,然后通过银行跨国转账需要较长的时间。那么区块链技术的诞生,有可能会去掉银行这个中介,因为它提高了效率。如同银行替代镖局一样。
A long time ago, when you used gold and silver as a currency, if you were Shandong's businessman to go to Guangdong for distribution, the process was to transfer the money from Shandong to Guangdong, then to transport the goods from Guangdong to Shandong, and you needed a dart guard, labour and material handling, and then the dart. The bulk of the money was paid across the region, requiring a dart, pulling a pile of gold and silver. People discovered that it was difficult to carry the money and money, and then came up with paper and currency, leading to banks on the Internet, and that the digitalization of the bank could use mobile or online banks to transfer the money, and that the bank would replace the previous darts at that time, but the banks would need a lot of manpower, but much more cost savings than the previous darts, and much faster than the previous ones. Over time, people would need more than domestic transfers, because the process of worldwideization would be accelerated, and then it would take longer through cross-country bank transfers.
所以阿巴认为区块链技术真有可能改造一个时代,这仅仅是其在金融领域的运用。一个发明若要被社会认可,必须可以节约人力,提高效率。比如蒸汽机的发明、电力的发明以及互联网的诞生,这些都大大的提高了社会效率,解放了人力。同样区块链是一个方向,它可以节约人力,当然目前它的效率并不乐观,比中心化的处理速度确实慢多了。
So Abba believes that block chain technology has the potential to transform an era, which is only its use in the financial field. An invention, if it is to be accepted by society, must save manpower and improve efficiency.
对于这个技术我们继续一点点的剖析……
We're going to continue with a little bit of analysis of this technology.
前面阿巴已经浅谈了分布式存储和共识机制,在公众号前面有记录,今天我们去谈谈密码学,其中最为熟悉的就是大家经常接触的私钥、公钥和钱包地址。
Abba has already spoken of distributional storage and consensus mechanisms, and there are records in front of the public number, and today we are talking about cryptography, the most familiar of which is the private key, the public key and the wallet address that you frequently contact.
区块链中使用了很多加密学算法,包括哈希算法、默克树、数字签名等。
Many encryption algorithms are used in block chains, including Hashi algorithms, Merck trees, digital signatures, etc.
这些是什么鬼?搞得好复杂,小白如何去理解呢?
What the hell is this? It's complicated. How does White understand it?
主要谈谈哈希算法和数字签名,简单看完其实就懂了。
Mainly about Hashi algorithms and digital signatures, a simple reading would actually make sense.
首先哈希算法是一种常见的单向加密算法,它将一串数据加密生成一串二进制,但不能由二进制还原为原来的数据。
First of all, the Hashi algorithm is a common one-way cryptography algorithm that generates a string of data encryption into a binary system, but cannot be reduced from binary to original data.
这个可以简单理解为你把一个文件转化成一个压缩文件格式然后发送给别人,或者可以理解为把一段文字通过二维码压缩软件合成了一个二维码。这个上网百度一下二维码生成器,可以把自己想要表达的文字合成为二维码。这个转化的过程可以理解为哈希算法,当然哈希算法要比这个复杂多了,哈希算法长度都为64,即256长度的比特位。
This can be understood as a simple translation of a document into a compressed file format and then sent to others, or as a synthesis of a text into a two-dimensional code in a two-dimensional compression software. This web-based two-dimensional generator can synthesize the text that you want to express into a two-dimensional code. This conversion can be understood as a Hashi algorithm, which is, of course, much more complicated than that, with a 64-dimensional length, or a 256-length bit.
(这个是阿巴随便百度了一个二维码生成器,把你肉眼可以看懂的军戎阿巴几个字合成了二维码)
This is a two-dimensional generator of Abba, synthesizing the two-dimensional words of Aba, which you can read with your eyes.
接下来是重点喽,就是数字签名,其中比较重要的就是公钥和私钥,这个我们经常听说,也经常使用。
And here's the point: digital signatures, the most important of which are public and private keys, which we often hear and use.
前面发布的区块链100问中第21集讲过这个问题,可以参考下比特币的数字签名,阿巴发个1分钟的短视频辅助理解。
This issue was addressed in the earlier issue of the block chain in question 100 in the 21st episode, which can be read in conjunction with the digital signature of the bitcoin below, accompanied by a one-minute video from Abaf.
看完视频,应该理解到数字签名是由数字摘要和非对称加密技术组成。数字摘要比较简单,就是把交易信息压缩成固定长度的字符串;这里再去谈谈非对称加密技术。
After reading the video, it should be understood that digital signatures are made up of digital summaries and asymmetric encryption techniques. Digital summaries are relatively simple, that is, strings that compress transaction information into fixed lengths; here we talk about asymmetric encryption techniques.
数字签名使用了公钥密码学,公钥密码学是非对称加密技术。非对称加密技术是相对于对称加密技术存在的。那么什么是对称加密技术呢?
Digital signatures use public key cryptography, which is asymmetric encryption technology. Asymmetric encryption technology exists relative to symmetric encryption technology. What is symmetric encryption technology then?
在对称加密技术中使用相同的密钥加密和解密数据,为了让对方能够解密,需要同时将密文和密钥发给对方。
The same key encryption and declassification data are used in symmetric encryption techniques and, in order to enable each other to decipher, both the message and the key need to be sent to the other.
(图片来源于简书由flingjie创作)
(pictures from a short book by flingjie)
如果有人在传输过程中截取了密文和密钥,就一样能解密出明文,这就导致了安全性问题。
If someone intercepts the message and the key during the transmission, it can be deciphered as well, which leads to a security problem.
在非对称加密中有公钥和私钥两个,公钥用来加密,私钥用来解密,公钥可以发给任意的人。
There are two public keys and a private key in asymmetric encryption, the public key for encryption, the private key for decrypting, and the public key can be sent to any person.
在这个过程中只有私钥才可以解密,而加密用的是公钥,故不需要传输私钥,只要保证私钥放在安全的地方,被盗取后其他人还是无法破解密文。
Only private keys can be decrypted in this process, while public keys are used for encryption, so there is no need to transmit private keys, as long as the private keys are located in a secure place, and it is still impossible for others to decipher them after the stolen keys.
而数字签名就是基于上述非对称加密技术,不同点在于数字签名使用私钥生成一个签名,接收方使用公钥进行校验。比如上面用私钥解密得到明文后,用私钥进行签名进行回复,收到回复后用公钥解密得到的内容与数据相同即可证明签名正确。
The digital signature is based on the asymmetric encryption technique described above. The difference is that the digital signature uses a private key to generate a signature, and the recipient uses a public key for verification. For example, when the private key is declassified above, the private key is used to respond to the signature, and when the reply is received, the same content as the data obtained by a public key deciphers the signature.
因为公钥和私钥是成对的,也就是公钥和私钥是一对孪生兄弟,唯一对应的,私钥只有对方拥有,所以对方也不能对签名进行抵赖。
Because the public and private keys are paired, i.e. the public and private keys are twin brothers, the only correspondence is that the private key is owned only by the other party, and the other party cannot deny the signature.
私钥是一串很长的字符串,拥有钱包其实就是拥有私钥,这是对一个加密货币地址拥有最高取钱权限的代表,掌握了私钥就掌握了其对应加密货币地址上的所有生杀大全,每次交易的时候,付款方必须出具私钥产生的签名,每次交易签名不同,由同一个私钥产生。
The private key is a long string and the wallet is in fact a private key, a representative with the highest power to collect money for an encrypted currency address, having the private key in his possession and all the vitals on his corresponding encrypted currency address. At the time of each transaction, the payer must produce the signature generated by the private key, and the signature of each transaction is different and generated by the same private key.
所以私钥很重要!!!
So the private key is important!
私钥、公钥和钱包地址的关系是由私钥产生公钥,由公钥根据哈希算法产生钱包地址。所以钱包地址一旦生成,私钥是更改不了的,也就是密码是不能更改的,否则钱包的地址就变了。私钥可以对应一个地址;私钥也可以对应多个钱包地址,如同一个人可以有多个银行卡密码一样。
The relationship between the private key, the public key and the wallet address is a private key that generates the wallet address according to the Hashi algorithm. So once the wallet address is created, the private key cannot be changed, i.e. the password cannot be changed, otherwise the wallet address can be changed. The private key can correspond to one address; the private key can correspond to multiple wallet addresses, just as a person can have multiple bank card passwords.
私钥是黑客基本破解不了的,比银行的密码安全等级高十万八千里。每个私钥至少35个字符以上,可以举例说明:私钥是2的256次方的长度函数计算出来中的一个,你要破解别人钱包的私钥,需要在2的256次方中找到一组正确的数字匹配,难度多大?一根头发丝是不是很小,但一根头发是由很多原子组成的,地球是九大太阳系的一支,太阳系是是几千亿银河系的一支,银河系是2万多亿的宇宙中的一支,科学计算整个宇宙中有10的80次方个原子。对比一下私钥2的256次方=10的77次方,和宇宙中找到一模一样原子的难度差不多。所以私钥很难被破解的。
The private key is basically unbreakable by hackers. It's 100,000 miles higher than the bank's password security level. There are at least 35 characters per private key, for example: the private key is one of a length function of 256 out of 2, and you need to find a correct number match in 256 out of two. A hair thread is small, but a hair is made up of many atoms, the Earth is one of the nine largest solar systems, the solar system is one of hundreds of billions of galaxies, one of more than 2 trillion universes, and the science calculates that there are 10 80 square atoms in the universe. A comparison of 256 out of 2 private keys = 77 out of 10, is similar to the difficulty of finding the same atom in the universe.
那么为什么有的人钱包里面的资产被人盗走了,只有一种可能——私钥被盗,不是被黑客破解。也就是你储存在了电脑上或者手机上,黑客通过这个知道了你的私钥,从而盗走了你的钱包资产,所以保护好自己的私钥至关重要。
So why are the assets in someone's wallet stolen, and there's only one possibility -- that the private keys are stolen, not broken by hackers -- that you store them on a computer or on a cell phone, and that hackers steal your wallet's assets by knowing about them, so it's vital to protect them.
阿巴总结:区块链技术被人认可的根源——分布式存储(去中心化)是基本的前提,因为它去掉了中介;共识机制是核心,因为它实现了在没有中心的分布式网络中统一思想达成共识;加密技术是保障,因为加密技术实现了交易信息的安全。
Abba concluded that: the root cause of recognized block chain technology — distributed storage (decentralization) — is a basic prerequisite, as it removes intermediaries; the consensus mechanism is the core, because it achieves a common understanding of ideas in distributed networks where there is no centre; the encryption technology is a guarantee because encryption technology secures transactional information.
注册有任何问题请添加 微信:MVIP619 拉你进入群
打开微信扫一扫
添加客服
进入交流群
发表评论