# Challenge for lovers

Jane and Mike have fallen in love, and Mike wishes to send her a ring via mail. Unfortunately they live in Kleptopia where anything sent by mail will be stolen unless it is in a padlocked box. The two of them have many padlocks, but none to which the other has a key. How can Mike get the ring safely to Jane?

• But the key would still be stolen. Then how will Jane open the box? – Devsman Mar 30 '16 at 16:31
• Is there anything in this puzzle that prevents Mike from driving the key over to Jane the next time they meet? I mean, he still mails her the ring in the padlocked box, she just can't open it until he gets there too. – Bradley Uffner Mar 31 '16 at 13:29
• Easy: send the ring in a padlocked box. The padlocked box isn't in a padlocked box, so it gets stolen, but the ring doesn't, so just the ring arrives. =P – Mike Kellogg Mar 31 '16 at 16:51
• @MikeKellogg I see what you did there ;) – cst1992 Mar 31 '16 at 19:45
• Does Alice and Bob... sorry, Jane and Mike... have a second channel of communication where they can exchange information in a safe manner? If not, the problem is entirely unsolvable because a Man in the Middle can impersonate Jane entirely. There is no difference between Jane and the MitM as far as recipients go. Jane and Mike need a secure channel or a previously agreed-upon shared secret, otherwise this problem is unsolvable. – MichaelK Apr 4 '16 at 10:38

Solution:

Mike sends a box with the ring locked with the padlock.
Jane attaches her padlock to the box and sends it back to Mike.
Mike removes his padlock and sends the box back to Jane.
Jane removes the padlock and opens the box. She gets the ring and hopefully says "Yes".

• couldn't type fast enough! +1 – John Mar 30 '16 at 14:33
• +1 for Public-key cryptography – Lacklub Mar 30 '16 at 14:37
• @Lacklub. Your link talks about Bob and Alice. the question is about Mike and Jane. Totally different things I might say. – Marius Mar 30 '16 at 14:41
• This only works if Mike can recognize Jane's lock, if no one else in Kleptopia has any padlocks, or if packages are guaranteed to arrive at their destination. – Shufflepants Mar 30 '16 at 19:14
• and here's me thinking that only one padlock could be put on at one time ... snore! – Lamar Latrell Apr 4 '16 at 3:41

He can't.

The commonly-accepted answer was provided by Marius, and looks good on the surface. But consider that Kleptomaniacs are smart. Klep Kleppington III -a particularly wily kleptomaniac- could intercept the package and place his own padlock on it and send it back to Mike under the pretense that it is Jane's padlock.

Mike, not foreseeing this kink in his plan, then removes his padlock and unwittingly delivers the package back to Klep, who simply removes his own padlock and takes the ring for himself.

• Comments are not for extended discussion; this conversation has been moved to chat. – user20 Apr 1 '16 at 18:41
• Ahh this is the man in the middle attack, and why we need to have CAs. That makes sense – Justin Apr 2 '16 at 15:03
• He can, see my answer. – user9771 Apr 3 '16 at 20:34
• What if another MITM is like, heck I'll put 4 padlocks?! Then let the guessing game begin... hehehe – Joe DF Oct 8 '19 at 20:53
• How about you ask Jane if she received the first sending and if she put a lock on it? That way you know if thereâ€™s 2 locks, one is yours, and the other hers. – Cotton Headed Ninnymuggins Jul 10 '20 at 16:41

This is just a visual representation of @Marius answer ;)

• Uhm... I think that @Marius was waiting for that green thick, at least since 3 puzzles ago! – Narmer Mar 30 '16 at 14:48
• Neh. Don't worry. Nice drawing. you deserve it. – Marius Mar 30 '16 at 14:50
• This only works if mike can recognize what Jane's lock looks like or if no one else in Kleptopia has any locks. – Shufflepants Mar 30 '16 at 19:11
• @Shufflepants Nope, every box that is padlocked can't be stolen. Intercepting and trying to open a box without your name on it can be considered stealing. This doesn't apply in real life, but the specifications are clear enough.. – Narmer Mar 31 '16 at 7:58
• @Narmer How does attaching your own lock to the box, returning it to sender and then delivering the empty box qualify as stealing the box? If it does, the question should really be more specific in this instance to rule such things out. Perhaps instead of "boxes cannot be stolen" it should be "boxes are guaranteed to arrive at their destination". But even then, what does Mike do if he gets the box back and there are 3 locks on it, his and 2 others? Seems like the question should also say that no one besides Mike and Jane even have locks. – Shufflepants Mar 31 '16 at 14:11

Cheap alternate solution: Mike closes the padlock through the ring's hole and sends it to Jane. She won't be able to actually wear the ring until they meet up in person and Mike can re-open the padlock with his key, but she will nonetheless have the ring.

Whether this is an actual solution depends on (a) how loosely you interpret the goal "get the ring safely to Jane" and (b) whether a Kleptopian thief would steal a padlocked ring, knowing they would have to ruin the ring to get it free of the padlock.

• Assumption b is tricky because the OP explicitly states items must be in a padlocked box – cr0 Mar 31 '16 at 13:52
• Assumption (b) is also false, as it is imminently possible to hacksaw or bolt-cut through the limb of a padlock. But that fact obviates the entire thought experiment, so it should probably be discounted in the context of the question. – S. G. Mar 31 '16 at 20:02
• @S.G. yeah, exactly; we must assume that these are somehow thief-proof padlocks, unless there's something special about padlocked boxes in particular that deters theft. Maybe the Kleptopian postal system sends lots of dummy boxes containing worthless junk around to make random box theft unprofitable? – DSimon Apr 1 '16 at 14:08
• Assumption b doesn't really matter. If all you have to do is get it to Jane still locked, then just send it in a padlocked box as usual. Obviously this is not the intent of the puzzle, though (assumption a). – Set Big O Apr 1 '16 at 16:21

Instead of sending the ring as @Marius describes, Jane sends one of her unlocked locks to Mike using that method instead. Mike then uses Jane's lock to lock the lock-box containing the ring and sends it to Jane. Example:

Jane sends a box containing lock1 secured by lock2 to Mike.

Mike sends the box back now secured by lock2 and lock3 to Jane.

Jane removes lock2 and sends it to Mike.

Mike removes lock3 and uses lock1 to secure the ring in a lock-box and sends it to Jane.

This would prevent the ring from being stolen. Obviously this could lead to an infinite loop of the thief stealing Jane's locks, but the ring is never stolen. Maybe after a few locks are stolen, the thief gives up since he is only getting locks. Or maybe Jane puts a venomous snake in the box, knowing Mike is a trained snake handler ;-)

Assuming that Mike has a padlock to which Jane has a key: Mike uses one of his padlocks to lock the lid of the box to Jane's padlock. He then uses another one to lock the box base to Jane's padlock. Jane can now open the box by opening her padlock, thus disconnecting the two Mike-padlocks (which are still attached to the lid/base respectively).

EDIT: This approach is actually used in real-life scenarios where multiple persons must have access to something without sharing a key: They each provide a padlock, and the padlocks are chained together, ultimately connecting the two parts that must be locked together. http://www.spurgeonworld.com/blog/archives/2006/12/daisy_chains.html

• If Mike has a padlock to which Jane has a key, why doesn't he just lock the box with it? – Mad Physicist Apr 4 '16 at 4:17

Devsman's answer is wrong. It is possible to send Jane the ring by following these steps:

1. Mark sends a padlocked box and a message asking Jane a question only they know the answer to, along with these instructions.
2. Jane keeps the box and sends the answer of the question to Mark if and only if she got the box. (Mark now knows Jane has a box, but we can't be sure that it's the right box)
3. Mark sends the key to the padlocked box to Jane
4. Jane uses it to open the padlocked box that she kept.
5. Inside, she finds a second key and a message that Mark had written, containing the answer to the question (to confirm it's his box), and a second question
6. Jane answers the second question, only if Mark's answer to the first question was right.
7. Mark checks the answer, and can be sure that Jane and no one else now has one of his keys. All he has to do is to send the ring in a box locked with that key.

To stop Klep from re-sending the second question as a second try to the first question, they agree that the first question must always have a certain topic (about Jane's life, for example) and the second question must be about a different topic (about Mark's life, for example).

(Kleptomaniac could replace the instructions, but we'll assume that Jane would be smart enough not to answer a personal question through mail for no good reason).

In summary:

M â†’ J: Question A, Instructions and Box A (containing key B, answer to the question A and question B)
J â†’ M: Answer to the Question A if she got the box
M â†’ J: Key A
M â†’ J: Box B (containing ring) if answer B is correct

Question A is always about Jane's life
Question B is always about Mark's life

• They have at least two secrets they share (they are lovers)
• Locked boxes cannot be duplicated, like packets on the internet could
• What if Kleptomaniac(K) steals the message in step 1? Jane(J) receives the box from Mike(M), but receives no message. Jane does not know to respond with an answer, therefore step 3 onward do not occur. M--> J (Locked box) and M-->K (message). Mike still has the ring and Jane has a useless box. – Matthew0898 Apr 3 '16 at 21:26
• @Matthew0898: your comment gives a way for K to block the exchange from working, but not a way for K to steal the ring. – Peter LeFanu Lumsdaine Apr 3 '16 at 21:37
• If Klep copies the instructions and replaces the box with a box with Kleps question, then it is not true that M knows J has M's box. Klep replaces M's key and the passphrase from J with the passphase Klep got out of M's box using M's key. – Ole Tange Apr 3 '16 at 22:41
• I don't see how step 3 would work. If he sends the key and it's not inside a locked box, the key will be stolen..? – user1429080 Apr 4 '16 at 7:56
• Updated steps 1.5 The middleman keeps Marks box and sends Jane a decoy box and the letter 3.5 Mark sends the key but middleman gets it first. 4.The middleman uses it to open the padlocked box that they kept. 6.The middleman sends the passphrase back to Mark. – ponsfonze Apr 4 '16 at 10:23
1. Jane sends a box with her padlock attached to only the top (lid) hole.
2. Mike receives the box, inserts the ring into the box.
4. Sends to Jane, who undoes her lock and wears the ring. But probably wondered why he proposed over the phone, and tells him they should move in together at safe town.

Most efficient I reckon.

• How does Mike know it's Jane's padlock that's on the box? Maybe Klep intercepted the box and sent another box with one of his padlocks? – user9771 Apr 4 '16 at 22:47

Jane sends her padlocked box with the key taped on it. She makes a duplicate key for herself. Klypto won't stole it because it's empty right ? So Mike puts the ring in the padlocked box and make sure he doesn't sends the key with it. Jane can open it since she has a dupilcate key. :)

• This does not work, because KKIII could take the key, make a copy for himself, then replace the original and send it on. – Code Whisperer Apr 1 '16 at 14:28
• KKIII not only could take the key, but will. – Devsman Apr 1 '16 at 19:53

Alternative solution:

Mike has a padlock which has a number combination. He sends the padlocked box to Jane and calls her to tell her the combination.

Edit

If they have met before and he just wishes to send the ring via mail then they have already agreed identifying passwords in person, ensuring no Man in the middle can fake it.

• KKIII would be able to evesdrop on the call. – Code Whisperer Apr 1 '16 at 14:28
• @itcouldevenbeaboat Doesn't matter - they are lovers - they will, at some point, be in a position to share a secret with eachother. Once that single secret has been established, they can use that secret to exchange information forever. – corsiKa Apr 1 '16 at 15:33
• He sends the padlocked box to Jane and calls her to tell her the combination AFTER she has confirmed she has received it. – Ole Tange Apr 2 '16 at 3:32
• @OleTange Someone could have replaced the box. – user9771 Apr 3 '16 at 20:37
• @Runemoro Yes, and then the code would not work. KKIII cannot listen in as they use Signal Private Messenger for the call. So KKIII can block the reception, but will not get the ring. – Ole Tange Apr 3 '16 at 22:32

I've got an alternative solution.

Mike gets two boxes, and puts the ring in one of them (doesn't matter which). then locks them both with each other's key looped through the lock.
When Jane gets both boxes, she will be able to unlock each with the keys.
To ensure that nobody else does this on the way, Mike can send the boxes one at a time, waiting for a confirmation message from Jane before sending the second.
I'm assuming that it would be quite difficult to make a copy of the key while attached to the box.

Mike can get multiple boxes and each has a dummy ring. The box he want Jane to get would be marked with some secret sign that they agreed to in advance. On each of the dummy boxes should have fake combinations for the combo lock. Mike sends each box to different post offices and the Kleptos would be occupied with the other boxes.