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 ?