In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Second, the difference between RSA encryption and signature
Encryption and signature are for security reasons, but they are slightly different. It is often asked whether encryption and signature are private keys or public keys. In fact, there is some confusion about the role of encryption and signature. To put it simply, encryption is to prevent information from being disclosed, while signature is to prevent information from being tampered with. Here are two examples.
The first scene: on the battlefield, B sends a message to A with a certain instruction.
The encryption process of RSA is as follows:
(1) A generates a pair of keys (public key and private key), the private key is not public, and A keeps it. The public key is public and can be obtained by anyone.
(2) A passes its own public key to BMageB to encrypt the message with A's public key.
(3) A receives the message encrypted by B and uses A's own private key to decrypt the message.
In this process, there are only two delivery processes, the first is that A passes the public key to B, and the second is that B transmits the encrypted message to A, even if it is intercepted by the enemy, it is not dangerous, because only the private key of A can decrypt the message and prevent the disclosure of the message content.
The second scenario: a needs to reply "received" after receiving the message sent by B.
The process of RSA signature is as follows:
(1) A generates a pair of keys (public key and private key), the private key is not public, and A keeps it. The public key is public and can be obtained by anyone.
(2) A signs the message with its own private key, forms a signature, and transmits the signed message to B together with the message itself.
(3) after B receives the message, it verifies the signature after obtaining the public key of A. if the content of the verification is consistent with the message itself, it proves that the message is replied by A.
In this process, there are only two delivery processes, the first is that A transmits the signed message and the message itself to B, and the second time is that B obtains the public key of A, even if it is intercepted by the enemy, there is no danger. Because only the private key of A can sign the message, even if the message content is known, it is impossible to forge a signed reply to B to prevent tampering of the message content.
However, combining the two scenarios, you will find that in the first scenario, although the intercepted message is not leaked, the false instruction can be encrypted using the intercepted public key and then passed to A. Although the intercepted message in the second scenario cannot be tampered with, the content of the message can be obtained by public key verification, which does not prevent disclosure. Therefore, in practical applications, encryption and signature can also be used according to the situation. For example, both An and B have their own public and private keys. When A wants to send a message to B, it first encrypts the message with the public key of B, and then uses the private key of A to sign the encrypted message, so that it can neither disclose nor be tampered with, and can better ensure the security of the message.
Summary: public key encryption, private key decryption, private key signature, public key verification.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.