The theft of the "codebook" in the war movie is serious. Is there such a thing in the blockchain?

Author | Seeds

Production | Vernacular Blockchain (ID: hellobtc)

Xiao Hei and Da Bai just watched "Midway Midway", while they were sitting in the theater lounge and chatting.

"What do you think of the victory of Midway Island, in addition to the bravery of the players?"

Dabai thought for a while, "Well, is that the intelligence department?"

"Yes, the battle on Midway Island is an outright intelligence victory. Fortunately, it happened 36 years ago, when asymmetric encryption technology had not yet appeared, otherwise it was another situation.

After listening to their chat, Xiao Hei became very interested in asymmetric encryption. Today we will talk about what is asymmetric encryption?

Symmetric encryption is also called single-key encryption, which means that the same key is used to encrypt and decrypt information. The disadvantage of symmetric encryption is that the key distribution is difficult, and it is intercepted by the enemy. Just like our house keys, both the lock and the unlock are the same, and if you accidentally stole it, you were hit. "

Asymmetric encryption has a pair of keys, which are a private key and a public key, which are encrypted and decrypted with each other, that is, public key encryption, private key decryption, or private key encryption, public key decryption . The private key needs to be kept secret and kept in a safe place. Only you know it, like a bank password. The public key can be made public, just like our public bank account number.

For example, we now have a pair of keys: a public key and a private key, and we have agreed to meet at Starbucks at 3 pm . I now use your public key to encrypt and get a string of ciphertext, and then hash this ciphertext to get a string of hash values.

I then encrypted the hash with the private key again to get a digital signature. By the way, encrypting with a private key is also called a digital signature, which is different from our electronic signature at the bank counter. After you do this, send you two pieces of information: ciphertext and digital signature.

How can I decrypt it after receiving the information?

First look at the digital signature in the figure below. You can decrypt it with my public key. If it can be decrypted, it means that the information was indeed encrypted by my private key, and it was me and not others. "

Even if someone knows the hash value, it's useless. He doesn't know the original text. The purpose of signing with a private key is to indicate my identity. In daily life, we often use signatures to indicate that I agree to a contract, which is to verify my identity. If this step is gone, just like someone just signed my name on the document, it must be messy.

"Identification is OK, what about decrypting the original text? "

In this cipher text, do you say that no one has tampered with it, after all, who can send messages to me? You hash it once, you get the hash value, and compared with the hash value decrypted by the public key just now, the same is that it has not been tampered with.

The final step is to decrypt the ciphertext with your private key, and you get the original text, and you're done.

In which aspects of life do you think asymmetric encryption will be applied? Welcome to share your views in the message area.



"Disclaimer : This series of content is only for the introduction of blockchain science popularization, and does not constitute any investment opinions or suggestions. If there are any mistakes, please leave a message to point out. Article copyright and final interpretation rights belong to the vernacular blockchain. A