Courses giving introduction to cryptography often refer to an example where Alice and Bob need to communicate through an evil postman, and dispose each of a lock, its key and a box in which to send the message.

The solution then given is that Alice puts her message in the box, locks it with her lock, sends her to Bob, who adds his lock on top, sends it to Alice, who removes her lock, and sends it to Bob who can then remove his own lock.

Why this complexity, can't just Bob send his lock to Alice, who can use it to lock the box and send it back to Bob ?

I'm of course also interested to how this simple example relates to real algorithms (rsa, dh, ...). In other words, if you were to ask this question as a teacher to a class and someone gave the second answer, how would you react to guide to the first solution ?

  • I don't think your box/lock passing sequence is correct. And I think you've skipped over the step that the first thing that gets passed is a key to encrypt the message and not the message itself. I'm guessing what you want to know is why the message can't be encrypted with RSA keys and why a symmetric key is required. We have Q&As here on that topic.
    – schroeder
    Nov 15, 2022 at 7:28
  • I'm talking about asymmetric encryption. This example story shows how DH works, by using the commutativity of encryption operations (g^ab=g^ba). I have an example of that story explained here, in french, but google translate should do fine (see gif image). My question is why, instead of using this asymmetry of operations, can't bob just send the lock to alice, so that alice can send the box locked with bob's key. Setting aside MITM & signatures, which aren't addressed in DH either.
    – greg27
    Nov 15, 2022 at 8:47
  • Ok, you changed the link. Now there is that story, but look at the RSA and DH examples below it: that complexity isn't reflected in RSA or DH. The riddle of Tristan and Iseult is just that, a riddle. It doesn't describe any algorithm. And the link explains that. The riddle inspired key exchange mechanisms. So, this question is based on a faulty premise and can't be defended using established algorithms.
    – schroeder
    Nov 15, 2022 at 8:56
  • In both DH and RSA, Bob and Alice send keys which are used to lock the box, which is sent back. Which is what you propose.
    – schroeder
    Nov 15, 2022 at 9:01


Browse other questions tagged .