问题描述
假设我们有 Alice 和 Bob.
Say we have Alice and Bob.
Alice 向 Bob 发送了一条她用 Bob 的公钥加密的消息.Bob 是唯一可以使用他的私钥解密它的人.但是他怎么能确定消息来自爱丽丝呢?
Alice sends Bob a message she encrypted with Bob's public key. Bob is the only person who can decrypt it, using his private key. But how can he be certain the message came from Alice?
假设他回复,使用 Alice 的公钥加密他的消息.只有 Alice 可以解密该消息.但她怎么能确定是鲍勃寄来的呢?
Suppose he replies, encrypting his message using Alice's public key. Only Alice can decrypt the message. But how can she be certain it was sent by Bob?
爱丽丝是否必须在她的消息中添加某种公共哈希,以便鲍勃可以说这肯定来自爱丽丝?"
Would Alice have to add some kind of public hash to her message so bob can say "This definitely came from Alice?"
推荐答案
Bob 也有 Alice 的公钥,Alice 用她的私钥签署了消息.Bob 使用 Alice 的公钥来验证签名.
Bob has Alice's public key also, and Alice signed the message with her private key. Bob uses Alice's public key to verify the signature.
Alice 反过来确保消息来自 Bob.
Go in reverse for Alice to ensure the message was from Bob.
您现在要做的就是确保 Bob 拥有 Alice 的真实公钥,而不是中间人注入的公钥.
All you have to do now is make sure that Bob has Alice's real public key and not one injected by a man in the middle.
这篇关于双向非对称加密如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!