Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the difference between public key and private key in Linux

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail what is the difference between public key and private key in Linux. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

Segment 1. SpongeBob has two keys, one is SpongeBob's public key and the other is SpongeBob's private key.

Segment 2. SpongeBob went to the key store by making copies of the same public keys and giving them to his good friends Pai Daxing and Brother Octopus each.

Segment 3. Pai Daxing is going to write a secret letter to SpongeBob. In order to prevent the letter from being intercepted and seen by others. It decides to encrypt the contents of the letter with the public key given by SpongeBob after writing the letter, and the encrypted content of the letter can only be unlocked through SpongeBob's private key. Secrecy can be achieved in this way.

Segment 4. After receiving the letter, SpongeBob decrypts the letter with its own private key and can see the contents of the letter. This letter is safe, even if it falls into someone else's hands, it cannot be decrypted without SpongeBob's private key.

Segment 5. SpongeBob replied to Pai Daxing and decided to use a "digital signature". The message content after it is written uses the one-way Hash function to generate the summary of the letter.

Digital signature: also known as "public key digital signature", is a method similar to the ordinary physical signature written on paper but using the technology in the field of public key encryption to identify digital information. Digital signature is the application of asymmetric key encryption and digital digest technology.

Digital summary: refers to turning a message of any length into a fixed-length short message, which is similar to an independent variable that is a function of the message, that is, the Hash function. Digital abstract is to use one-way Hash function to encrypt plaintext "abstract" into a fixed length (128bit) ciphertext, which is also called digital fingerprint, it has a fixed length, and different plaintext summary into ciphertext, the results are always different, and the same plaintext summary must be consistent.

Segment 6. SpongeBob then encrypts the digest with its own private key to generate a "digital signature".

Segment 7. SpongeBob attached this signature to the bottom of the letter and sent it to Pai Daxing.

Segment 8. After Pai Daxing received the letter, he took off his digital signature and decrypted it with SpongeBob's public key to get a summary of the letter. This proves that this letter is indeed sent by SpongeBob.

Segment 9. Send the big star to use the same one-way Hash function for the letter itself, and compare the result with the summary just decrypted. If the two are consistent, it proves that the content of the letter has not been modified by others.

Segment 10. Under special circumstances, Brother Octopus wanted to deceive Pai Daxing. He secretly generated his own "Octopus Brother Public key" and replaced Pai Daxing's "SpongeBob Public key". At this time, the transferred Pai Da Xing actually has "Brother Octopus's public key, but it is not aware of it." therefore, Brother Octopus can pretend to be SpongeBob, make a "digital signature" with his own private key, and write to Pai Big Star to decrypt it with a fake SpongeBob public key. Pai Daxing thought the letter was written by SpongeBob because the decryption went smoothly.

Segment 11. Later, Pai Daxing felt more and more wrong and found that he was not sure whether the public key he was using really belonged to SpongeBob. So it came up with an idea: ask SpongeBob to go to the "certificate authority" (CA) to authenticate the public key. The Certificate Authority uses its own private key to encrypt SpongeBob's public key and some related information to generate a "digital certificate".

Segment 12. After SpongeBob gets the digital certificate, he can rest assured. Write to Pai Daxing later, as long as you sign and attach the digital certificate at the same time.

Segment 13. After sending a big star to receive the letter, use CA's public key to unlock the digital certificate to get SpongeBob's real public key, and then use SpongeBob's public key to repeat step 9 to verify the digital signature to verify whether the letter was really written by SpongeBob.

This is the end of the article on "what is the difference between public key and private key in Linux". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report