|
回复 #127 bacchusluo 的帖子
No problem; the objective is to secure data transmission, so you only want the intended person to receive it. For this reason, the message is encrypted using that persons public key, and the receiver decrypt the message using his/her private key.
This is different from Digital Signature, where the message hash is encrypted with the sender's public key.
Public key encryption is a technology. It can be applied for different purposes. In the question, the purpose is to secure data trasmitted over a network, so the objective is confidentiality / privacy, so you use the intended receiver's public key to encrypt, making sure that only the receiver can decrypt.
For ensuring authentication and integrity, the objective is to prove that you send the message and the message has not been altered. In that case, the message hash (not the message itself) is encrypted using the sender's private key.
To achieve authentication and integrity, as well as confidentiality, then you apply the two together:
1, encrypt the message hash using the sender's private key - to prove that you send the message and no one has altered the message; AND
2, encrypt the message and the digital signature using the intended receiver's public key, so that only the receiver can decrypt it.
Be clear of the objective that you want to achieve, then apply the technology. |
|