You want to send a secret message to your friend Alex in the mail but Sam who is not trusted can open all letters. You can put the message in a box with a lock, but you are not allowed to send any key. In this lock and key puzzle how can you send the message securely so that only Alex can read it?

Difficulty: Medium

Correct Answer: Lock the box with your padlock and send it to Alex, then Alex adds a second padlock and returns the box, after which you remove your padlock and send the box again with only Alex padlock on it.

Explanation:


Introduction / Context:
This puzzle illustrates a physical analogy of public key style communication using only simple locks. The restriction that no key may be sent and that an untrusted person can access all mail makes it impossible to share keys directly. The aim is to find a protocol that uses padlocks in such a way that the box is never unlocked while passing through unsafe hands and yet eventually becomes openable by Alex only.


Given Data / Assumptions:
- You and Alex each have your own padlock and key.- Sam can intercept and open any envelope but cannot pick or break good locks.- The message can be placed in a solid box that accepts one or more padlocks.- Keys are never allowed to travel by mail, so key sharing is not possible.- Padlocks can be added or removed only by the owner of the corresponding key.


Concept / Approach:
The core idea is to ensure that at every stage when the box is in transit it is protected by at least one lock whose key Sam does not have. To do this both parties successively add and remove their own padlocks without ever exposing the contents. This is similar to combining secret operations that commute. Your lock and Alex lock can be applied in either order, and as long as at least one remains, the box cannot be opened by Sam.


Step-by-Step Solution:
Step 1: Place the message inside the box and lock the box with your own padlock. Only you currently have the key to this lock.Step 2: Send the locked box to Alex through the mail. Sam may intercept it but cannot open the box because it is protected by your padlock.Step 3: When Alex receives the box he cannot open it because he has no key for your lock. Instead he attaches his own padlock to the box, so the box is now secured by two independent locks.Step 4: Alex sends the double locked box back to you. Sam still cannot open it because both locks are intact.Step 5: You receive the box and remove your own padlock while leaving Alex padlock in place. Now the box is locked only with Alex lock.Step 6: Send the box once more to Alex. When Alex receives it, he can use his key to remove his padlock and open the box, reading the message while Sam never had a chance to see the contents.


Verification / Alternative check:
At no stage in this protocol is the box unlocked while in transit. Initially it is secured by your lock, then by both locks, and finally by Alex lock alone, but never by zero locks. Because Sam has no key to either padlock, he is never able to open the box at any stage. Both parties only remove their own lock while another lock is still present or while the box is in their direct possession, which keeps the message safe.


Why Other Options Are Wrong:
Option A fails because mailing the key in a separate envelope allows Sam to intercept the key and use it to open the locked box, completely breaking security.Option B is unsafe because the box travels unlocked at least once, which allows Sam to read or replace the message easily.Option D offers no real protection since invisible ink can potentially be discovered and it ignores the requirement to work specifically with the lock and box setup described in the puzzle.


Common Pitfalls:
A common mistake is to assume that keys must somehow be exchanged, which violates the rules of the puzzle. Another pitfall is to forget that padlocks are independent and can be used simultaneously. Recognising that both locks can be placed on the same box and later removed one at a time is the crucial insight that leads to the correct protocol.


Final Answer:
You should lock the box with your padlock and send it to Alex, have Alex add his own padlock and send it back, then remove your lock and send the box again so that Alex can finally open it with his key while Sam never sees the message.

More Questions from Logic Puzzles

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion