众所周知,比特币等加密货币的快速发展,离不开去中心化的区块链,而区块链的发展一样离不开加密技术帮助。那么今天我们就来了解一下区块链中的那些加密技术。
As we all know, the rapid development of encrypted currencies, such as bitcoin, cannot be achieved without decentralizing the chain of blocks, which, like the development of blocks, can be helped by encryption technology. So today, let's look at the encryption techniques in the chain of blocks.
常用的哈希算法有MD5、SHA256和RIPEMD等。在区块链中很多地方用了哈希算法,比如对区块计算哈希值、区块和交易的完整性验证等等。
The usual Hashi algorithms are MD5, SHA256 and RIPEMD.
对称加密技术
symmetrical encryption techniques
对称加密技术是采用同一个密钥,然后使用加密算法对输入的信息进行加密,得到加密后的数据。之后,采用相同的密钥进行逆运算,可以得到原始的输入值。
Symmetric encryption is the same key that is used to encrypt the input information and obtain the encrypted data using the encryption algorithm. After that, the same key is used to reverse the calculation and the original input value is obtained.
它的特点是使用的密钥只有一个,发收信双方都使用这个密钥对数据进行加密和解密,要求解密方事先必须知道加密密钥。
It is characterized by the fact that there is only one key used, and both send and send messages use this key to encrypt and declassify data, requiring the decipherer to know the encryption key in advance.
如果有人在传输过程中截取了密文和密钥,就一样能解密出明文,这就导致了安全性问题。目前区块链领域最常用的对称加密算法是AES、PBKDF2和SCRYPT。
If someone intercepts a message and a key during a transfer, it can be deciphered, which leads to a security problem. The most common symmetric encryption algorithms in the block chain area are AES, PBKDF2 and SCRYPT.
非对称加密技术
asymmetric encryption techniques
非对称加密技术需要两个密钥:公钥和私钥。公钥与私钥是一对,私钥可以推导出公钥,而公钥不可以推导出私钥。如果用公钥对数据进行加密,只有用对应的私钥才能解密;如果用私钥对数据进行加密,那么只有用对应的公钥才能解密。简单的说是“公钥加密,私钥解密;私钥加密,公钥解密”。
Asymmetric encryption requires two keys: public and private keys. Public and private keys are a pair, private keys can be derived from public keys, and public keys cannot be derived from private keys. If public keys are encrypted, only the corresponding private key is used to decrypt the data; if private keys are encrypted, only the corresponding public key is used to decipher the data. Simply put, "Public key encryption, private key decryption; private key encryption, public key decryption".
在区块链中,数字签名就是基于上述非对称加密技术,不同点在于数字签名使用私钥生成一个签名,接收方使用公钥进行校验。比如用私钥解密得到明文后,用私钥进行签名进行回复,收到回复后用公钥解密,得到的内容与数据相同即可证明签名正确。
In block chains, digital signatures are based on the asymmetric encryption technique described above. The difference is that digital signatures generate a signature using a private key and the recipient uses a public key for verification. For example, when a private key is declassified, a private key is used to respond to the signature, and when a reply is received, a public key is used to decipher the signature, which is the same as the data.
因为公钥和私钥是成对的,唯一对应的,私钥只有对方拥有,所以对方也不能对签名进行抵赖。
Since the public and private keys are paired, the only correspondence is that the private key is owned only by the counterparty, the counterparty cannot deny the signature.
在区块链技术中常见的签名算法是椭圆曲线加密技术。其算法用对椭圆曲线上的点进行加法或乘法运算来表达。
The signature algorithm that is common in block chain technology is the elliptical curve encryption technique. Its algorithm is expressed by adding or multiplying points on the elliptical curve.
区块链中私钥是一个随机数,通过椭圆曲线签名算法生成公钥。但反向从公钥计算出私钥几乎是不可能的。椭圆曲线签名算法还具有安全性高和存储空间占用小的特点。
The private key in the block chain is a random number that generates the public key through the elliptical signature algorithm. However, it is almost impossible to calculate the private key in reverse from the public key. The elliptical signature algorithm also features high security and low storage space occupancy.
免责声明:素材源于网络,如有侵权,请联系删稿。
Exempt declaration: material originating from the Internet, please contact deleted if violation occurs.
注册有任何问题请添加 微信:MVIP619 拉你进入群
打开微信扫一扫
添加客服
进入交流群
发表评论